image-test 18.3 KB
Newer Older
1 2
#!/usr/bin/perl -w

Kevin Atkinson's avatar
Kevin Atkinson committed
3 4
#
# Copyright (c) 2005-2006 University of Utah and the Flux Group.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Kevin Atkinson's avatar
Kevin Atkinson committed
24 25
#

26 27
########################################################################

28 29
# This value is prefixed to all experiments to avoid conflicts with
# existing experient names
30 31
my $eid_prefix = 'it-';

32 33 34 35 36 37
# Maxium length of experment name
my $max_eid_length = 19;

# Where libxmlrpc is
use lib "/usr/testbed/lib";

38 39
########################################################################
#
40
# Prelude
41
#
42 43

use strict;
44 45 46 47

use ImageTest;
use Cwd;
use Getopt::Long;
48 49 50
use POSIX 'setsid';
use POSIX ':sys_wait_h';
use Errno 'EINTR';
51

52 53
use libxmlrpc;

54 55 56
sub true() {1}
sub false() {0}

57 58 59 60 61 62 63
sub LARGE_NUM {100000}

########################################################################
#
# Process command-line arguments
#

64
sub usage() {
65
  die "usage: $0 -? | -l | [OPTIONS] IMAGE [EXPS ...]\n";
66 67 68 69
}

sub help() {
  print
70
    ("usage: $0 -h | -l | [OPTIONS] IMAGE [EXPS ...]\n".
71
     "  IMAGE      image to use\n".
72 73
     "  EXPS       if present only run these particular experiments\n".
     "  -? --help  print this help message\n".
74
     "  -l --list  just list the available experements\n".
75
     "OPTIONS:\n".
76
     "  -s STAGES  only execute particular stages of the experiment where\n".
77 78 79
     "             STAGES is any one of:\n".
     "               c: create, s: swapin, t: test o: swapout, e: end experment\n".
     "             (note 'e' implies 'o')\n".
80 81
     "  -p         run experments in parallel\n".
     "  -m NUM     soft limit on the maximum number of nodes to use at once\n".
82
     "  -M NUM     hard limit on the maximum number of nodes to use at once\n".
83 84 85
     "  -e FILE    exceptions file to use\n".
     "  -u         don't swap an experment out with unexpected failed tests\n".
     "  -h         halt on failed swapouts\n".
86
     "  --eid-prefix STR  (default \"it-\")\n".
87
     "  --skip-std-tests  skip standard tests expect for ssh-*\n");
88 89 90
}

die usage unless @ARGV > 0;
91
my $ARGV = join ' ', @ARGV;
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

my $cwd = cwd();
$cwd =~ s~^/q/~/~;
die "Working Directory needs to be in /proj\n" unless $cwd =~ m~^/proj~;

my $basedir = $cwd;

my $srcdir = $cwd;
my $destdir = $cwd;

my $date=`date +%Y%m%d%H%M`;
chop $date;
$destdir="$destdir/results-$date";

my $testsdir = "$srcdir/tests";

my ($pid) = $cwd =~ m~^/proj/(.+?)/~;

my @argv;

my $stages = 'cstoe';
113 114 115
my $in_parallel;
my $soft_limit = 5;
my $hard_limit = 0;
116 117 118
my $exceptions_file;
my $dont_swapout_unexpected = false;
my $halt_failed_swapouts = false;
119
my $just_list;
120
my $skip_std_tests = false;
121

122 123
Getopt::Long::Configure 'no_ignore_case';

124
GetOptions
125
    "help|?" => sub {help(); exit 0;},
126 127 128 129
    "s=s" => \$stages,
    "p" => \$in_parallel,
    "m=i" => \$soft_limit,
    "M=i" => \$hard_limit,
130 131 132
    "e=s" => \$exceptions_file,
    "u" => \$dont_swapout_unexpected,
    "h" => \$halt_failed_swapouts,
133
    "l|list" => \$just_list,
134
    "eid-prefix=s" => \$eid_prefix,
