MCPcopy Create free account
hub / github.com/NetSys/bess / generate_test_method

Function generate_test_method

bessctl/test_samples.py:82–103  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

80
81
82def generate_test_method(path):
83 def template(self):
84 try:
85 run_cmd('%s run file %s' % (bessctl, path))
86 except CommandError:
87 # bessd may have crashed. Relaunch for next tests.
88 run_cmd('%s daemon start' % bessctl)
89 raise
90
91 # 0.5 seconds should be enough to detect packet leaks in the datapath.
92 time.sleep(0.5)
93
94 # Check if bessd crushed.
95 try:
96 run_cmd('%s show version' % bessctl)
97 run_cmd('%s daemon reset' % bessctl)
98 except CommandError:
99 # bessd may have crashed. Relaunch for next tests.
100 run_cmd('%s daemon start' % bessctl)
101 raise
102
103 return template
104
105
106for root, _, file_names in os.walk(sample_dir):

Callers 1

test_samples.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected