class OVSTest(unittest2.TestCase): def setUp(self): self.host = '10.145.88.160' self.credential = {'username': '******', 'password': '******'} self.ovswitch = OVSwitch() def tearDown(self): del self.ovswitch @patch('compass.hdsdiscovery.utils.ssh_remote_execute') def test_isThisVendor_withIncorrectInput(self, ovs_mock): ovs_mock.return_value = [] # Incorrect host ip self.assertFalse(self.ovswitch.is_this_vendor('1.1.1.1', self.credential)) # Incorrect credential self.assertFalse( self.ovswitch.is_this_vendor(self.host, {'username': '******', 'password': '******'})) # not Open vSwitch self.assertFalse( self.ovswitch.is_this_vendor(self.host, {'Version': 'xxx', 'Community': 'xxx'})) # not Open vSwitch, snmpv3 self.assertFalse( self.ovswitch.is_this_vendor(self.host, {'Version': 'xxx', 'Community': 'xxx', 'username': '******', 'password': '******'}))
def setUp(self): self.host = '10.145.88.160' self.credential = {'username': '******', 'password': '******'} self.ovswitch = OVSwitch()