496b0dee7f
- Move Exception into same module as TestCase. - Move the error reporting logic inside the error. - Allows testing of the returncode and signal_name for tests to consume. - Fix the signal reporting code: VppDiedError: VPP subprocess died unexpectedly with returncode -6 [unknown]. displays as: VppDiedError: VPP subprocess died unexpectedly with return code: -6 [SIGABRT]. Type: test Change-Id: I8488ab318a596c9b737308829cedfb7e96e57302 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
37 lines
749 B
Python
37 lines
749 B
Python
#!/usr/bin/env python
|
|
|
|
from __future__ import print_function
|
|
from multiprocessing import Pipe
|
|
from sys import exit
|
|
from framework import VppDiedError, VppTestCase, KeepAliveReporter
|
|
|
|
|
|
class SanityTestCase(VppTestCase):
|
|
""" Sanity test case - verify whether VPP is able to start """
|
|
pass
|
|
|
|
if __name__ == '__main__':
|
|
rc = 0
|
|
tc = SanityTestCase
|
|
x, y = Pipe()
|
|
reporter = KeepAliveReporter()
|
|
reporter.pipe = y
|
|
try:
|
|
tc.setUpClass()
|
|
except VppDiedError:
|
|
rc = -1
|
|
else:
|
|
try:
|
|
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)
|