def test_ping_app_servers(self): '''Ping app servers''' assert_true(network_lib.ping(self._app1)) assert_true(network_lib.ping(self._app2)) assert_true(network_lib.ping(self._app3)) assert_true(network_lib.ping(self._app4)) assert_true(network_lib.ping(self._app5))
def test_disable_5_internal_links_cut(self): '''Cut router 0 eth1 and eth2 + 5 internal links, access S1''' self._disable_interface(instance0, 'eth1') self._disable_interface(instance0, 'eth2') self._disable_interface(instance1, 'eth3') self._disable_interface(instance2, 'eth3') self._disable_interface(instance3, 'eth3') self._disable_interface(instance4, 'eth3') self._disable_interface(instance5, 'eth3') time.sleep(4 * helloint) assert_false(network_lib.ping(self._app1)) self._enable_interface(instance0, 'eth1') self._enable_interface(instance0, 'eth2') self._enable_interface(instance1, 'eth3') self._enable_interface(instance2, 'eth3') self._enable_interface(instance3, 'eth3') self._enable_interface(instance4, 'eth3') self._enable_interface(instance5, 'eth3') time.sleep(2 * helloint) self._basic_connectivity_tests()
def _bootstrap(self, cli_port, pass_rtable=False): '''Initialize a sphene instance for tests.''' auth_key_file = os.path.join(base_dir(), 'auth_key') if pass_rtable: rtable_file = os.path.join(base_dir(), 'rtable_%d' % self._topo_id) else: rtable_file = os.path.join(base_dir(), 'rtable_empty') inst = spheneinstance.SpheneInstance(self._topo_id, cli_port, auth_key_file, rtable_file=rtable_file, binary=BINARY) inst.start() print 'bootstrapping complete.' # Wait for interface to come up. time.sleep(1) for i in range(5): if network_lib.ping(self._rtr_eth0): return inst # Failed to bootstrap. raise Exception('timeout waiting for router to come up')
def test_ping_router3_interfaces(self): '''Ping router 3 interfaces''' assert_true(network_lib.ping(self._rtr3_eth0)) assert_true(network_lib.ping(self._rtr3_eth1)) assert_true(network_lib.ping(self._rtr3_eth2))
def _ping_router_interfaces(self, router): assert_true(network_lib.ping(router.eth0)) assert_true(network_lib.ping(router.eth1)) assert_true(network_lib.ping(router.eth2)) assert_true(network_lib.ping(router.eth3))