- check zombies
authorAleš Křenek <ljocha@ics.muni.cz>
Tue, 5 Jan 2010 08:08:48 +0000 (08:08 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Tue, 5 Jan 2010 08:08:48 +0000 (08:08 +0000)
- drain delay (improved test robustness)
- improved self-diagnostics

org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl

index afcc4aa..d0a0089 100755 (executable)
@@ -112,6 +112,16 @@ if (!logit \%new,"${prefix}_new") {
 
 test_done();
 
+$drain = $delay/10;
+print "** draining other $drain seconds ...\n";
+sleep $drain;
+
+print "** test jobs:\n";
+
+for (qw/aborted cleared cancelled other/) {
+       print "$_:\n\t$old{$_}\n\t$new{$_}\n";
+} 
+
 print "** Dry run\n";
 $failed = 0;
 
@@ -126,7 +136,7 @@ for (qw/aborted cleared cancelled other/) {
                test_failed();
        }
        else {
-               print "$_ $id ";
+               print "${half}s $_ $id ";
                test_done();
        }
        $id = <LIST>;
@@ -150,7 +160,7 @@ for (qw/aborted cleared cancelled other/) {
                        test_failed();
                }
                else {
-                       print "$_ $id ";
+                       print "0s $_ $id ";
                        test_done();
                }
                $cnt++;
@@ -240,6 +250,22 @@ die "!! Yes, but should not\n" if $id;
 print "No, OK ";
 test_done();
 
+print "** Check zombies\n";
+$failed = 0;
+
+for (values(%old),values(%new)) {
+               $stat = 'nic moc';
+               $stat = `$status $_ | head -2 | tail -1`;
+               chomp $stat;
+               $stat =~ s/state :\s*//;
+
+               print "$_ $stat ";
+               if ($stat ne 'Purged') { $failed = 1; test_failed(); }
+               else { test_done(); }
+}
+
+die "Jobs should be known and purged\n" if $failed;
+
 print "\n** All tests passed **";
 test_done();
 exit 0;