예제 #1
0
파일: test_nfs.py 프로젝트: tuitang00/nova
    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]))
예제 #2
0
파일: test_nfs.py 프로젝트: yfxu1990/nova
    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')
예제 #3
0
파일: test_mount.py 프로젝트: Juniper/nova
    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()
예제 #4
0
파일: test_nfs.py 프로젝트: arbrandes/nova
    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')
예제 #5
0
파일: test_mount.py 프로젝트: zsvic/nova
    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()