Esempio n. 1
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)
Esempio n. 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)
Esempio n. 3
0
 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)])
Esempio n. 4
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
Esempio n. 5
0
 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])
Esempio n. 6
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(fileSD.getStorageDomainsList(), [])
Esempio n. 7
0
 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)])
Esempio n. 8
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
Esempio n. 9
0
 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])
Esempio n. 10
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(fileSD.getStorageDomainsList(), [])