blob: 4b21de12dfed2419bb7053b704462b4fad5a942b [file] [log] [blame]
Renato Botelho do Coutoead1e532019-10-31 13:31:07 -05001#!/usr/bin/env python3
Klement Sekera3747c752017-04-10 06:30:17 +02002
3from __future__ import print_function
Klement Sekera909a6a12017-08-08 04:33:53 +02004from multiprocessing import Pipe
Paul Vinciguerrac701e572019-12-19 16:09:43 -05005import sys
Klement Sekera45a95dd2019-11-05 11:18:25 +00006import os
Paul Vinciguerra496b0de2019-06-20 12:24:12 -04007from framework import VppDiedError, VppTestCase, KeepAliveReporter
Klement Sekera3747c752017-04-10 06:30:17 +02008
9
10class SanityTestCase(VppTestCase):
juraj.linkes185e6492018-11-28 14:30:34 +010011 """ Sanity test case - verify whether VPP is able to start """
Klement Sekera558ceab2021-04-08 19:37:41 +020012 cpus = [0]
Klement Sekera3747c752017-04-10 06:30:17 +020013
Paul Vinciguerrac701e572019-12-19 16:09:43 -050014 # don't ask to debug SanityTestCase
15 @classmethod
16 def wait_for_enter(cls, pid=0):
17 pass
18
19 @classmethod
20 def _debug_quit(cls):
21 try:
22 cls.vpp.poll()
23 except AttributeError:
24 pass
25
Klement Sekera45a95dd2019-11-05 11:18:25 +000026
Klement Sekera3747c752017-04-10 06:30:17 +020027if __name__ == '__main__':
28 rc = 0
29 tc = SanityTestCase
Klement Sekera909a6a12017-08-08 04:33:53 +020030 x, y = Pipe()
31 reporter = KeepAliveReporter()
32 reporter.pipe = y
Klement Sekera3747c752017-04-10 06:30:17 +020033 try:
34 tc.setUpClass()
35 except VppDiedError:
36 rc = -1
37 else:
38 try:
39 tc.tearDownClass()
Paul Vinciguerrac701e572019-12-19 16:09:43 -050040 except Exception:
41 rc = -1
Klement Sekera909a6a12017-08-08 04:33:53 +020042 x.close()
43 y.close()
Klement Sekera3747c752017-04-10 06:30:17 +020044
juraj.linkesabec0122018-11-16 17:28:56 +010045 if rc == 0:
Klement Sekerae2636852021-03-16 12:52:12 +010046 print('Sanity test case passed.')
juraj.linkesabec0122018-11-16 17:28:56 +010047 else:
Klement Sekerae2636852021-03-16 12:52:12 +010048 print('Sanity test case failed.')
juraj.linkesabec0122018-11-16 17:28:56 +010049
Paul Vinciguerrac701e572019-12-19 16:09:43 -050050 sys.exit(rc)