Ejemplo n.º 1
0
 def test_bonding_disable(self):
     try:
         net_utils.bond().is_enabled()
     except error.TestError:
         pass
     else:
         self.assertEquals(1, 0)
Ejemplo n.º 2
0
    def test_bonding_wait_for_state_change(self):
        self.god.stub_function(utils, "ping_default_gateway")

        time.sleep.expect_call(10)
        utils.ping_default_gateway.expect_call().and_return(False)
        self.assertEquals(net_utils.bond().wait_for_state_change(), True)

        for x in xrange(9):
            time.sleep.expect_call(10)
            utils.ping_default_gateway.expect_call().and_return(True)

        time.sleep.expect_call(10)
        utils.ping_default_gateway.expect_call().and_return(False)
        self.assertEquals(net_utils.bond().wait_for_state_change(), True)

        for x in xrange(10):
            time.sleep.expect_call(10)
            utils.ping_default_gateway.expect_call().and_return(True)

        self.assertEquals(net_utils.bond().wait_for_state_change(), False)

        self.god.check_playback()
Ejemplo n.º 3
0
 def test_bonding_get_slave_interfaces(self):
     self.assertEquals(net_utils.bond().get_slave_interfaces(), [])
     self.god.check_playback()
Ejemplo n.º 4
0
 def test_get_mode_bonding(self):
     self.assertEquals(net_utils.bond().get_mode(), net_utils.bonding.NO_MODE)
Ejemplo n.º 5
0
 def test_bonding_get_mii_status(self):
     self.assertEquals(net_utils.bond().get_mii_status(), {})