コード例 #1
0
ファイル: test_utils.py プロジェクト: yuanchunzhang/nova
    def test_disk_type_from_path(self, mock_exists):
        # Seems like lvm detection
        # if its in /dev ??
        for p in ['/dev/b', '/dev/blah/blah']:
            d_type = libvirt_utils.get_disk_type_from_path(p)
            self.assertEqual('lvm', d_type)

        # Try rbd detection
        d_type = libvirt_utils.get_disk_type_from_path('rbd:pool/instance')
        self.assertEqual('rbd', d_type)

        # Try the other types
        path = '/myhome/disk.config'
        d_type = libvirt_utils.get_disk_type_from_path(path)
        self.assertIsNone(d_type)
コード例 #2
0
ファイル: test_utils.py プロジェクト: andymcc/nova
    def test_disk_type_from_path(self, mock_exists):
        # Seems like lvm detection
        # if its in /dev ??
        for p in ['/dev/b', '/dev/blah/blah']:
            d_type = libvirt_utils.get_disk_type_from_path(p)
            self.assertEqual('lvm', d_type)

        # Try rbd detection
        d_type = libvirt_utils.get_disk_type_from_path('rbd:pool/instance')
        self.assertEqual('rbd', d_type)

        # Try the other types
        path = '/myhome/disk.config'
        d_type = libvirt_utils.get_disk_type_from_path(path)
        self.assertIsNone(d_type)
コード例 #3
0
ファイル: test_utils.py プロジェクト: yuanchunzhang/nova
 def test_disk_type_ploop(self, mock_isdir, mock_exists):
     path = '/some/path'
     d_type = libvirt_utils.get_disk_type_from_path(path)
     mock_isdir.assert_called_once_with(path)
     mock_exists.assert_called_once_with("%s/DiskDescriptor.xml" % path)
     self.assertEqual('ploop', d_type)
コード例 #4
0
ファイル: test_utils.py プロジェクト: cloudscaling/nova
 def test_disk_type_ploop(self, mock_isdir, mock_exists):
     path = '/some/path'
     d_type = libvirt_utils.get_disk_type_from_path(path)
     mock_isdir.assert_called_once_with(path)
     mock_exists.assert_called_once_with("%s/DiskDescriptor.xml" % path)
     self.assertEqual('ploop', d_type)