2019-10-31 13:31:07 -05:00
|
|
|
#!/usr/bin/env python3
|
2017-04-10 06:30:17 +02:00
|
|
|
|
|
|
|
from __future__ import print_function
|
2017-08-08 04:33:53 +02:00
|
|
|
from multiprocessing import Pipe
|
2019-12-19 16:09:43 -05:00
|
|
|
import sys
|
2023-08-31 00:47:44 -04:00
|
|
|
from asfframework import VppDiedError, VppAsfTestCase, KeepAliveReporter
|
2017-04-10 06:30:17 +02:00
|
|
|
|
|
|
|
|
2023-08-31 00:47:44 -04:00
|
|
|
class SanityTestCase(VppAsfTestCase):
|
2022-04-26 19:02:15 +02:00
|
|
|
"""Sanity test case - verify whether VPP is able to start"""
|
|
|
|
|
2021-04-08 19:37:41 +02:00
|
|
|
cpus = [0]
|
2017-04-10 06:30:17 +02:00
|
|
|
|
2019-12-19 16:09:43 -05:00
|
|
|
# don't ask to debug SanityTestCase
|
|
|
|
@classmethod
|
|
|
|
def wait_for_enter(cls, pid=0):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def _debug_quit(cls):
|
|
|
|
try:
|
|
|
|
cls.vpp.poll()
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
|
|
|
|
2019-11-05 11:18:25 +00:00
|
|
|
|
2021-05-31 16:08:53 +02:00
|
|
|
def main():
|
2017-04-10 06:30:17 +02:00
|
|
|
rc = 0
|
|
|
|
tc = SanityTestCase
|
2017-08-08 04:33:53 +02:00
|
|
|
x, y = Pipe()
|
|
|
|
reporter = KeepAliveReporter()
|
|
|
|
reporter.pipe = y
|
2017-04-10 06:30:17 +02:00
|
|
|
try:
|
|
|
|
tc.setUpClass()
|
|
|
|
except VppDiedError:
|
|
|
|
rc = -1
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
tc.tearDownClass()
|
2019-12-19 16:09:43 -05:00
|
|
|
except Exception:
|
|
|
|
rc = -1
|
2017-08-08 04:33:53 +02:00
|
|
|
x.close()
|
|
|
|
y.close()
|
2017-04-10 06:30:17 +02:00
|
|
|
|
2018-11-16 17:28:56 +01:00
|
|
|
if rc == 0:
|
2022-04-26 19:02:15 +02:00
|
|
|
print("Sanity test case passed.")
|
2018-11-16 17:28:56 +01:00
|
|
|
else:
|
2022-04-26 19:02:15 +02:00
|
|
|
print("Sanity test case failed.")
|
2021-05-31 16:08:53 +02:00
|
|
|
return rc
|
|
|
|
|
2018-11-16 17:28:56 +01:00
|
|
|
|
2022-04-26 19:02:15 +02:00
|
|
|
if __name__ == "__main__":
|
2021-05-31 16:08:53 +02:00
|
|
|
sys.exit(main())
|