From 865f9c29ab44e7e719494db23cefd69dd77b59d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 5 Jan 2010 08:08:48 +0000 Subject: [PATCH] - check zombies - drain delay (improved test robustness) - improved self-diagnostics --- org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl b/org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl index afcc4aa..d0a0089 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-purge.pl @@ -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 = ; @@ -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; -- 1.8.2.3