def setUp(self): self.god = mock.mock_god(ut=self) def utils_run(*args, **kargs): return TestBridge.FakeCmd(*args, **kargs) self.god.stub_with(process, 'run', utils_run)
def setUp(self): self.god = mock.mock_god(ut=self) self.god.stub_with(process, "run", utils_run) all_nodes = tempfile.NamedTemporaryFile(delete=False) all_nodes.write(all_nodes_contents) all_nodes.close() online_nodes = tempfile.NamedTemporaryFile(delete=False) online_nodes.write(online_nodes_contents) online_nodes.close() self.all_nodes_path = all_nodes.name self.online_nodes_path = online_nodes.name self.numa_node = utils_misc.NumaNode(-1, self.all_nodes_path, self.online_nodes_path)
def setUp(self): self.god = mock.mock_god(ut=self) self.god.stub_with(process, 'run', utils_run) all_nodes = tempfile.NamedTemporaryFile(delete=False) all_nodes.write(all_nodes_contents) all_nodes.close() online_nodes = tempfile.NamedTemporaryFile(delete=False) online_nodes.write(online_nodes_contents) online_nodes.close() self.all_nodes_path = all_nodes.name self.online_nodes_path = online_nodes.name self.numa_node = utils_misc.NumaNode(-1, self.all_nodes_path, self.online_nodes_path)
def setUp(self): # Get rid of logging errors def dumm(*args, **kvargs): pass self.god = mock.mock_god(ut=self) self.god.stub_with(qemu_qtree.logging, 'error', dumm) info = qtree_header info = combine(info, dev_ide_disk, 1) info = combine(info, dev_usb_disk, 1) info = combine(info, dev_dummy_mmio, 1) info += "\n" self.no_disks = 2 self.qtree = qemu_qtree.QtreeContainer() self.qtree.parse_info_qtree(info) self.disks = qemu_qtree.QtreeDisksContainer(self.qtree.get_nodes())
def setUp(self): # The normal iscsi with iscsi server should configure following # parameters. As this will need env support only test emulated # iscsi in local host. # self.iscsi_params = {"target": "", # "portal_ip": "", # "initiator": ""} self.iscsi_emulated_params = {"emulated_image": "/tmp/iscsitest", "target": "iqn.2003-01.org.linux:iscsitest", "image_size": "1024K", "chap_user": "******", "chap_passwd": "123456"} self.god = mock.mock_god() self.god.stub_function(path, "find_command") self.god.stub_function(process, "system") self.god.stub_function(process, "system_output") self.god.stub_function(os.path, "isfile") self.god.stub_function(utils_selinux, "is_enforcing")
def setUp(self): self.nfs_params = {"nfs_mount_dir": "/mnt/nfstest", "nfs_mount_options": "rw", "nfs_mount_src": "127.0.0.1:/mnt/nfssrc", "setup_local_nfs": "yes", "export_options": "rw,no_root_squash"} self.god = mock.mock_god() self.god.stub_function(path, "find_command") self.god.stub_function(process, "system") self.god.stub_function(process, "system_output") self.god.stub_function(os.path, "isfile") self.god.stub_function(os, "makedirs") self.god.stub_function(utils_misc, "is_mounted") self.god.stub_function(utils_misc, "mount") self.god.stub_function(utils_misc, "umount") self.god.stub_function(service.Factory, "create_service") attr = getattr(nfs, "Exportfs") setattr(attr, "already_exported", False) mock_class = self.god.create_mock_class_obj(attr, "Exportfs") self.god.stub_with(nfs, "Exportfs", mock_class)
def setUp(self): self.god = mock.mock_god(ut=self) self.god.stub_function(qcontainer.process, "system_output")
def setUp(self): self.god = mock.mock_god(ut=self) self.version = 1