135
    "skip-std-tests" => \$skip_std_tests
136 137
  or usage();

138 139 140 141
$soft_limit = LARGE_NUM   if $soft_limit == 0;
$hard_limit = LARGE_NUM   if $hard_limit == 0;
$soft_limit = $hard_limit if $soft_limit > $hard_limit;

142
if (@ARGV == 0 && !$just_list) {
143 144 145 146
  print STDERR "Must specify an image.\n";
  usage();
}

147 148 149 150 151 152 153 154
my $os = shift @ARGV;
my @exps_torun = map {lc} @ARGV;

if ($stages =~ /([^cstoe])/) {
  print STDERR "Unknown stage, \"$1\", in stage string.\n" if $stages =~ /([^cstoe])/;
  usage();
}

155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
########################################################################
#
# Get the list of exceptions
#

my @exps_toskip;
my %tests_toskip;
my %tests_toignore;

if (defined $exceptions_file) {

  open F, $exceptions_file;

  my $lineno = 1;
  while (<F>) {
    chop;
    s/\#.*//;
    s/^\s+//;
    next unless /\S/;
    if (s/^in\s+(\S+)\s+//) {
      my $exp = $1;
      if (s/^skip\s+//) {
	my @tests = split /\s+/;
	push @{$tests_toskip{$exp}}, @tests; 
      } elsif (s/^ignore\s+//) {
	my @tests = split /\s+/;
	push @{$tests_toignore{$exp}}, @tests;
      } else {
	die "Syntax error in line $lineno of \"$exceptions_file\"\n";
      }
    } elsif (s/^skip\s+//) {
      my @exps = split /\s+/;
      push @exps_toskip, @exps;
    } else {
      die "Syntax error in line $lineno of \"$exceptions_file\"\n";
    }
    $lineno++;
  }

}


197 198
########################################################################
#
199
# Get the list of experments to run
200 201 202 203 204 205
#

sub get_parms ($);
sub get_numnodes ($);
sub mktests ($$$@);

206 207 208 209 210 211
my @exps;
my %exps;
my @exps_inseries;
my $num_exps_inparallel = 0;
my @exps_inparallel_bysize;

212 213 214 215
my @p;

opendir D, "$testsdir";
while (my $test = readdir D) {
216
  next if $test =~ /^(\.|CVS)/;
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
  @p = get_parms $test;
  mktests $test, get_numnodes $test, [], @p;
}

sub get_parms ($) {
  my ($test) = @_;
  my @p;
  open F, "$testsdir/$test/parms" or return;
  while (<F>) {
    chop;
    next if /^\s*$/;
    my ($key, $value) = /^\s*(.+?)\s*:\s*(.+?)\s*$/ or die "?$_?";
    my @values = split /\s+/, $value;
    push @p, [$key, [@values]];
  }
  return @p;
}

sub get_numnodes ($) {
  # FIXME: needs better error detection
  my ($test) = @_;
238
  open F, "$testsdir/$test/num-nodes" or die "Unable to open $test/num-nodes\n";
239 240 241 242 243
  local $_ = <F>;
  chop;
  return $_;
}

244 245
sub use_exp ( $ );
sub get_exceptions ( $$ );
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260

sub mktests ($$$@) {
  my ($test, $numnodes, $what, @parms) = @_;
  if (@parms == 0) {
    my $t = $test;
    for (my $i = 1; $i < @$what; $i += 2) {$t .= "-".lc($what->[$i])}
    return unless use_exp $t;
    $exps{$t} = {pid => $pid,
		 eid => "$eid_prefix$t",
		 numnodes => $numnodes,
		 os => $os,
		 datadir => "$testsdir/$test",
		 resultsdir => "$destdir/$t",
		 @$what,
		 stages => $stages,
261 262 263
		 dont_swapout_unexpected => $dont_swapout_unexpected,
		 skip => get_exceptions($t, \%tests_toskip),
		 ignore =>  get_exceptions($t, \%tests_toignore),
264
		 skip_std_tests => $skip_std_tests};
265 266 267 268 269 270 271 272 273 274 275
    push @exps, $t;
  } else {
    my $p = shift @parms;
    foreach (@{$p->[1]}) {
      mktests $test, $numnodes, [@$what, $p->[0], $_], @parms;
    }
  }
}

