Distinguish between old and new notifications for the 1st job.
authorZdeněk Šustr <sustr4@cesnet.cz>
Tue, 25 May 2010 09:36:09 +0000 (09:36 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Tue, 25 May 2010 09:36:09 +0000 (09:36 +0000)
org.glite.testsuites.ctb/LB/tests/lb-test-notif-switch.sh

index 0416f9d..e6040c7 100755 (executable)
@@ -155,6 +155,8 @@ else
 
                        sleep 10
 
+                       #$SYS_CAT $$_notifications.txt
+
                        $SYS_GREP ${jobid} $$_notifications.txt > /dev/null
 
                        if [ $? = 0 ]; then
@@ -194,8 +196,19 @@ else
 
                        kill $recpid
 
+                       #$SYS_CAT $$_notifications.txt
+
+                       #There may be old notifications still arriving for the 1st job
+                       $SYS_GREP ${jobid} $$_notifications.txt > $$_notifications_old.txt
+                       $SYS_GREP -E "Waiting|Ready|Scheduled|Running" $$_notifications_old.txt >> /dev/null
+
+                       if [ $? = 0 ]; then
+                               printf "Old notifications for the 1st job still arriving."
+                               test_running
+                       fi
+
                        #There should be no notifications for the 1st job
-                       $SYS_GREP ${jobid} $$_notifications.txt >> /dev/null 
+                       $SYS_GREP ${jobid} $$_notifications_old.txt | $SYS_GREP -w "Done">> /dev/null 
 
                        if [ $? = 0 ]; then
                                printf "Notifications for the old job were delivered"
@@ -217,6 +230,7 @@ else
                        fi
 
                        $SYS_RM $$_notifications.txt
+                       $SYS_RM $$_notifications_old.txt
 
                        #Drop notification
                        printf "Dropping the test notification (${notifid})"