def tearDown(self): try_safe_exits(self.processes) for process in self.processes: process.wait() call(list_extend(SIM_ARGS, ['stop']), stdout=DEV_NULL, stderr=DEV_NULL, env=self.env)
def _runArgsTest(self, args): try: check_output(list_extend([SERVER_APP], args)) self.fail() except CalledProcessError as e: self.assertTrue('returned non-zero exit status' in str(e)) self.assertTrue('Usage: ' in e.stderr)
def tearDown(self): try_safe_exits(self.processes) for process in self.processes: process.wait() call(list_extend(SIM_ARGS, ['stop']), env=self.env, stdout=DEV_NULL, stderr=DEV_NULL)
def setUp(self): os.remove(CAPTURE_FILE) self.processes = [] self.env = make_sim_env(SIM_NAME) check_call(list_extend(SIM_ARGS, ['restart']), stdout=DEV_NULL, stderr=DEV_NULL, env=self.env) # give some time for setup time.sleep(1) self.iface = interface_from_addr(DFE_CAPTURE_PORT_IP)
def setUp(self): self.processes = [] # setup env self.env = make_sim_env(SIM_NAME) check_call(list_extend(SIM_ARGS, ['restart']), env=self.env, stdout=DEV_NULL, stderr=DEV_NULL) # give some time for setup time.sleep(1) # add server ips to sim tap self.server_iface = interface_from_addr(DFE_SERVER_PORT_IP) for group in SERVER_IPS.keys(): for i in range(len(SERVER_IPS[group])): ip = SERVER_IPS[group][i] check_call(['ip', 'addr', 'add', ip, 'broadcast', SERVER_NETMASK, 'dev', self.server_iface]) self.capture_iface = interface_from_addr(DFE_CAPTURE_PORT_IP)
def setUp(self): self.processes = [] # setup env self.env = make_sim_env(SIM_NAME) check_call(list_extend(SIM_ARGS, ['restart']), env=self.env, stdout=DEV_NULL, stderr=DEV_NULL) # give some time for setup time.sleep(1) # add server ips to sim tap self.server_iface = interface_from_addr(DFE_SERVER_PORT_IP) for group in SERVER_IPS.keys(): for i in range(len(SERVER_IPS[group])): ip = SERVER_IPS[group][i] check_call([ 'ip', 'addr', 'add', ip, 'broadcast', SERVER_NETMASK, 'dev', self.server_iface ]) self.capture_iface = interface_from_addr(DFE_CAPTURE_PORT_IP)
def _run(self, args=None): if args is None: args = [] return check_output(list_extend([CLIENT_APP], args), env=self.env)