def test_iscsi_visible(self): self.setup_stubs_init() iscsi_emulated = iscsi.Iscsi(self.iscsi_emulated_params) self.setup_stubs_portal_visible(iscsi_emulated) self.assertFalse(iscsi_emulated.portal_visible()) self.setup_stubs_portal_visible(iscsi_emulated, "127.0.0.1:3260,1 %s" % iscsi_emulated.target)
def test_iscsi_login(self): self.setup_stubs_init() iscsi_emulated = iscsi.Iscsi(self.iscsi_emulated_params) self.setup_stubs_logged_in() self.assertFalse(iscsi_emulated.logged_in()) result = "tcp [15] 127.0.0.1:3260,1 %s" % iscsi_emulated.target self.setup_stubs_logged_in(result) self.assertTrue(iscsi_emulated.logged_in())
def test_iscsi_get_device_name(self): self.setup_stubs_init() iscsi_emulated = iscsi.Iscsi(self.iscsi_emulated_params) iscsi_emulated.emulated_id = "1" self.setup_stubs_login(iscsi_emulated) iscsi_emulated.login() self.setup_stubs_get_device_name(iscsi_emulated) self.assertNotEqual(iscsi_emulated.get_device_name(), "") fname = "/etc/iscsi/initiatorname.iscsi-%s" % iscsi_emulated.id self.setup_stubs_cleanup(iscsi_emulated, fname=fname) iscsi_emulated.cleanup() self.god.check_playback()
def test_iscsi_target_id(self): self.setup_stubs_init() iscsi_emulated = iscsi.Iscsi(self.iscsi_emulated_params) self.setup_stubs_get_target_id() self.assertNotEqual(iscsi_emulated.get_target_id(), "")