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

Method run_for

bessctl/test_utils.py:216–237  ·  view source on GitHub ↗
(self, module, igates, duration, pkt_update_fields=[])

Source from the content-addressed store, hash-verified

214 self.bess.reset_all()
215
216 def run_for(self, module, igates, duration, pkt_update_fields=[]):
217 self.bess.pause_all()
218
219 fields = pkt_update_fields
220 if len(fields) == 0:
221 fields.append({'offset': 26, 'size': 4,
222 'min': 1, 'max': pow(2, 32) - 1})
223 fields.append({'offset': 30, 'size': 4,
224 'min': 1, 'max': pow(2, 32) - 1})
225
226 # source and associate sockets
227 for igate in igates:
228 src = self.bess.create_module('Source')
229 random = self.bess.create_module('RandomUpdate', 'RandomUpdateArg',
230 {'fields': fields})
231 self.bess.connect_modules(src.name, random.name)
232 self.bess.connect_modules(random.name, module.name, 0, igate)
233
234 # running tests
235 self.bess.resume_all()
236 time.sleep(duration)
237 self.bess.pause_all()
238
239 def run_pipeline(self, src_module, dst_module, igate, input_pkts,
240 ogates, time_out=3, proto=scapy.Ether):

Callers 15

test_run_exactmatchMethod · 0.80
test_run_drrMethod · 0.80
test_run_vlanMethod · 0.80
test_run_update_ttlMethod · 0.80
test_run_decap_0bytesMethod · 0.80
test_run_urlfilterMethod · 0.80
test_run_acl_simpleMethod · 0.80
test_run_acl_3rulesMethod · 0.80
test_run_acl_edgecaseMethod · 0.80
test_run_replicate4Method · 0.80

Calls 5

pause_allMethod · 0.80
appendMethod · 0.80
create_moduleMethod · 0.80
connect_modulesMethod · 0.80
resume_allMethod · 0.80

Tested by

no test coverage detected