Whamcloud - gitweb
LU-10973 lnet: LUTF UDSP test suite and routing test suite
[fs/lustre-release.git] / lustre / tests / lutf / python / tests / suite_udsp / test_udsp_basic_01.py
1 """
2 @PRIMARY: N/A
3 @PRIMARY_DESC: Check that udsp rule table is empty on a newly configured lnet
4 @SECONDARY: N/A
5 @DESIGN: N/A
6 @TESTCASE:
7 - check that udsp rule table is empty on a newly configured lnet
8 """
9
10 import os
11 import yaml
12 import lnetconfig
13 from lutf import agents, me
14 from lutf_basetest import *
15 from lnet import TheLNet
16 from lutf_exception import LUTFError
17 from lnet_helpers import LNetHelpers
18 from lutf_cmd import lutf_exec_local_cmd
19 from utility_paths import LNETCTL
20
21 def check_udsp_empty():
22         rc = lutf_exec_local_cmd(LNETCTL + " udsp show")
23         if 'idx' in rc[0].decode('utf-8'):
24                 return False
25         else:
26                 return True
27
28 def run():
29         la = agents.keys()
30         if len(la) < 1:
31                 return lutfrc(LUTF_TEST_SKIP, "No agents to run test")
32         try:
33                 t = LNetHelpers(target=la[0])
34                 t.configure_lnet()
35                 if not t.check_udsp_present():
36                         return lutfrc(LUTF_TEST_SKIP, "UDSP feature is missing")
37                 rc = check_udsp_empty();
38                 if not rc:
39                         return lutfrc(LUTF_TEST_FAIL)
40                 return lutfrc(LUTF_TEST_PASS)
41         except Exception as e:
42                 t.uninit()
43                 raise e
44
45