Beispiel #1
0
  def test_disable_rtr1_eth1(self):
    '''Disable router 1 eth1'''
    self._disable_interface(instance1, 'eth1')
    time.sleep(6 * helloint)
    self._basic_connectivity_tests()
    assert_equal(
        network_lib.traceroute(self._app1)[-4:],
        [self._rtr1_eth0, self._rtr3_eth0, self._rtr2_eth2, self._app1])

    self._enable_interface(instance1, 'eth1')
    time.sleep(6 * helloint)
    self._basic_connectivity_tests()
    assert_equal(
        network_lib.traceroute(self._app1)[-3:],
        [self._rtr1_eth0, self._rtr2_eth0, self._app1])
Beispiel #2
0
    def test_disable_rtr1_eth1(self):
        '''Disable router 1 eth1'''
        self._disable_interface(instance1, 'eth1')
        time.sleep(6 * helloint)
        self._basic_connectivity_tests()
        assert_equal(
            network_lib.traceroute(self._app1)[-4:],
            [self._rtr1_eth0, self._rtr3_eth0, self._rtr2_eth2, self._app1])

        self._enable_interface(instance1, 'eth1')
        time.sleep(6 * helloint)
        self._basic_connectivity_tests()
        assert_equal(
            network_lib.traceroute(self._app1)[-3:],
            [self._rtr1_eth0, self._rtr2_eth0, self._app1])
Beispiel #3
0
    def test_disable_4_internal_links_cut(self):
        '''Cut router 0 eth1 and eth2 + 4 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')
        conv_time = (3 * (4 + 1) + 1) * helloint
        time.sleep(conv_time)
        self.test_ping_app_servers()
        assert_equal(
            network_lib.traceroute(self._app1)[-7:], [
                self._rtr0.eth0, self._rtr5.eth3, self._rtr4.eth2,
                self._rtr3.eth2, self._rtr2.eth2, self._rtr1.eth2, 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')
        time.sleep(2 * helloint)
        self._basic_connectivity_tests()
Beispiel #4
0
    def test_traceroute_to_app_server1(self):
        '''Traceroute to app server 1'''
        trace = network_lib.traceroute(self._app1)

        # Last two hops should be the router and the app server itself.
        assert_true(len(trace) > 2)
        assert_equal(trace[-2], self._rtr_eth0)
        assert_equal(trace[-1], self._app1)
Beispiel #5
0
    def test_disable_0_internal_links_cut(self):
        '''Cut router 0 eth1 and eth2, access S1'''
        self._disable_interface(instance0, 'eth1')
        self._disable_interface(instance0, 'eth2')
        conv_time = (3 * (0 + 1) + 1) * helloint
        time.sleep(conv_time)
        self._basic_connectivity_tests()
        assert_equal(
            network_lib.traceroute(self._app1)[-3:],
            [self._rtr0.eth0, self._rtr1.eth3, self._app1])

        self._enable_interface(instance0, 'eth1')
        self._enable_interface(instance0, 'eth2')
        time.sleep(2 * helloint)
        self._basic_connectivity_tests()
Beispiel #6
0
  def test_disable_0_internal_links_cut(self):
    '''Cut router 0 eth1 and eth2, access S1'''
    self._disable_interface(instance0, 'eth1')
    self._disable_interface(instance0, 'eth2')
    conv_time = (3 * (0 + 1) + 1) * helloint
    time.sleep(conv_time)
    self._basic_connectivity_tests()
    assert_equal(
        network_lib.traceroute(self._app1)[-3:],
        [self._rtr0.eth0, self._rtr1.eth3, self._app1])

    self._enable_interface(instance0, 'eth1')
    self._enable_interface(instance0, 'eth2')
    time.sleep(2 * helloint)
    self._basic_connectivity_tests()
Beispiel #7
0
  def test_disable_3_internal_links_cut(self):
    '''Cut router 0 eth1 and eth2 + 3 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')
    conv_time = (3 * (3 + 1) + 1) * helloint
    time.sleep(conv_time)
    self.test_ping_app_servers()
    assert_equal(
        network_lib.traceroute(self._app1)[-6:],
        [self._rtr0.eth0, self._rtr4.eth3, self._rtr3.eth2, self._rtr2.eth2,
         self._rtr1.eth2, 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')
    time.sleep(2 * helloint)
    self._basic_connectivity_tests()
Beispiel #8
0
 def test_traceroute_to_app_server2(self):
     '''Traceroute to app server 2'''
     trace = network_lib.traceroute(self._app2)
     assert_true(len(trace) > 2)
     assert_equal(trace[-2], self._rtr_eth0)
     assert_equal(trace[-1], self._app2)