tests: make tests less make dependent
[vpp.git] / test / sanity_run_vpp.py
index 5eb6885..b923c79 100644 (file)
@@ -9,7 +9,7 @@ from framework import VppDiedError, VppTestCase, KeepAliveReporter
 
 class SanityTestCase(VppTestCase):
     """ Sanity test case - verify whether VPP is able to start """
-    pass
+    cpus = [0]
 
     # don't ask to debug SanityTestCase
     @classmethod
@@ -24,7 +24,7 @@ class SanityTestCase(VppTestCase):
             pass
 
 
-if __name__ == '__main__':
+def main():
     rc = 0
     tc = SanityTestCase
     x, y = Pipe()
@@ -43,8 +43,11 @@ if __name__ == '__main__':
     y.close()
 
     if rc == 0:
-        print('Sanity test case passed.\n')
+        print('Sanity test case passed.')
     else:
-        print('Sanity test case failed.\n')
+        print('Sanity test case failed.')
+    return rc
+
 
-    sys.exit(rc)
+if __name__ == '__main__':
+    sys.exit(main())