sub use_exp ($) {
  my ($exp) = @_;
276 277 278 279
  foreach my $e (@exps_toskip) {
    return false if ($e eq $exp);
    return false if $exp =~ /^$e-/;
  }
280 281 282 283 284 285 286 287
  return true if (@exps_torun == 0);
  foreach my $e (@exps_torun) {
    return true if ($e eq $exp);
    return true if $exp =~ /^$e-/;
  }
  return false;
}

288 289 290 291 292 293 294 295 296 297
sub get_exceptions ($$) {
  my ($exp, $exceptions) = @_;
  my @res;
  foreach my $e (keys %$exceptions) {
    push(@res, @{$exceptions->{$e}})
	if $e eq '*' || $e eq $exp || $exp =~ /^$e-/;
  }
  return \@res;
}

298 299
########################################################################
#
300
# Handle the just list case
301 302 303 304 305 306 307 308 309
#

if ($just_list) {
  foreach (@exps) {
    print "$_\n";
  }
  exit 0;
}

310 311 312 313 314 315
########################################################################
#
# Perform some basic pre-checks to catch common errors.
#

#
316
# Check to make sure the image exists
317 318
#

319 320 321 322 323 324 325 326 327 328 329 330 331
if ($stages =~ /c/ || $os ne '.') {
  my $res = CallMethod0("osid", "getlist", {});
  die $res->{output} unless $res->{code} == 0;
  my $found_image = false;
  while (my ($k,$v) = each %{$res->{value}}) {
    next unless $v->{pid} eq 'emulab-ops' || $v->{pid} eq $pid;
    $found_image = true if ($k eq $os);
  }
  if (!$found_image) {
    print STDERR "The osid \"$os\" doesn't exists in the \"emulab-ops\" or \"$pid\" project.\n";
    exit 2;
  }
}
332 333 334 335 336 337

#
# Check to make sure that each experiment is a valid name and
# it doesn't already exists.
#

338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
my $eid_to_long = '';
foreach my $e (@exps) {
  my $eid = "$eid_prefix$e";
  if (length($eid) > $max_eid_length) {
    $eid_to_long = $eid unless length($eid_to_long) > length($eid);
  }
}
if (length($eid_to_long) > 0) {
  print STDERR "The experiment name \"$eid_to_long\" is longer than $max_eid_length characters.\n";
  exit 2;
}

if ($stages ne 'e') {
  my $exp_errors = 0;

  foreach my $e (@exps) {
    my $eid = "$eid_prefix$e";
    my $res = CallMethod0("experiment", "state", {proj=>$pid, exp=>$eid});
    die $res->{output} unless $res->{code} == 0 || $res->{code} == 2;
    if ($stages =~ /c/) {
      # should't exist
      if ($res->{code} != 2) {
	print STDERR "Experiment \"$eid\" in \"$pid\" must not exist.\n";
	$exp_errors++;
      }
    } elsif ($stages =~ /s/) {
      # need to exist, but not be swapped in
      if ($res->{code} != 0 || $res->{value} ne 'swapped') {
	print STDERR "Experiment \"$eid\" in \"$pid\" must be in the \"swapped\" state.\n";
	$exp_errors++;
      }
    } else {
      # need to exist, and be swapped in
      if ($res->{code} != 0 || $res->{value} ne 'active') {
	print STDERR "Experiment \"$eid\" in \"$pid\" must be in the \"active\" state.\n";
	$exp_errors++;
      }
    }
  }
  if ($exp_errors) {
    exit 2;
  }
380 381
}

382 383 384 385
#sub experment_precheck($) {
#  if ($
#}

386

387 388
########################################################################
#
389
# Set everything up
390 391
#

