diff --git a/configure b/configure index 9493a25fc80e60c3211b0c9f07292cca2ef6df54..1a0b8d7eaec7282923e7a8a95c12bec948b07af9 100755 --- a/configure +++ b/configure @@ -998,6 +998,7 @@ if test "${with_SSH_ARGS+set}" = set; then else SSH_ARGS="-q -o \"BatchMode yes\" -o \"StrictHostKeyChecking no\"" + SSH_ARGS="$SSH_ARGS -o \"Protocol 1\"" fi @@ -1228,7 +1229,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \ tbsetup/portstats tbsetup/vnode_setup tbsetup/staticroutes \ tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \ - tbsetup/checkports tbsetup/webidlecheck \ + tbsetup/checkports tbsetup/webidlecheck tbsetup/webnodereboot \ tip/GNUmakefile \ tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \ tmcd/ron/GNUmakefile \ diff --git a/configure.in b/configure.in index 31373a6c6d64729427969eb1d236857959b16bcd..2367f2d3f16466cc8237a1b676ea40798c96d560 100755 --- a/configure.in +++ b/configure.in @@ -155,6 +155,7 @@ AC_ARG_WITH(SSH_ARGS, SSH_ARGS="$withval" ],[ SSH_ARGS="-q -o \"BatchMode yes\" -o \"StrictHostKeyChecking no\"" + SSH_ARGS="$SSH_ARGS -o \"Protocol 1\"" ]) AC_SUBST(SSH_ARGS) @@ -300,7 +301,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \ tbsetup/portstats tbsetup/vnode_setup tbsetup/staticroutes \ tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \ - tbsetup/checkports tbsetup/webidlecheck \ + tbsetup/checkports tbsetup/webidlecheck tbsetup/webnodereboot \ tip/GNUmakefile \ tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \ tmcd/ron/GNUmakefile \ diff --git a/tbsetup/mkacct.in b/tbsetup/mkacct.in index 35544fd3106e0f535c1a8a4bd25319e14c9dfba0..45edfa29444678256a2f88a185914f9d8b471439 100755 --- a/tbsetup/mkacct.in +++ b/tbsetup/mkacct.in @@ -368,18 +368,28 @@ if ($auditmode) { exit(0); sub fatal { - local($msg) = $_[0]; + my($msg) = @_; + + my $flist = (); + if (defined($logname)) { + $flist = ($logname); + } - SENDMAIL($TBOPS, "mkacct $user Failed", $msg, $TBOPS, undef, - (defined($logname) ? ($logname) : ())); - die("$0: $msg\n"); + SENDMAIL($TBOPS, "mkacct $user Failed", $msg, $TBOPS, undef, $flist); + + if (defined($logname)) { + unlink($logname); + } + die("*** $0:\n". + " $msg\n"); } sub AUDIT($) { my($msg) = @_; - SENDMAIL($TBLOGS, "mkacct $user Complete", $msg, $TBOPS, undef, $logname); + SENDMAIL($TBLOGS, "mkacct $user Complete", $msg, + $TBOPS, undef, ($logname)); } # @@ -417,7 +427,7 @@ sub FirstTime() if ($mypid) { waitpid($mypid, 0); if ($?) { - exit($? >> 0); + fatal("Failed to do firsttime user stuff!"); } return; } @@ -427,9 +437,13 @@ sub FirstTime() TBdbfork(); + # + # Below here, use die() instead of fatal(). + # + if ($dossh) { - if (system("$KEYGEN -P '' -f $SSHDIR/identity")) { - fatal("Failure in ssh-keygen"); + if (system("$KEYGEN -t rsa1 -P '' -f $SSHDIR/identity")) { + die("Failure in ssh-keygen"); } # @@ -460,10 +474,10 @@ sub FirstTime() print "Setting up .forward file for $user.\n"; if (system("echo \"$user_email\" > $HOMEDIR/$user/.forward")) { - fatal("Could not create $HOMEDIR/$user/.forward"); + die("Could not create $HOMEDIR/$user/.forward"); } chmod(0644, "$HOMEDIR/$user/.forward") or - fatal("Could not chmod $HOMEDIR/$user/.forward"); + die("Could not chmod $HOMEDIR/$user/.forward"); } # diff --git a/tbsetup/webnodereboot.in b/tbsetup/webnodereboot.in new file mode 100644 index 0000000000000000000000000000000000000000..423d91688434427d9d48a77bb168dff88d07970c --- /dev/null +++ b/tbsetup/webnodereboot.in @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w +use English; + +# +# This gets invoked from the Web interface. Simply a wrapper for experiment +# termination. +# + +# +# Configure variables +# +my $TB = "@prefix@"; + +# +# Run the real thing, and never return. +# +exec "$TB/bin/node_reboot", @ARGV; + +die("*** $0:\n". + " Could not exec program: $!"); diff --git a/testsuite/tbstub b/testsuite/tbstub index ca7c847206fa90f4b3d05abcce4a4727af974d2d..86a04977e0285e657669522cbbbdc7a477853d19 100755 --- a/testsuite/tbstub +++ b/testsuite/tbstub @@ -33,6 +33,9 @@ if ($#ARGV != 4) { # The status of the test. $status = ""; +# A counter. +$counter = 0; + sub doexit { if ($status eq "") { $status = "PASS"; @@ -53,6 +56,7 @@ $pid = $::pid; $test = $::test; $dir = $::dir; $dbh = $::dbh; +$db = $::db; sub tb_prerun { my ($cmd,$exitcode) = @_; @@ -63,6 +67,10 @@ sub tb_prerun { } close(TBEXEC); $ecode = ($? >> 8); + +# system("mysqldump --all $db > $cmd-$::counter.txt"); + $::counter++; + if ($ecode != $exitcode) { tb_fail("$cmd - Exit code $ecode, expected $exitcode"); } @@ -102,6 +110,10 @@ sub tb_run { } close(TBEXEC); $ecode = ($? >> 8); + +# system("mysqldump --all $db > $cmd-$::counter.txt"); + $::counter++; + if ($ecode != $exitcode) { tb_fail("$cmd - Exit code $ecode, expected $exitcode"); }