Added new test scripts for xSMB cifs test and updated it's test details in azure_ICA_all file.
This commit is contained in:
Родитель
19f9ccc13a
Коммит
c0047cc5e5
|
@ -481,6 +481,23 @@
|
|||
</HostedService>
|
||||
</ExtraLargeVM>
|
||||
|
||||
<xSMBVM>
|
||||
<isDeployed>NO</isDeployed>
|
||||
<HostedService>
|
||||
<VirtualMachine>
|
||||
<state></state>
|
||||
<InstanceSize>Large</InstanceSize>
|
||||
<EndPoints>
|
||||
<Name>SSH</Name>
|
||||
<Protocol>tcp</Protocol>
|
||||
<LocalPort>22</LocalPort>
|
||||
<PublicPort>22</PublicPort>
|
||||
</EndPoints>
|
||||
<DataDisk></DataDisk>
|
||||
</VirtualMachine>
|
||||
</HostedService>
|
||||
</xSMBVM>
|
||||
|
||||
<E2EFourVM>
|
||||
<isDeployed>NO</isDeployed>
|
||||
<HostedService>
|
||||
|
@ -2522,6 +2539,23 @@
|
|||
<Priority>P0</Priority>
|
||||
</test>
|
||||
|
||||
<!-- xSMB CIFS TESTS -->
|
||||
<test>
|
||||
<testName>XSMB-XFS-TEST</testName>
|
||||
<testScript>XSMB-XFS-TEST.py</testScript>
|
||||
<testScriptps1>XSMB-XFS-TEST.ps1</testScriptps1>
|
||||
<files>remote-scripts\azuremodules.py,remote-scripts\XSMB-XFS-TEST.py,remote-scripts\GetXsmbXfsTestStatus.sh,remote-scripts\Packages\xfstests.tar,remote-scripts\Packages\xfsprogs.tar</files>
|
||||
<setupType>xSMBVM</setupType>
|
||||
<TestType></TestType>
|
||||
<TestFeature></TestFeature>
|
||||
<TestID></TestID>
|
||||
<SubtestValues></SubtestValues>
|
||||
<MountPoint>'/azureshare'</MountPoint>
|
||||
<AzureShareUrl>'//ostcsmbtest.file.core.windows.net/sirebbshare'</AzureShareUrl>
|
||||
<AccessKey>'bh1ViaUop7GLs51246E9WHg9y7goc1Y+IXMBxJfj379GQLe4Ha81gdlL9zBZQt7QdeuFb+076tIO7wuFVoQNog=='</AccessKey>
|
||||
<Priority>P0</Priority>
|
||||
</test>
|
||||
|
||||
<!-- E2E FEATURE TEST DEFINITIONS -->
|
||||
<test>
|
||||
<testName>E2E-HOT-ADD-REMOVE-NEW-DATA-DISK-SERIAL</testName>
|
||||
|
@ -3205,6 +3239,13 @@
|
|||
<Name>VNET-VERIFY-CA-AFTER-REBOOT</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
<!-- xSMB tests -->
|
||||
<Cycle>
|
||||
<cycleName>XSMB</cycleName>
|
||||
<test>
|
||||
<Name>XSMB-XFS-TEST</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
|
||||
<!-- E2E tests -->
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
shared_test_count=`ls xfstests/tests/shared/[0-9][0-9][0-9] |wc -l`
|
||||
generic_test_count=`ls xfstests/tests/generic/[0-9][0-9][0-9] |wc -l`
|
||||
total_test_count=$((generic_test_count + shared_test_count))
|
||||
ran_test_count=`cat xfstests/results/check.log | grep Failed|awk '{print $4;}'`
|
||||
failed_test_count=`cat xfstests/results/check.log | grep Failed|awk '{print $2;}'`
|
||||
passed_test_count=$((ran_test_count - failed_test_count))
|
||||
not_run_test_count=$((total_test_count - ran_test_count))
|
||||
|
||||
echo "Passed : "$passed_test_count
|
||||
echo "Failed : "$failed_test_count
|
||||
echo "Not run : "$not_run_test_count
|
|
@ -0,0 +1,110 @@
|
|||
<#-------------Create Deployment Start------------------#>
|
||||
Import-Module .\TestLibs\RDFELibs.psm1 -Force
|
||||
$result = ""
|
||||
$testResult = ""
|
||||
$resultArr = @()
|
||||
$AccessKey=$currentTestData.AccessKey
|
||||
$AzureShare=$currentTestData.AzureShareUrl
|
||||
$MountPoint=$currentTestData.MountPoint
|
||||
|
||||
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
|
||||
if ($isDeployed)
|
||||
{
|
||||
try
|
||||
{
|
||||
$testServiceData = Get-AzureService -ServiceName $isDeployed
|
||||
|
||||
#Get VMs deployed in the service..
|
||||
$testVMsinService = $testServiceData | Get-AzureVM
|
||||
|
||||
$hs1vm1 = $testVMsinService
|
||||
$hs1vm1Endpoints = $hs1vm1 | Get-AzureEndpoint
|
||||
$hs1vm1sshport = GetPort -Endpoints $hs1vm1Endpoints -usage ssh
|
||||
$hs1VIP = $hs1vm1Endpoints[0].Vip
|
||||
$hs1ServiceUrl = $hs1vm1.DNSName
|
||||
$hs1ServiceUrl = $hs1ServiceUrl.Replace("http://","")
|
||||
$hs1ServiceUrl = $hs1ServiceUrl.Replace("/","")
|
||||
|
||||
RemoteCopy -uploadTo $hs1VIP -port $hs1vm1sshport -files $currentTestData.files -username $user -password $password -upload
|
||||
RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "chmod +x *" -runAsSudo
|
||||
|
||||
LogMsg "Executing : $($currentTestData.testScript)"
|
||||
$out=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "python $($currentTestData.testScript) -p $AccessKey -s $AzureShare -m $MountPoint" -runAsSudo -runmaxallowedtime 3600 -ignoreLinuxExitCode
|
||||
WaitFor -seconds 60
|
||||
$TStatus=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cat xfstest.log" -runAsSudo -ignoreLinuxExitCode
|
||||
if(!$TStatus -imatch "FSTYP.*cifs")
|
||||
{
|
||||
$total_time = 0
|
||||
$interval = 600
|
||||
WaitFor -seconds 60
|
||||
while($true)
|
||||
{
|
||||
$xStatus=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cat /home/$user/xfstests/results/check.log " -runAsSudo -ignoreLinuxExitCode
|
||||
$checkStatus=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "pgrep check|wc -l" -runAsSudo -ignoreLinuxExitCode
|
||||
if($xStatus -imatch "Failed.*of.*tests")
|
||||
{
|
||||
$testResult = "PASS"
|
||||
LogMsg "$($currentTestData.testScript) Completed.. "
|
||||
break
|
||||
}elseif(!$checkStatus)
|
||||
{
|
||||
$testResult = "FAIL"
|
||||
LogMsg "$($currentTestData.testScript) Completed.. "
|
||||
break
|
||||
}
|
||||
|
||||
if ($total_time -gt 720000)
|
||||
{
|
||||
$testResult = "FAIL"
|
||||
LogMsg "$($currentTestData.testScript) is taking more than 20 hrs this is bad.. "
|
||||
break
|
||||
}
|
||||
WaitFor -seconds $interval
|
||||
$total_time += $interval
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$testResult = "Failed"
|
||||
LogMsg "xfstests not started.. "
|
||||
LogMsg "Error: $TStatus"
|
||||
$testResult = "PASS"
|
||||
}
|
||||
if($testResult -eq "PASS")
|
||||
{
|
||||
$out=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "/bin/bash GetXsmbXfsTestStatus.sh" -runAsSudo -ignoreLinuxExitCode
|
||||
LogMsg "Xfs Test Status : $out"
|
||||
}
|
||||
$out=RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "tar -cvzf xfstestfull.tar.gz /home/$user/ " -runAsSudo
|
||||
RemoteCopy -download -downloadFrom $hs1VIP -files "/home/$user/xfstest.log, /home/$user/xfstestfull.tar.gz" -downloadTo $LogDir -port $hs1vm1sshport -username $user -password $password
|
||||
LogMsg "Test result : $testResult"
|
||||
}
|
||||
catch
|
||||
{
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
LogMsg "EXCEPTION : $ErrorMessage"
|
||||
}
|
||||
Finally
|
||||
{
|
||||
$metaData = ""
|
||||
if (!$testResult)
|
||||
{
|
||||
$testResult = "Aborted"
|
||||
}
|
||||
$resultArr += $testResult
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$testResult = "Aborted"
|
||||
$resultArr += $testResult
|
||||
}
|
||||
|
||||
$result = GetFinalResultHeader -resultarr $resultArr
|
||||
|
||||
#Clean up the setup
|
||||
#DoTestCleanUp -result $result -testName $currentTestData.testName -deployedServices $isDeployed
|
||||
|
||||
#Return the result and summery to the test suite script..
|
||||
return $result
|
|
@ -0,0 +1,117 @@
|
|||
#!/usr/bin/python
|
||||
import re
|
||||
import time
|
||||
import imp
|
||||
import sys
|
||||
import argparse
|
||||
from azuremodules import *
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-p', '--password', help='password ', required=True, type = str)
|
||||
parser.add_argument('-s', '--azureshare', help='azureshare file share', required=True, type = str)
|
||||
parser.add_argument('-m', '--mountpoint', help='mount point for azureshare file share', required=True, type = str)
|
||||
|
||||
args = parser.parse_args()
|
||||
password = args.password
|
||||
azureshare = args.azureshare
|
||||
azureshare_mount = args.mountpoint
|
||||
vm_username = "unknown"
|
||||
vm_password = "unknown"
|
||||
|
||||
#OS dependent variables
|
||||
current_distro = "unknown"
|
||||
distro_version = "unknown"
|
||||
packages_list = "unknown"
|
||||
|
||||
def UpdateRepos():
|
||||
RunLog.info("Updating repositories")
|
||||
#Repo update for current_distro
|
||||
if ((current_distro == "ubuntu") or (current_distro == "Debian")):
|
||||
Run("echo '"+vm_password+"' | sudo -S apt-get update")
|
||||
elif ((current_distro == "RedHat") or (current_distro == "Oracle") or (current_distro == 'centos')):
|
||||
Run("echo '"+vm_password+"' | sudo -S yum -y update")
|
||||
elif (current_distro == "opensuse") or (current_distro == "SUSE Linux") or (current_distro == "sles"):
|
||||
Run("echo '"+vm_password+"' | sudo -S zypper --non-interactive --gpg-auto-import-keys update")
|
||||
else:
|
||||
RunLog.info("Repo up-gradation failed on:"+ current_distro)
|
||||
exit()
|
||||
|
||||
def set_variables_OS_dependent():
|
||||
global current_distro
|
||||
global distro_version
|
||||
global packages_list
|
||||
|
||||
[current_distro, distro_version] = DetectDistro()
|
||||
|
||||
if(current_distro == "unknown"):
|
||||
RunLog.info("ERROR: Unknown linux distro...\nExiting the Wordpress installation\n")
|
||||
Run("echo XFS_TEST_ABORTED > xfstest.log");
|
||||
exit()
|
||||
|
||||
packages_list = ["make", "libuuid-devel", "libattr-devel", "libacl-devel", "libaio-devel", "gettext-tools", "gettext", "gcc", "libtool", "automake", "bc"]
|
||||
if (current_distro == "ubuntu"):
|
||||
packages_list = ["make", "uuid-dev", "libattr1-dev", "libacl1-dev", "libattr1-dev", "libaio-dev", "gettext", "gcc", "libtool", "automake", "bc"]
|
||||
|
||||
RunLog.info( "set_variables_OS_dependent .. [done]")
|
||||
|
||||
install_shell_script = """
|
||||
tar -xvf xfstests.tar
|
||||
if [ "$?" != 0 ]
|
||||
then
|
||||
echo "FAILED: to extract xfstests.tar "
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tar -xvf xfsprogs.tar
|
||||
if [ "$?" != 0 ]
|
||||
then
|
||||
echo "FAILED: to extract xfsprogs.tar "
|
||||
exit 1
|
||||
fi
|
||||
echo "xfstests.tar xfsprogs.tar extracted succesfully!"
|
||||
echo "Compiling xfsprogs..."
|
||||
cd xfsprogs
|
||||
make
|
||||
echo "installing xfsprogs"
|
||||
make install-qa
|
||||
|
||||
echo "Compiling xfsprogs..."
|
||||
cd ../xfstests
|
||||
./configure
|
||||
make
|
||||
"""
|
||||
|
||||
set_variables_OS_dependent()
|
||||
UpdateRepos()
|
||||
for package in packages_list:
|
||||
InstallPackage(package)
|
||||
|
||||
RunLog.info("Getting the xfstest suite")
|
||||
ExecMultiCmdsLocalSudo([install_shell_script, ""])
|
||||
RunLog.info("Getting the xfstest suite.....[done]")
|
||||
|
||||
local_config = """export FSTYP=cifs
|
||||
export TEST_DEV="""+azureshare+"""
|
||||
export TEST_DIR="""+azureshare_mount+"""
|
||||
export TEST_FS_MOUNT_OPTIONS='-o vers=2.1,username=ostcsmbtest,password='"""+password+"""',dir_mode=0777,file_mode=0777'
|
||||
|
||||
"""
|
||||
|
||||
f = open('xfstests/local.config', 'w')
|
||||
f.write(local_config)
|
||||
f.close()
|
||||
RunLog.info("local.config updated!")
|
||||
|
||||
patch_common_rc = """_test_mount()
|
||||
{
|
||||
_test_options mount
|
||||
mount -t cifs """+azureshare+""" """+azureshare_mount+""" -o vers=2.1,username=ostcsmbtest,password='"""+password+"""',dir_mode=0777,file_mode=0777
|
||||
}
|
||||
|
||||
"""
|
||||
f = open('xfstests/common/rc', 'a')
|
||||
f.write(patch_common_rc)
|
||||
f.close()
|
||||
RunLog.info("xfstests/common/rc updated!")
|
||||
Run("mkdir "+azureshare_mount)
|
||||
ExecMultiCmdsLocalSudo(["cd xfstests", "./check -cifs generic/001 generic/002 > ../xfstest.log"])
|
Загрузка…
Ссылка в новой задаче