-
Notifications
You must be signed in to change notification settings - Fork 304
/
cart_ctl_one_node.py
executable file
·68 lines (51 loc) · 1.81 KB
/
cart_ctl_one_node.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/python
'''
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from __future__ import print_function
import sys
from apricot import TestWithoutServers
sys.path.append('./util')
# Can't all this import before setting sys.path
# pylint: disable=wrong-import-position
from cart_utils import CartUtils
class CartCtlOneNodeTest(TestWithoutServers):
"""
Runs basic CaRT ctl tests
:avocado: recursive
"""
def setUp(self):
""" Test setup """
print("Running setup\n")
super(CartCtlOneNodeTest, self).setUp()
self.utils = CartUtils()
self.env = self.utils.get_env(self)
def tearDown(self):
""" Tear down """
self.report_timeout()
self._teardown_errors.extend(self.utils.cleanup_processes())
super(CartCtlOneNodeTest, self).tearDown()
def test_cart_ctl(self):
"""
Test CaRT ctl
:avocado: tags=all,cart,pr,daily_regression,ctl,one_node
"""
srvcmd = self.utils.build_cmd(self, self.env, "test_servers")
try:
srv_rtn = self.utils.launch_cmd_bg(self, srvcmd)
# pylint: disable=broad-except
except Exception as e:
self.utils.print("Exception in launching server : {}".format(e))
self.fail("Test failed.\n")
# Verify the server is still running.
if not self.utils.check_process(srv_rtn):
procrtn = self.utils.stop_process(srv_rtn)
self.fail("Server did not launch, return code %s" \
% procrtn)
for index in range(6):
clicmd = self.utils.build_cmd(
self, self.env, "test_clients", index=index)
self.utils.launch_test(self, clicmd, srv_rtn)
if __name__ == "__main__":
main()