tests: support setting random seed
[vpp.git] / test / sanity_run_vpp.py
index 527b618..2ee7d31 100644 (file)
@@ -1,18 +1,24 @@
 #!/usr/bin/env python
 
 from __future__ import print_function
-from framework import VppTestCase
-from hook import VppDiedError
+from multiprocessing import Pipe
 from sys import exit
+import os
+from framework import VppDiedError, VppTestCase, KeepAliveReporter
 
 
 class SanityTestCase(VppTestCase):
-    """ Dummy test case used to check if VPP is able to start """
+    """ Sanity test case - verify whether VPP is able to start """
     pass
 
+
 if __name__ == '__main__':
+    os.environ["RND_SEED"] = "1"
     rc = 0
     tc = SanityTestCase
+    x, y = Pipe()
+    reporter = KeepAliveReporter()
+    reporter.pipe = y
     try:
         tc.setUpClass()
     except VppDiedError:
@@ -22,5 +28,12 @@ if __name__ == '__main__':
             tc.tearDownClass()
         except:
             pass
+    x.close()
+    y.close()
+
+    if rc == 0:
+        print('Sanity test case passed\n')
+    else:
+        print('Sanity test case failed\n')
 
     exit(rc)