Esempio n. 1
0
 def test_md_by_mount(self):
     self.assertEqual(0, len(self.p_scheme.mds))
     self.assertEqual(0, len(self.p_scheme.fss))
     expected_md = partition.Md('name', 'level')
     expected_fs = partition.Fs('name', mount='mount')
     self.p_scheme.mds.append(expected_md)
     self.p_scheme.fss.append(expected_fs)
     self.p_scheme.fss.append(
         partition.Fs('wrong_name', mount='wrong_mount'))
     self.assertEqual(expected_md, self.p_scheme.md_by_mount('mount'))
Esempio n. 2
0
 def test_md_attach_by_mount_md_exists(self):
     self.assertEqual(0, len(self.p_scheme.mds))
     self.assertEqual(0, len(self.p_scheme.fss))
     expected_md = partition.Md('name', 'level')
     expected_fs = partition.Fs('name', mount='mount')
     self.p_scheme.mds.append(expected_md)
     self.p_scheme.fss.append(expected_fs)
     actual_md = self.p_scheme.md_attach_by_mount('device', 'mount')
     self.assertIn('device', actual_md.devices)
     self.assertEqual(expected_md, actual_md)
Esempio n. 3
0
 def test_fs_by_mount(self):
     expected_fs = partition.Fs('d', mount='mount')
     self.p_scheme.fss.append(expected_fs)
     self.p_scheme.fss.append(partition.Fs('w_d', mount='wrong_mount'))
     actual_fs = self.p_scheme.fs_by_mount('mount')
     self.assertEqual(expected_fs, actual_fs)
Esempio n. 4
0
 def test_fs_by_device(self):
     expected_fs = partition.Fs('device')
     self.p_scheme.fss.append(expected_fs)
     self.p_scheme.fss.append(partition.Fs('wrong_device'))
     actual_fs = self.p_scheme.fs_by_device('device')
     self.assertEqual(expected_fs, actual_fs)