зеркало из https://github.com/microsoft/lisa.git
Added XFS tests (Community Test)
This commit is contained in:
Родитель
c5ab29529b
Коммит
01772763ba
|
@ -0,0 +1,113 @@
|
|||
#!/bin/bash
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
|
||||
# Copyright (c) Microsoft Corporation
|
||||
#
|
||||
# All rights reserved.
|
||||
# Licensed under the Apache License, Version 2.0 (the ""License"");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||
# OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
# ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR
|
||||
# PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
#
|
||||
# See the Apache Version 2.0 License for specific language governing
|
||||
# permissions and limitations under the License.
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# perf_xfstesting.sh
|
||||
# Author : SHITAL SAVEKAR <v-shisav@microsoft.com>
|
||||
#
|
||||
# Description:
|
||||
# Download and run IPERF3 network performance tests.
|
||||
# This script needs to be run on client VM.
|
||||
#
|
||||
# Supported Distros:
|
||||
# Ubuntu 16.04
|
||||
# Supported Filesystems : ext4, xfs
|
||||
|
||||
#######################################################################
|
||||
|
||||
while echo $1 | grep ^- > /dev/null; do
|
||||
eval $( echo $1 | sed 's/-//g' | tr -d '\012')=$2
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
XFSTestConfigFile="xfstests-config.config"
|
||||
touch ./XFSTestingConsole.log
|
||||
|
||||
LogMsg()
|
||||
{
|
||||
echo `date "+%b %d %Y %T"` : "${1}" # Add the time stamp to the log message
|
||||
echo "${1}" >> ./XFSTestingConsole.log
|
||||
}
|
||||
|
||||
InstallXFSTestTools()
|
||||
{
|
||||
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux\|clear-linux-os" /etc/{issue,*release,*version} /usr/lib/os-release`
|
||||
if [[ $DISTRO =~ "Ubuntu" ]] || [[ $DISTRO =~ "Debian" ]];
|
||||
then
|
||||
|
||||
LogMsg "Detected Ubuntu/Debian"
|
||||
until dpkg --force-all --configure -a; sleep 10; do echo 'Trying again...'; done
|
||||
apt-get update
|
||||
apt-get -y install gcc xfslibs-dev uuid-dev libtool xfsprogs e2fsprogs automake libuuid1 libuuidm-ocaml-dev attr libattr1-dev libacl1-dev libaio-dev gawk xfsprogs libgdbm-dev quota fio dbench bc make
|
||||
git clone git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git
|
||||
mv xfstests-dev xfstests
|
||||
cd xfstests
|
||||
./configure
|
||||
make
|
||||
cd ..
|
||||
else
|
||||
LogMsg "Unknown Distro"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -e ${XFSTestConfigFile} ]; then
|
||||
cp -f ${XFSTestConfigFile} ./xfstests/local.config
|
||||
else
|
||||
errMsg="Error: missing ${XFSTestConfigFile} file"
|
||||
LogMsg "${errMsg}"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
#Configure XFS Tools
|
||||
InstallXFSTestTools
|
||||
|
||||
#RunTests
|
||||
if [[ $TestFileSystem == "cifs" ]];
|
||||
then
|
||||
mkdir -p /test1
|
||||
cd xfstests
|
||||
#Download Exclusion files
|
||||
wget https://wiki.samba.org/images/d/db/Xfstests.exclude.very-slow.txt -O tests/cifs/exclude.very-slow
|
||||
wget https://wiki.samba.org/images/b/b0/Xfstests.exclude.incompatible-smb3.txt -O tests/cifs/exclude.incompatible-smb3
|
||||
|
||||
./check -s $TestFileSystem -E tests/cifs/exclude.incompatible-smb3 -E tests/cifs/exclude.very-slow >> ../XFSTestingConsole.log
|
||||
cd ..
|
||||
elif [[ $TestFileSystem == "ext4" ]] || [[ $TestFileSystem == "xfs" ]];
|
||||
then
|
||||
if [[ $TestFileSystem == "xfs" ]];
|
||||
then
|
||||
mkfs.xfs -f /dev/sdc
|
||||
else
|
||||
echo y | mkfs -t $TestFileSystem /dev/sdc
|
||||
fi
|
||||
mkdir -p /test2
|
||||
cd xfstests
|
||||
./check -s $TestFileSystem >> ../XFSTestingConsole.log
|
||||
cd ..
|
||||
else
|
||||
LogMsg "$TestFileSystem is not supported."
|
||||
fi
|
||||
LogMsg "TestCompleted"
|
|
@ -0,0 +1,10 @@
|
|||
[cifs]
|
||||
FSTYP=cifs
|
||||
TEST_DEV=//eosgnortheurope.file.core.windows.net/eosgnortheurope
|
||||
TEST_DIR=/test1
|
||||
TEST_FS_MOUNT_OPTS='-o vers=3.0,username=eosgnortheurope,password=EOSG_NORTHEUROPE_SHARE_PASSWORD,dir_mode=0777,file_mode=0777,sec=ntlmssp'
|
||||
[ext4]
|
||||
FSTYP=ext4
|
||||
TEST_DEV=/dev/sdb1
|
||||
TEST_DIR=/test2
|
||||
TEST_FS_MOUNT_OPTS='-o nobarrier'
|
|
@ -0,0 +1,67 @@
|
|||
$result = ""
|
||||
$testResult = ""
|
||||
$resultArr = @()
|
||||
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
|
||||
if ($isDeployed)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProvisionVMsForLisa -allVMData $allVMData -installPackagesOnRoleNames "none"
|
||||
RemoteCopy -uploadTo $allVMData.PublicIP -port $allVMData.SSHPort -files $currentTestData.files -username "root" -password $password -upload
|
||||
|
||||
$out = RunLinuxCmd -ip $allVMData.PublicIP -port $allVMData.SSHPort -username "root" -password $password -command "chmod +x *.sh"
|
||||
$TestFileSystem = $currentTestData.TestParameters.param.Replace("TestFileSystem=","")
|
||||
$testJob = RunLinuxCmd -ip $allVMData.PublicIP -port $allVMData.SSHPort -username "root" -password $password -command "/root/perf_xfstesting.sh -TestFileSystem $TestFileSystem" -RunInBackground
|
||||
#endregion
|
||||
|
||||
#region MONITOR TEST
|
||||
while ( (Get-Job -Id $testJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $allVMData.PublicIP -port $allVMData.SSHPort -username "root" -password $password -command "tail -1 XFSTestingConsole.log"
|
||||
LogMsg "Current Test Staus : $currentStatus"
|
||||
WaitFor -seconds 20
|
||||
}
|
||||
RemoteCopy -download -downloadFrom $allVMData.PublicIP -files "XFSTestingConsole.log" -downloadTo $LogDir -port $allVMData.SSHPort -username "root" -password $password
|
||||
$XFSTestingConsole = Get-Content "$LogDir\XFSTestingConsole.log"
|
||||
if ( $XFSTestingConsole -imatch "Passed all" )
|
||||
{
|
||||
$testResult = "PASS"
|
||||
}
|
||||
else
|
||||
{
|
||||
$testResult = "FAIL"
|
||||
}
|
||||
foreach ( $line in $XFSTestingConsole.Split("`n"))
|
||||
{
|
||||
LogMsg "$line"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
LogMsg "EXCEPTION : $ErrorMessage"
|
||||
}
|
||||
Finally
|
||||
{
|
||||
$metaData = ""
|
||||
if (!$testResult)
|
||||
{
|
||||
$testResult = "Aborted"
|
||||
}
|
||||
$resultArr += $testResult
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$testResult = "FAIL"
|
||||
$resultArr += $testResult
|
||||
}
|
||||
|
||||
$result = GetFinalResultHeader -resultarr $resultArr
|
||||
|
||||
#Clean up the setup
|
||||
DoTestCleanUp -result $result -testName $currentTestData.testName -deployedServices $isDeployed -ResourceGroups $isDeployed
|
||||
|
||||
#Return the result and summery to the test suite script..
|
||||
return $result
|
|
@ -0,0 +1,30 @@
|
|||
<TestCases>
|
||||
<test>
|
||||
<TestName>FILE-SYSTEM-VERIFICATION-TESTS-CIFS</TestName>
|
||||
<PowershellScript>FILE-SYSTEM-VERIFICATION-TESTS.ps1</PowershellScript>
|
||||
<files>.\Testscripts\Linux\perf_xfstesting.sh,.\Testscripts\Linux\xfstests-config.config</files>
|
||||
<setupType>M1Disk1</setupType>
|
||||
<TestParameters>
|
||||
<param>TestFileSystem=cifs</param>
|
||||
</TestParameters>
|
||||
<Platform>Azure</Platform>
|
||||
<Category>Community</Category>
|
||||
<Area>Community</Area>
|
||||
<Tags>smb</Tags>
|
||||
<TestID>Community_001</TestID>
|
||||
</test>
|
||||
<test>
|
||||
<TestName>FILE-SYSTEM-VERIFICATION-TESTS-EXT4</TestName>
|
||||
<PowershellScript>FILE-SYSTEM-VERIFICATION-TESTS.ps1</PowershellScript>
|
||||
<files>.\Testscripts\Linux\perf_xfstesting.sh,.\Testscripts\Linux\xfstests-config.config</files>
|
||||
<setupType>M1Disk1</setupType>
|
||||
<TestParameters>
|
||||
<param>TestFileSystem=ext4</param>
|
||||
</TestParameters>
|
||||
<Platform>Azure</Platform>
|
||||
<Category>Community</Category>
|
||||
<Area>Community</Area>
|
||||
<Tags>disk</Tags>
|
||||
<TestID>Community_002</TestID>
|
||||
</test>
|
||||
</TestCases>
|
|
@ -0,0 +1,22 @@
|
|||
<TestSetup>
|
||||
<M1Disk1>
|
||||
<isDeployed>NO</isDeployed>
|
||||
<ResourceGroup>
|
||||
<VirtualMachine>
|
||||
<ARMInstanceSize>Standard_DS14_v2</ARMInstanceSize>
|
||||
<RoleName></RoleName>
|
||||
<EndPoints>
|
||||
<Name>SSH</Name>
|
||||
<Protocol>tcp</Protocol>
|
||||
<LocalPort>22</LocalPort>
|
||||
<PublicPort>22</PublicPort>
|
||||
</EndPoints>
|
||||
<DataDisk>
|
||||
<LUN>0</LUN>
|
||||
<DiskSizeInGB>1023</DiskSizeInGB>
|
||||
<HostCaching>None</HostCaching>
|
||||
</DataDisk>
|
||||
</VirtualMachine>
|
||||
</ResourceGroup>
|
||||
</M1Disk1>
|
||||
</TestSetup>
|
Загрузка…
Ссылка в новой задаче