2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +00:00

Merge pull request #7166 from gurevichmark/nodeset_testcases_boot_wait

Wait for booted status for nodeshell testcases
This commit is contained in:
besawn 2022-05-09 16:23:04 -04:00 committed by GitHub
commit 73e90311ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,8 @@ if ($genesis_nodesetshell_test) {
}
else {
send_msg(2, "Installing with \"nodeset $noderange shell\" for shell test");
sleep 180; # wait 3 min for install to finish
sleep 120; # wait 2 min for install to finish
wait_for_boot();
}
#run nodeshell test
send_msg(2, "prepare for nodeshell script.");
@ -212,7 +213,8 @@ sub rungenesiscmd {
}
else {
send_msg(2, "Installing with \"$rinstall_cmd\" for runcmd test");
sleep 180; # wait 3 min for install to finish
sleep 120; # wait 2 min for install to finish
wait_for_boot();
}
return $value;
}
@ -254,7 +256,8 @@ sub rungenesisimg {
$value = -1;
} else {
send_msg(2, "Installing with \"$rinstall_cmd\" for runimage test\n");
sleep 180; # wait 3 min for install to finish
sleep 120; # wait 2 min for install to finish
wait_for_boot();
}
return $value;
}
@ -343,6 +346,7 @@ sub clearenv {
unlink("$nodestanza");
}
sleep 120; # wait 2 min for reboot to finish
wait_for_boot();
return 0;
}
####################################
@ -410,3 +414,22 @@ sub send_msg {
close LOGFILE;
}
#########################################
### Wait for node to be in "booted" state
##########################################
sub wait_for_boot {
my $iterations = 30; # Max wait 30x10 = 5 min
my $sleep_interval = 10;
my $boot_status;
foreach my $i (1..$iterations) {
$boot_status = `lsdef $noderange -i status -c | cut -d'=' -f2`;
chop($boot_status);
if ($boot_status eq "booted") {
return 0;
}
sleep $sleep_interval;
}
print "After $iterations iterations node status: $boot_status \n";
return 1;
}