2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 12:20:40 +00:00

Refine test case: nodeset_cmdline, nodeset_runimage, nodeset_shell

This commit is contained in:
junxiawang
2017-06-15 07:15:03 -04:00
parent e562f290ac
commit c92e8eca1a
2 changed files with 24 additions and 7 deletions

View File

@ -2,7 +2,7 @@ start:nodeset_shell
description: verify could log in genesis shell
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s ;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN; cat /tmp/genesistestlog/*;exit 1;fi
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c
check:rc==0
@ -12,7 +12,7 @@ start:nodeset_cmdline
description:verify could run cmdline successfully
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -d;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c
check:rc==0
@ -22,7 +22,7 @@ start:nodeset_runimg
description:verify runimg could work
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -i;if [[ $? -eq 0 ]];then exit 0 ;else cat /var/log/consoles/$$CN;cat /tmp/genesistestlog/*;exit 1;fi
check:rc==0
cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c
check:rc==0

View File

@ -5,7 +5,6 @@ BEGIN
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use strict;
use warnings;
use Getopt::Long;
@ -71,7 +70,8 @@ if (!defined($noderange)) {
print "$::USAGE";
exit 1;
}
my $os = xCAT::Utils->osver("all");
my $os = &get_os;
print "os is $os\n";
if ($check_genesis_file) {
send_msg(2, "[$$]:Check genesis file...............");
&check_genesis_file(&get_arch);
@ -81,8 +81,9 @@ if ($check_genesis_file) {
send_msg(2, "genesis file available");
}
}
my $master=xCAT::TableUtils->get_site_Master();
my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`;
if (!$master) { $master=hostname(); }
print "master is $master\n";
####################################
####nodesetshell test for genesis
@ -236,6 +237,7 @@ sub rungenesisimg {
chmod 0755, "/install/my_image/runme.sh";
`tar -zcvf /tmp/my_image.tgz -C /install/my_image .`;
copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!";
print "master is $master\n";
`rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`;
if ($?) {
send_msg(0, "rinstall noderange failed for runimg");
@ -264,7 +266,7 @@ sub testxdsh {
if (($value == 1) || ($value == 2) || ($value == 3)) {
`xdsh $noderange -t 2 cat $checkfile |grep $checkstring`;
if ($?) {
foreach (1 .. 1500) {
foreach (1 .. 15) {
`xdsh $noderange -t 2 cat $checkfile | grep $checkstring`;
last if ($? == 0);
}
@ -311,6 +313,21 @@ sub clearenv {
return 0;
}
####################################
#get os
###################################
sub get_os {
my $os = "unknown";
my $output = `cat /etc/*release* 2>&1`;
if ($output =~ /suse/i) {
$os = "sles";
} elsif ($output =~ /Red Hat/i) {
$os = "redhat";
} elsif ($output =~ /ubuntu/i) {
$os = "ubuntu";
}
return $os;
}
####################################
#get arch
###################################
sub get_arch {