392 393 394
#
# setup results directory
#
395

396 397 398 399
mkdir $destdir, 0777;
unlink "$basedir/results";
symlink "results-$date", "results";

400 401 402 403 404 405 406
open F, ">$destdir/argv" or die;
print F "$ARGV\n";
close F;

open LOG, ">$destdir/log" or die;
autoflush LOG, 1;

407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
print LOG "EXPECT RESULTS IN \"$destdir\"\n";

#
# Fork a child to do the real work.
# The parent will monitor the log file and echo the results to stdout.
# And pass the TERM and INT signals to the child.
#

if ((my $pid = fork()) != 0) {

  my $TERM;
  $TERM = sub {
    my ($sig) = @_;
    $SIG{$sig} = $TERM;
    kill $sig, $pid;
  };
  $SIG{TERM} = $TERM;
  $SIG{INT} = $TERM;

  open LOG2, "$destdir/log";

  my $res = 0;
  for (;;) {
    my $data;
    $res = sysread LOG2, $data, 1024;
    last if (!defined $res && $! != EINTR); # Error
    print $data;
    if ($res == 0) {
      my $p = waitpid $pid, WNOHANG;
      last if $p > 0;
      sleep 1;
    }
  }

  unless (defined $res) {
    my $str = "read: $!\n";
    print $str;
    print LOG $str;
    exit 1;
  }

  exit 0;

} elsif (not defined $pid) {
  die "couldn't fork child\n";
452 453
}

454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
#
# disassociate stufff
#

open STDIN, "/dev/null";
setsid();
delete $ENV{DISPLAY};

#
# setup standard output streams
#

open STDOUT, ">&LOG";
open STDERR, ">&LOG";

autoflush STDOUT, 1;
autoflush STDERR, 1;

#
# setup signal handlers
#

476 477 478 479
my $quit = 0;

sub TERM {
  my ($sig) = @_;
480
  print "TERMINATING\n";
481 482 483 484 485 486 487 488 489
  $quit = 1;
  $SIG{TERM} = sub {
    $SIG{$sig} = \&TERM;
  };
  kill TERM => -$$;
}
$SIG{TERM} = \&TERM;
$SIG{INT} = \&TERM;

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
########################################################################
#
# Begin
#

sub start_exp ($);    # parms: experiment name
                      # starts an experent, returns nothing
sub wait_exp ();      # parms: none
                      # waits for an expernet to end, returns nothing
sub get_exps ($@);    # parms: available nodes, size list
                      # returns list of experments, see below
sub get_sizelist ($); # parms: maxim size
                      # returns list of sizes less than max
sub extract_exps (@); # parms: size list
                      # extracts nodes from %explist_bysize and returns them

my @results;
my %pids;

my $avail_in_parallel = $in_parallel ? $soft_limit : 0;

#
# fill the initial list of experments to run in parallel and in series
#
514 515 516

foreach (@exps) {
  my $s = $exps{$_}{numnodes};
517
  if ($s <= $avail_in_parallel) {
518 519 520 521 522 523
    push @{$exps_inparallel_bysize[$s]}, $_;
    $num_exps_inparallel++;
  } else {
    push @exps_inseries, $_;
  }
}
524
for (my $i = 0; $i <= $avail_in_parallel; $i++) {
525 526 527
  $exps_inparallel_bysize[$i] = [] unless defined $exps_inparallel_bysize[$i];
}

528 529 530 531 532 533 534 535 536 537 538 539
#
# run as many experiments in parallel as possible
#

while (%pids || $num_exps_inparallel > 0) {
  last if $quit;
  my ($size, @set) = get_exps($avail_in_parallel, 
			      get_sizelist($avail_in_parallel));
  last if (!%pids && $size == 0); # unable to run any more experments
                                  # in parallel so give up
  foreach (extract_exps(@set)) {
    start_exp($_);
540
  }
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
  wait_exp();
}

#
# remove any experiments that were unable to be run in parallel
#

