コード例 #1
0
 def setUp(self):
     self.keepalived_mixin = vrrp_rest_driver.KeepalivedAmphoraDriverMixin()
     self.keepalived_mixin.client = mock.MagicMock()
     self.client = self.keepalived_mixin.client
     self.FAKE_CONFIG = 'FAKE CONFIG'
     self.lb_mock = mock.MagicMock()
     self.amphora_mock = mock.MagicMock()
     self.amphora_mock.status = constants.AMPHORA_ALLOCATED
     self.lb_mock.amphorae = [self.amphora_mock]
     super(TestVRRPRestDriver, self).setUp()
コード例 #2
0
    def setUp(self):
        self.keepalived_mixin = vrrp_rest_driver.KeepalivedAmphoraDriverMixin()
        self.keepalived_mixin.client = mock.MagicMock()
        self.client = self.keepalived_mixin.client
        self.FAKE_CONFIG = 'FAKE CONFIG'
        self.lb_mock = mock.MagicMock()
        self.amphora_mock = mock.MagicMock()
        self.amphora_mock.id = uuidutils.generate_uuid()
        self.amphora_mock.status = constants.AMPHORA_ALLOCATED
        self.lb_mock.amphorae = [self.amphora_mock]
        self.amphorae_network_config = {}
        vip_subnet = mock.MagicMock()
        vip_subnet.cidr = '192.0.2.0/24'
        self.amphorae_network_config[self.amphora_mock.id] = vip_subnet

        super(TestVRRPRestDriver, self).setUp()
コード例 #3
0
    def setUp(self):
        self.keepalived_mixin = vrrp_rest_driver.KeepalivedAmphoraDriverMixin()
        self.keepalived_mixin.clients = {
            'base': mock.MagicMock(),
            API_VERSION: mock.MagicMock()}
        self.keepalived_mixin._populate_amphora_api_version = mock.MagicMock()
        self.clients = self.keepalived_mixin.clients
        self.FAKE_CONFIG = 'FAKE CONFIG'
        self.lb_mock = mock.MagicMock()
        self.amphora_mock = mock.MagicMock()
        self.amphora_mock.id = uuidutils.generate_uuid()
        self.amphora_mock.status = constants.AMPHORA_ALLOCATED
        self.amphora_mock.api_version = API_VERSION
        self.lb_mock.amphorae = [self.amphora_mock]
        self.amphorae_network_config = {}
        vip_subnet = mock.MagicMock()
        vip_subnet.cidr = '192.0.2.0/24'
        self.amphorae_network_config[self.amphora_mock.id] = vip_subnet

        super().setUp()