diff --git a/xCAT-test/autotest/testcase/pkg/cases0 b/xCAT-test/autotest/testcase/pkg/cases0 index bf2ba6663..c38a9fa81 100644 --- a/xCAT-test/autotest/testcase/pkg/cases0 +++ b/xCAT-test/autotest/testcase/pkg/cases0 @@ -8,6 +8,8 @@ cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c $$osimage pkglist __GETNODEATTR($$CN,os)__ check:rc==0 +cmd:copycds $$ISO +check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -r $$osimage pkglist __GETNODEATTR($$CN,os)__ check:rc==0 cmd:updatenode $$CN -S @@ -60,7 +62,7 @@ cmd:updatenode $$CN -S check:rc==0 cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN dpkg -l |grep xcat ;else xdsh $$CN rpm -qa |grep xCAT-test; fi check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c -o $$osimage __GETNODEATTR($$CN,os)__ +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c -o $$osimage otherpkgdir __GETNODEATTR($$CN,os)__ check:rc==0 cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN dpkg -r xcat-test; else xdsh $$CN rpm -e xCAT-test; fi check:rc==0 @@ -76,10 +78,14 @@ cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -s -o $$osi check:rc==0 cmd:updatenode $$CN -S check:rc==0 +cmd:sleep 10 +check:rc==0 cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN dpkg -l |grep xcat ;else xdsh $$CN rpm -qa |grep xCAT-test; fi check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c -o $$osimage otherpkgdir __GETNODEATTR($$CN,os)__ check:rc==0 +cmd:copycds $$ISO +check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -r -o $$osimage otherpkgdir __GETNODEATTR($$CN,os)__ check:rc==0 cmd:updatenode $$CN -S @@ -99,7 +105,7 @@ cmd:updatenode $$CN -S check:rc==0 cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN dpkg -l |grep xcat ;else xdsh $$CN rpm -qa |grep xCAT-test; fi check:rc==0 -cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c -o $$osimage __GETNODEATTR($$CN,os)__ +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/pkg/pkgtest.pl -c -o $$osimage otherpkgdir __GETNODEATTR($$CN,os)__ check:rc==0 cmd:if echo "__GETNODEATTR($$CN,os)__" | grep ubuntu >/dev/null; then xdsh $$CN dpkg -r xcat-test; else xdsh $$CN rpm -e xCAT-test; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/pkg/pkgtest.pl b/xCAT-test/autotest/testcase/pkg/pkgtest.pl index bf845e4dd..bd91ff631 100755 --- a/xCAT-test/autotest/testcase/pkg/pkgtest.pl +++ b/xCAT-test/autotest/testcase/pkg/pkgtest.pl @@ -53,15 +53,15 @@ sub getimgattr my $pkglistvalue; print " output is @output \n"; if($?){ - print "unkonw"; + print "unkonw"; return "Unknown"; } if($? == 0){ foreach my $output1 (@output){ - if($output1 =~ /$ARGV[1]=(.*)/){ + if($output1 =~ /$ARGV[1]=(.*)/){ print "output1 is $output1 ,attrs is $ARGV[1] value is $1 \n"; - $pkglistvalue = $1 ; - } + $pkglistvalue = $1 ; + } } } return $pkglistvalue; } @@ -71,15 +71,15 @@ sub setupenv my $int = shift; if ($ospkg){ `mkdir -p $int`; - `cp -rf /xcat-core $int`; + `cp -rf /xcat-core/* $int`; }else{ - `cp $int /tmp/pkgtest.bak`; + `cat "$int" >> /tmp/pkgtest.bak`; } - if (($ARGV[2] =~ /ubuntu/)&&($ospkg ==0)){ - `echo "rpm" >>/tmp/pkgtest.bak `; - }else{ - `echo "xCAT-test" >>/tmp/pkgtest.bak `; - } + if (($ARGV[2] =~ /ubuntu/)&&($ospkg ==0)){ + `echo "rpm" >>/tmp/pkgtest.bak `; + }else{ + `echo "xCAT-test" >>/tmp/pkgtest.bak `; + } } sub clearenv { @@ -98,15 +98,15 @@ sub setupenvinclude my $int = shift; if ($ospkg){ `mkdir -p $int`; - `cp -rf /xcat-core $int`; - }else{ - ` cp $int /tmp/pkgtest.bak`; - } + `cp -rf /xcat-core/* $int`; + }else{ + ` cat $int >> /tmp/pkgtest.bak`; + } if (($ARGV[2] =~ /ubuntu/)&&($ospkg ==0)){ - `echo "rpm" >>/tmp/pkgtest.bak `; - }else{ - `echo "xCAT-test" >> /tmp/pkgtest.includelist `; - } + `echo "rpm" >>/tmp/pkgtest.bak `; + }else{ + `echo "xCAT-test" >> /tmp/pkgtest.includelist `; + } `echo "#INCLUDE:/tmp/pkgtest.includelist#">>/tmp/pkgtest.bak `; } sub removerpm @@ -114,10 +114,10 @@ sub removerpm my $int = shift; if ($ospkg){ `mkdir -p $int`; - `cp -rf /xcat-core $int`; - }else{ - ` cp $int /tmp/pkgtest.bak`; - } + `cp -rf /xcat-core/* $int`; + }else{ + `cat "$int" >> /tmp/pkgtest.bak`; + } if (($ARGV[2] =~ /ubuntu/)&&($ospkg ==0)){ `echo "-rpm" >>/tmp/pkgtest.bak `; }elsif(($ARGV[2] =~ /ubuntu/)&&($ospkg !=0)){