foreach (@exps_inparallel_bysize) {
  foreach my $exp (@$_) {
    push @exps_inseries, $exp;
  }
}

#
# run the rest in series, unless over the hard limit
#

foreach my $exp (@exps_inseries) {
  last if $quit;
  if ($exps{$exp}{numnodes} > $hard_limit) {
    print "SKIPPING $exp since it uses more nodes than are available\n";
    next;
  }
  next if $exps{$exp}{numnodes} > $hard_limit;
  start_exp($exp);
  wait_exp();
}


#
# Wait for any remaing experments to end, which may happen if $quit.
#

while (%pids) {
  wait_exp();
}

#
# Start an experment, keeping $avail_in_parallel in sync
#

sub start_exp ($) {
  my ($exp) = @_;
  print "STARTING TEST EXP $exp\n";
  my $pid = test_experiment %{$exps{$exp}};
  $pids{$pid} = $exp;
  $avail_in_parallel -= $exps{$exp}{numnodes};
}

#
# Wait for an experient to end, keeping $avail_in_parallel in sync. If
# for some reason an experient couldn't be swapped out than adjust the soft and
# hard limits accordingly.
#
sub wait_exp () {
596 597 598 599 600
  my $pid = wait();
  if ($pid >= 0) {
    my $exp = $pids{$pid};
    delete $pids{$pid};
    my $exit = $? >> 8;
601
    &print_results_summary($exp, $exit);
602
    push @results, [$exp, $exit];
603 604 605 606 607 608 609 610
    my $F = new IO::File ">$exps{$exp}{resultsdir}/exit";
    print $F "$exit\n";
    print $F exit_str($exit), "\n";
    print $F &results_summary($exp, $exit), "\n";
    close $F;
    unless (($exit & STATUS_MASK) == STATUS_SWAPPEDIN) {
      $avail_in_parallel += $exps{$exp}{numnodes};
    } else {
611 612 613 614 615 616 617 618 619 620 621 622
      # the experient failed to swap out
      if ($halt_failed_swapouts) {
	print "  will not start any new experiments\n";
	$quit = 1;
      } else {
	# since the nodes are still in use substract that number from
	# the soft and hard limits
	$soft_limit -= $exps{$exp}{numnodes}   unless $soft_limit == LARGE_NUM;
	$hard_limit -= $exps{$exp}{numnodes}   unless $hard_limit == LARGE_NUM;
	print "  only $hard_limit nodes now available for use\n"
	    unless $hard_limit == LARGE_NUM;
      }
623 624
    }
    print "FINISHED TEST EXP $exp\n";
625 626 627 628 629 630 631 632 633 634 635 636
  }
}

#
# get_exps: get a list of experiments (actually sizes) to run
# such that the total number of nodes used is less than $avail.
# the second paramater is a sorted list of experment sizes with
# the smallest size first
#
sub get_exps($@) {
  my ($avail,@exps_s) = @_;
  return (0) unless @exps_s;
637 638 639
  while ($exps_s[-1] > $avail) {
    pop @exps_s;
  }
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
  if ($exps_s[-1] == $avail) {
    return ($avail, $exps_s[-1]);
  } else {
    # every element of @exps_s < $avail
    my $best_size = 0;
    my @best_set  = ();
    while (@exps_s) {
      my $s = pop @exps_s;
      my ($size, @set) = get_exps($avail - $s, @exps_s);
      $size += $s;
      push @set, $s;
      return ($size, @set) if $size == $avail;
      ($best_size = $size, @best_set = @set) if $size > $best_size;
    }
    return ($best_size, @best_set);
  }
}

sub get_sizelist ($) {
  my ($max) = @_;
  my @sizes;
  for (my $i = 1; $i <= $max; $i++) {
    for (my $j = 0; $j < @{$exps_inparallel_bysize[$i]}; $j++) {
      push @sizes, $i;
    }
  }
  return @sizes;
}

