Пример #1
0
 def test_partition_usage_labels(self):
     model, partition = make_model_and_partition()
     self.assertEqual(usage_labels(partition), ["unused"])
     fs = model.add_filesystem(partition, 'ext4')
     self.assertEqual(
         usage_labels(partition),
         ["to be formatted as ext4", "not mounted"])
     model._orig_config = model._render_actions()
     fs.preserve = True
     partition.preserve = True
     self.assertEqual(
         usage_labels(partition),
         ["already formatted as ext4", "not mounted"])
     model.remove_filesystem(fs)
     fs2 = model.add_filesystem(partition, 'ext4')
     self.assertEqual(
         usage_labels(partition),
         ["to be reformatted as ext4", "not mounted"])
     model.add_mount(fs2, '/')
     self.assertEqual(
         usage_labels(partition),
         ["to be reformatted as ext4", "mounted at /"])
Пример #2
0
 def test_partition_action_TOGGLE_BOOT(self):
     model, part = make_model_and_partition()
     self.assertActionNotSupported(part, DeviceAction.TOGGLE_BOOT)
Пример #3
0
 def test_partition_action_FORMAT(self):
     model, part = make_model_and_partition()
     self.assertActionNotSupported(part, DeviceAction.FORMAT)
Пример #4
0
 def test_partition_action_CREATE_LV(self):
     model, part = make_model_and_partition()
     self.assertActionNotSupported(part, DeviceAction.CREATE_LV)
Пример #5
0
 def test_partition_action_PARTITION(self):
     model, part = make_model_and_partition()
     self.assertActionNotSupported(part, DeviceAction.PARTITION)
Пример #6
0
 def test_partition_action_EDIT(self):
     model, part = make_model_and_partition()
     self.assertActionPossible(part, DeviceAction.EDIT)
     model.add_volgroup('vg1', {part})
     self.assertActionNotPossible(part, DeviceAction.EDIT)