def setUp(self): super(LibvirtNFSVolumeDriverTestCase, self).setUp() m = mount.get_manager() m._reset_state() self.mnt_base = '/mnt' m.host_up(self.fake_host) self.flags(nfs_mount_point_base=self.mnt_base, group='libvirt') # Caution: this is also faked by the superclass orig_execute = utils.execute mounted = [False] def fake_execute(*cmd, **kwargs): orig_execute(*cmd, **kwargs) if cmd[0] == 'mount': mounted[0] = True if cmd[0] == 'umount': mounted[0] = False self.useFixture( fixtures.MonkeyPatch('nova.utils.execute', fake_execute)) # Mock ismount to return the current mount state # N.B. This is only valid for tests which mount and unmount a single # directory. self.useFixture( fixtures.MonkeyPatch('os.path.ismount', lambda *args, **kwargs: mounted[0]))
def setUp(self): super(LibvirtNFSVolumeDriverTestCase, self).setUp() m = mount.get_manager() m._reset_state() self.mnt_base = '/mnt' m.host_up(self.fake_host) self.flags(nfs_mount_point_base=self.mnt_base, group='libvirt')
def setUp(self): super(MountManagerTestCase, self).setUp() self.useFixture(fixtures.MonkeyPatch( 'nova.virt.libvirt.volume.mount._HostMountState', self.FakeHostMountState)) self.m = mount.get_manager() self.m._reset_state()
def setUp(self): super(LibvirtNFSVolumeDriverTestCase, self).setUp() m = mount.get_manager() m._reset_state() self.mnt_base = '/mnt' m.host_up(self.fake_host) self.flags(nfs_mount_point_base=self.mnt_base, group='libvirt')
def setUp(self): super(MountManagerTestCase, self).setUp() self.useFixture(fixtures.MonkeyPatch( 'nova.virt.libvirt.volume.mount._HostMountState', self.FakeHostMountState)) self.m = mount.get_manager() self.m._reset_state()