예제 #1
0
 def setUp(self):
     super(TestEtcdWatcher, self).setUp()
     self.m_config = Mock()
     self.m_config.HOSTNAME = "hostname"
     self.m_config.IFACE_PREFIX = "tap"
     self.m_config.ETCD_ADDRS = [ETCD_ADDRESS]
     self.m_config.ETCD_SCHEME = "http"
     self.m_config.ETCD_KEY_FILE = None
     self.m_config.ETCD_CERT_FILE = None
     self.m_config.ETCD_CA_FILE = None
     self.m_config.USAGE_REPORT = False
     self.m_hosts_ipset = Mock(spec=IpsetActor)
     self.m_api = Mock(spec=EtcdAPI)
     self.m_status_rep = Mock(spec=EtcdStatusReporter)
     self.watcher = _FelixEtcdWatcher(self.m_config,
                                      self.m_api,
                                      self.m_status_rep,
                                      self.m_hosts_ipset)
     self.m_splitter = Mock(spec=UpdateSplitter)
     self.watcher.splitter = self.m_splitter
     self.m_reader = Mock(spec=MessageReader)
     self.m_writer = Mock(spec=MessageWriter)
     self.watcher._msg_reader = self.m_reader
     self.watcher._msg_writer = self.m_writer
     self.m_driver_proc = Mock(spec=subprocess.Popen)
     self.watcher._driver_process = self.m_driver_proc
예제 #2
0
 def setUp(self):
     super(TestEtcdWatcher, self).setUp()
     self.m_config = Mock()
     self.m_config.HOSTNAME = "hostname"
     self.m_config.IFACE_PREFIX = "tap"
     self.m_config.ETCD_ADDRS = [ETCD_ADDRESS]
     self.m_config.ETCD_SCHEME = "http"
     self.m_config.ETCD_KEY_FILE = None
     self.m_config.ETCD_CERT_FILE = None
     self.m_config.ETCD_CA_FILE = None
     self.m_hosts_ipset = Mock(spec=IpsetActor)
     self.m_api = Mock(spec=EtcdAPI)
     self.m_status_rep = Mock(spec=EtcdStatusReporter)
     self.watcher = _FelixEtcdWatcher(self.m_config,
                                      self.m_api,
                                      self.m_status_rep,
                                      self.m_hosts_ipset)
     self.m_splitter = Mock(spec=UpdateSplitter)
     self.watcher.splitter = self.m_splitter
     self.m_reader = Mock(spec=MessageReader)
     self.m_writer = Mock(spec=MessageWriter)
     self.watcher._msg_reader = self.m_reader
     self.watcher._msg_writer = self.m_writer
     self.m_driver_proc = Mock(spec=subprocess.Popen)
     self.watcher._driver_process = self.m_driver_proc
예제 #3
0
 def setUp(self):
     super(TestEtcdWatcher, self).setUp()
     self.m_config = Mock()
     self.m_config.HOSTNAME = "hostname"
     self.m_config.IFACE_PREFIX = "tap"
     self.m_config.ETCD_ADDR = ETCD_ADDRESS
     self.m_hosts_ipset = Mock(spec=IpsetActor)
     self.watcher = _FelixEtcdWatcher(self.m_config, self.m_hosts_ipset)
     self.m_splitter = Mock(spec=UpdateSplitter)
     self.watcher.splitter = self.m_splitter
     self.client = Mock(spec=etcd.Client)
     self.watcher.client = self.client
예제 #4
0
 def setUp(self):
     super(TestEtcdWatcher, self).setUp()
     self.m_config = Mock()
     self.m_config.HOSTNAME = "hostname"
     self.m_config.IFACE_PREFIX = "tap"
     self.m_config.ETCD_ADDR = ETCD_ADDRESS
     self.m_hosts_ipset = Mock(spec=IpsetActor)
     self.m_api = Mock(spec=EtcdAPI)
     self.m_status_rep = Mock(spec=EtcdStatusReporter)
     self.watcher = _FelixEtcdWatcher(self.m_config, self.m_api,
                                      self.m_status_rep, self.m_hosts_ipset)
     self.m_splitter = Mock(spec=UpdateSplitter)
     self.watcher.splitter = self.m_splitter
     self.client = Mock()
     self.watcher.client = self.client