sub extract_exps (@) {
  my @e;
  foreach (@_) {
    push @e, (shift @{$exps_inparallel_bysize[$_]});
    $num_exps_inparallel--;
  }
  return @e;
}

########################################################################
#
680
# Finish
681 682
#

683
print "SUMMARY: \n";
684

685
sub print_results_summary($$) {
686
  my ($exp, $res) = @_;
687
  print "  $exp ", results_summary($exp, $res), "\n";
688 689 690
}

foreach (@results) {
691
  &print_results_summary(@$_);
692 693
}

694 695 696 697 698 699 700 701 702 703 704 705
sub failed_but_ignored($) {
  my ($exp) = @_;
  open FAILED, "$exps{$exp}{resultsdir}/failed-but-ignored";
  my $res;
  while (<FAILED>) {
    chop;
    $res .= "$_ ";
  }
  chop $res;
  return $res;
}

706 707 708 709 710 711 712 713 714 715 716 717
sub failed_tests($) {
  my ($exp) = @_;
  open FAILED, "$exps{$exp}{resultsdir}/failed-tests";
  my $res;
  while (<FAILED>) {
    chop;
    $res .= "$_ ";
  }
  chop $res;
  return $res;
}

718 719 720 721
sub results_summary($$) {
  my ($exp, $res) = @_;

  return "passed"
722
    if $res == (ERR_NONE | STATUS_NONE);
723
  return "passed but is still swapped in"
724
    if $res == (ERR_NONE | STATUS_SWAPPEDIN);
725
  return "passed but still exists" 
726
    if $res == (ERR_NONE | STATUS_EXISTS);
727
  return "passed but requires cleanup"
728 729 730 731 732 733 734 735 736 737 738
    if $res == (ERR_NONE | STATUS_CLEANUP);

  return "passed with expected failures: ".failed_but_ignored($exp)
    if $res == (ERR_EXPECTED | STATUS_NONE);
  return "passed with expected failures but is still swapped in: ".failed_but_ignored($exp)
    if $res == (ERR_EXPECTED | STATUS_SWAPPEDIN);
  return "passed with expected failures but still exists: ".failed_but_ignored($exp)
    if $res == (ERR_EXPECTED | STATUS_EXISTS);
  return "passed with expected failures but requires cleanup: ".failed_but_ignored($exp)
    if $res == (ERR_EXPECTED | STATUS_CLEANUP);

739 740 741 742 743 744 745 746
  return "had failed tests: ".failed_tests($exp)
    if $res == (ERR_FAILED | STATUS_NONE);
  return "is still swapped in and had failed tests: ".failed_tests($exp)
    if $res == (ERR_FAILED | STATUS_SWAPPEDIN);
  return "still exists had failed tests: ".failed_tests($exp)
    if $res == (ERR_FAILED | STATUS_EXISTS);
  return "requires cleanup and had failed tests: ".failed_tests($exp)
    if $res == (ERR_FAILED | STATUS_CLEANUP);
747

748
  return "had one or more fatal errors"
749
    if $res == (ERR_FATAL | STATUS_NONE);
750
  return "had one or more fatal errors and is still swapped in"
751
    if $res == (ERR_FATAL | STATUS_SWAPPEDIN);
752
  return "had one or more fatal errors and still exists"
753
    if $res == (ERR_FATAL | STATUS_EXISTS);
754
  return "had one or more fatal errors and requires cleanup"
755 756
    if $res == (ERR_FATAL | STATUS_CLEANUP);

757
  return "was interrupted"
758
    if $res == (ERR_INT | STATUS_NONE);
759
  return "was interrupted and is still swapped in"
760
    if $res == (ERR_INT | STATUS_SWAPPEDIN);
761
  return "was interrupted and still exists"
762
    if $res == (ERR_INT | STATUS_EXISTS);
763
  return "was interrupted and requires cleanup"
764
    if $res == (ERR_INT | STATUS_CLEANUP);
765 766 767 768 769 770

  return "exited with unknown code: $res";
}

print "RESULTS IN \"$destdir\".\n";

771