示例#1
0
文件: filesd_test.py 项目: nirs/vdsm
 def test_select_domains(self, scan_pattern, sd_type):
     with fake_repo() as repo, namedTemporaryDir() as tmpdir:
         file_sd = add_filesd(repo, "nfs.server:/path", str(uuid.uuid4()))
         gluster_sd = add_filesd(repo, "gluster.server:/volname",
                                 str(uuid.uuid4()), subdir=sd.GLUSTERSD_DIR)
         local_sd = add_localsd(repo, tmpdir, str(uuid.uuid4()))
         domains = {"gluster": [gluster_sd],
                    "local": [local_sd],
                    "all": [file_sd, gluster_sd, local_sd]}
         expected = set([(domain.uuid, domain.dom_dir)
                         for domain in domains[sd_type]])
         self.assertEqual(set(fileSD.scanDomains(scan_pattern)), expected)
示例#2
0
 def test_select_domains(self, scan_pattern, sd_type):
     with fake_repo() as repo, namedTemporaryDir() as tmpdir:
         file_sd = add_filesd(repo, "nfs.server:/path", str(uuid.uuid4()))
         gluster_sd = add_filesd(repo, "gluster.server:/volname",
                                 str(uuid.uuid4()), subdir=sd.GLUSTERSD_DIR)
         local_sd = add_localsd(repo, tmpdir, str(uuid.uuid4()))
         domains = {"gluster": [gluster_sd],
                    "local": [local_sd],
                    "all": [file_sd, gluster_sd, local_sd]}
         expected = set([(domain.uuid, domain.dom_dir)
                         for domain in domains[sd_type]])
         self.assertEqual(set(fileSD.scanDomains(scan_pattern)), expected)
示例#3
0
文件: filesd_test.py 项目: xin49/vdsm
 def test_nfs_with_IPV6_address(self):
     with fake_repo() as repo:
         nfs_sd = add_filesd(repo, "[201::1]:/path", str(uuid.uuid4()))
         self.assertEqual(list(fileSD.scanDomains()),
                          [(nfs_sd.uuid, nfs_sd.dom_dir)])
示例#4
0
文件: filesd_test.py 项目: xin49/vdsm
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
示例#5
0
文件: filesd_test.py 项目: xin49/vdsm
 def test_detect_filesd(self):
     with fake_repo() as repo:
         sd = add_filesd(repo, "server:/path", str(uuid.uuid4()))
         self.assertEqual(fileSD.getStorageDomainsList(), [sd.uuid])
示例#6
0
文件: filesd_test.py 项目: xin49/vdsm
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(fileSD.getStorageDomainsList(), [])
示例#7
0
文件: filesd_test.py 项目: nirs/vdsm
 def test_nfs_with_IPV6_address(self):
     with fake_repo() as repo:
         nfs_sd = add_filesd(repo, "[201::1]:/path", str(uuid.uuid4()))
         self.assertEqual(list(fileSD.scanDomains()),
                          [(nfs_sd.uuid, nfs_sd.dom_dir)])
示例#8
0
文件: filesd_test.py 项目: nirs/vdsm
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
示例#9
0
文件: filesd_test.py 项目: nirs/vdsm
 def test_detect_filesd(self):
     with fake_repo() as repo:
         sd = add_filesd(repo, "server:/path", str(uuid.uuid4()))
         self.assertEqual(fileSD.getStorageDomainsList(), [sd.uuid])
示例#10
0
文件: filesd_test.py 项目: nirs/vdsm
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(fileSD.getStorageDomainsList(), [])