blob: b923c791b612fd94472061d0637b2f9adeebb744 [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 Sekerab23ffd72021-05-31 16:08:53 +020027def main():
Klement Sekera3747c752017-04-10 06:30:17 +020028 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.')
Klement Sekerab23ffd72021-05-31 16:08:53 +020049 return rc
juraj.linkesabec0122018-11-16 17:28:56 +010050
Klement Sekerab23ffd72021-05-31 16:08:53 +020051
52if __name__ == '__main__':
53 sys.exit(main())