def is_ovs_lib_vxlan_supported(self): try: ovs_lib.check_ovs_vxlan_version(self.root_helper) except SystemError: return False else: return True
def _check_ovs_vxlan_version( self, installed_usr_version, installed_klm_version, installed_kernel_version, expecting_ok ): with mock.patch("neutron.agent.linux.ovs_lib.get_installed_ovs_klm_version") as klm_cmd: with mock.patch("neutron.agent.linux.ovs_lib.get_installed_ovs_usr_version") as usr_cmd: with mock.patch("neutron.agent.linux.ovs_lib.get_installed_kernel_version") as kernel_cmd: try: klm_cmd.return_value = installed_klm_version usr_cmd.return_value = installed_usr_version kernel_cmd.return_value = installed_kernel_version ovs_lib.check_ovs_vxlan_version(root_helper="sudo") version_ok = True except SystemError: version_ok = False self.assertEqual(version_ok, expecting_ok)
def _check_ovs_vxlan_version(self, installed_usr_version, installed_klm_version, expecting_ok): with mock.patch( 'neutron.agent.linux.ovs_lib.get_installed_ovs_klm_version' ) as klm_cmd: with mock.patch( 'neutron.agent.linux.ovs_lib.get_installed_ovs_usr_version' ) as usr_cmd: try: klm_cmd.return_value = installed_klm_version usr_cmd.return_value = installed_usr_version ovs_lib.check_ovs_vxlan_version(root_helper='sudo') version_ok = True except SystemError: version_ok = False self.assertEqual(version_ok, expecting_ok)