Commit 72f94a58 authored by Robert Ricci's avatar Robert Ricci

Fix up bitrot in 'full' mode. Major changes:

1) Set 'BOSSNODE' in the defs file to `hostname` - required for the
   event system
2) Include virtual nodes, and randomize order, when picking nodes
   to run on
3) Run exports_setup after allocating nodes, so they can mount
   homedirs, etc.
4) Enable events in full mode
5) When creating experiment in experiments table, set gid and testdb
6) Run our own copy of stated, so that transitions get recorded
parent 430f634c
......@@ -189,6 +189,7 @@ if (($type eq "full") && (($mode eq "init") || ($mode eq "run"))) {
}
$testdb = "tbdb_$user";
$bossnode = `hostname`;
# Test counts
$pass = 0;
......@@ -311,7 +312,7 @@ sub step_init {
$have{$type} = [];
}
open(AVAIL,"/usr/testbed/sbin/avail includevirt |");
open(AVAIL,"/usr/testbed/sbin/avail includevirt rand |");
while (<AVAIL>) {
if (! /^\|/) {next};
if (/node_id/) {next;}
......@@ -341,6 +342,9 @@ sub step_init {
}
prints " Reserving ";
tbexec("/usr/testbed/bin/nalloc $pid $eid $raw","$path/reserve.log");
# Have to run exports_setup, or the nodes won't come up properly
prints " Setting up exports ";
tbexec("/usr/testbed/sbin/exports_setup","$path/exports_setup.log");
prints " Setting up tmcc redirect ";
$dbh = DBI->connect("DBI:mysql:database=$TBDB;host=localhost") ||
......@@ -373,6 +377,7 @@ sub step_init {
print DEFS "TBDBNAME=$testdb\n";
print DEFS "TBOPSEMAIL=$user\@emulab.net\n";
print DEFS "TBLOGSEMAIL=$user\@emulab.net\n";
print DEFS "BOSSNODE=$bossnode\n";
close(DEFS);
prints " Configuring ";
......@@ -380,10 +385,10 @@ sub step_init {
if ($type eq "full") {
$testmode = "";
} else {
$testmode = "--enable-testmode";
$testmode = "--enable-testmode --disable-events";
}
tbexec("$basedir/../configure --prefix=$path/install $testmode ".
"--disable-events --with-TBDEFS=$path/defs",
"--with-TBDEFS=$path/defs",
"$path/configure.log");
prints " Building ";
......@@ -495,7 +500,7 @@ sub step_init {
# Free nodes we allocated for the experiment and allocate all
# others.
prints " Creating testbed/unavailable in test DB ";
open(AVAIL,"avail |");
open(AVAIL,"avail includevirt |");
$raw = "";
while (<AVAIL>) {
if (! /^\|/) {next};
......@@ -524,8 +529,8 @@ sub step_init {
prints " Setting up test experiment ";
$dbh->do("DELETE from experiments where pid=\"testbed\" and eid=\"test\"");
$dbh->do("INSERT into experiments (pid,eid) "
. "values (\"testbed\",\"test\")") || do {
$dbh->do("INSERT into experiments (pid,gid,eid,testdb) "
. "values (\"testbed\",\"testbed\",\"test\",\"$testdb\")") || do {
prints "FAIL\n";
$fail++;
doexit(1);
......@@ -615,6 +620,17 @@ sub step_test {
next;
}
}
# Start stated
my $statedpid;
if ($type eq "full") {
# Do the fork ourselves, so that we can remember the pid
$statedpid = fork();
if (!$statedpid) {
exec("$path/install/sbin/stated -f") or
die "Error exec()ing $path/sbin/stated: $!\n";
}
}
# We're now ready to run the test.
......@@ -655,6 +671,10 @@ sub step_test {
print FLESTLOG "$result: $test $msg\n";
}
}
if (! kill(15, $statedpid) ) {
prints "WARNING: Unable to kill stated process ($statedpid)\n";
}
close(TESTLOG);
......
......@@ -8,3 +8,4 @@ WWWDEFS=default
IPBASE=192.168
DELAYCAPACITY=2
DISABLE_NAMED_SETUP=1
DISABLE_EVENT_SCHED=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment