The current API only support setting a bridge fail mode
to secure, this patch allow the user to set it to 'standalone'
as well
Change-Id: If7e6532dc7f8527c35834a37144ea4386fe1b861
Closes-Bug: #
1458924
# OVS bridge fail modes
FAILMODE_SECURE = 'secure'
+FAILMODE_STANDALONE = 'standalone'
OPTS = [
cfg.IntOpt('ovs_vsctl_timeout',
self.ovsdb.set_fail_mode(self.br_name, FAILMODE_SECURE).execute(
check_error=True)
+ def set_standalone_mode(self):
+ self.ovsdb.set_fail_mode(self.br_name, FAILMODE_STANDALONE).execute(
+ check_error=True)
+
def set_protocols(self, protocols):
self.set_db_attribute('Bridge', self.br_name, 'protocols', protocols,
check_error=True)
self.br.db_get_val('Controller', self.br.br_name,
'connection_mode'))
- def test_set_fail_mode(self):
+ def test_set_fail_mode_secure(self):
self.br.set_secure_mode()
self._assert_br_fail_mode(ovs_lib.FAILMODE_SECURE)
+ def test_set_fail_mode_standalone(self):
+ self.br.set_standalone_mode()
+ self._assert_br_fail_mode(ovs_lib.FAILMODE_STANDALONE)
+
def _assert_br_fail_mode(self, fail_mode):
self.assertEqual(
self.br.db_get_val('Bridge', self.br.br_name, 'fail_mode'),
self.br.set_secure_mode()
self._verify_vsctl_mock('set-fail-mode', self.BR_NAME, 'secure')
+ def test_set_standalone_mode(self):
+ self.br.set_standalone_mode()
+ self._verify_vsctl_mock('set-fail-mode', self.BR_NAME, 'standalone')
+
def test_set_protocols(self):
protocols = 'OpenFlow13'
self.br.set_protocols(protocols)