Wait for pl_netflow to show up before starting.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Jan 2009 19:57:47 +0000 (19:57 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Jan 2009 19:57:47 +0000 (19:57 +0000)
qaapi/qa/tests/node/pf2test.pl
qaapi/qa/tests/node/support/vsys_conctest.c

index d1c95bf..ceb81b5 100755 (executable)
@@ -8,6 +8,14 @@ print "Preparing...";
 
 system("cp /var/log/messages /tmp/pf2_test");
 
+
+# Wait for pl_netflow to come up
+
+$timeout=600;
+
+until ((-f "/var/run/vservers/pl_netflow" && -d "/home/pl_netflow") || ($timeout==0)) {sleep (15);print "Waiting for pl_netflow to show up...\n";$timeout-=15;}
+
+if ($timeout>0) {
 # ping magic IP address
 print "Sending out packet...\n";
 system("su -c \"ping -I eth0 -c 1 10.0.0.8\" $netflow_slice -"); 
@@ -32,6 +40,10 @@ if ($success) {
 else {
         print "[FAILED]";
 }
+}
+else {
+    die("[FAILED] Timed out.. pl_netflow didn't come up for 10 minutes...\n");
+}
 
 
 close PIP;
index 8a40f21..587d531 100644 (file)
@@ -129,6 +129,7 @@ int main(int argc,char *argv[])
 
     if (nlines<5) {
            printf("Test returned different results - run again to verify\n");
+        printf("%s\n",buf);
            exit(-1);
     }