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:
commit
58eba5d23a
@ -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
|
||||
|
34
xCAT-test/autotest/testcase/copycds/copycds.sh
Executable file
34
xCAT-test/autotest/testcase/copycds/copycds.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user