2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

Merge pull request #6355 from cxhong/testcase

Add verification test case for copycds
This commit is contained in:
Victor Hu 2019-06-11 14:43:39 -04:00 committed by GitHub
commit 58eba5d23a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -9,6 +9,8 @@ check:output=~Copying media to /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($
check:output=~Media copy operation successful
cmd:ls /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__
check:rc==0
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/copycds/copycds.sh __GETNODEATTR($$CN,os)__
check:rc==0
end
start:lskmodules_o

View File

@ -0,0 +1,34 @@
#!/bin/bash
if [[ -z ${1} ]]; then
echo "ERROR, pass in the '\$OS' variable as the second argument"
exit 1
fi
OS=${1}
if [[ $OS != *"rhels"* ]]; then
echo "INFO: will not run this test for $OS"
exit 0
fi
MAJOR_OS_VER=${OS%.*}
if [[ $OS == *"$MAJOR_OS_VER"* ]]; then
IFS='
'
for image in `lsdef -t osimage -i template -c | grep $OS | grep "install"`; do
THE_NAME=`echo $image | cut -d' ' -f1`
THE_TEMPLATE=`echo $image | cut -d' ' -f2`
TEMPLATE_FILE=`echo $THE_TEMPLATE | cut -d= -f2`
if [[ $TEMPLATE_FILE != *"$MAJOR_OS_VER"* ]]; then
echo "ERROR - template attribute not set correctly when copycds for $THE_NAME"
echo -e "ERROR - $TEMPLATE_FILE"
exit 1
else
echo "Template file looks good for $THE_NAME"
echo -e "\t$THE_TEMPLATE"
fi
done
fi
exit 0