tests.formats_test package

Submodules

tests.formats_test.device_test module

class tests.formats_test.device_test.DeviceFormatTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_formats()
class tests.formats_test.device_test.DeviceValueTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_value()

tests.formats_test.disklabel_test module

class tests.formats_test.disklabel_test.DiskLabelTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_best_label_type(arch)
  1. is always in _disklabel_types

  2. is the default unless the device is too long for the default

  3. is msdos for fba dasd on S390

  4. is dasd for non-fba dasd on S390

test_get_alignment()
test_label_type_size_check()
test_platform_label_types(arch)

tests.formats_test.fs_test module

class tests.formats_test.fs_test.AppleBootstrapFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.HFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.BTRFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.BindFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.DevPtsFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.EFIFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.FATFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.Ext2FSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.Ext3FSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.Ext2FSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.Ext4FSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.Ext3FSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.F2FSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.FATFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.GFS2TestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.HFSPlusTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.HFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.Iso9660FS(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.JFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.MacEFIFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.HFSPlusTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.NFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.NFSv4TestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.NTFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.NoDevFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.ProcFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.ReiserFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.ResizeTmpFSTestCase(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

setUp()

Hook method for setting up the test fixture before exercising it.

test_resize()
test_shrink()
class tests.formats_test.fs_test.SELinuxFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.SimpleTmpFSTestCase(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_simple()
class tests.formats_test.fs_test.SysFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.TmpFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.USBFSTestCase(methodName='run_test')

Bases: tests.formats_test.fs_test.NoDevFSTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.fs_test.XFSTestCase(methodName='run_test')

Bases: tests.formats_test.fstesting.FSAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

can_resize(an_fs)

Returns True if this filesystem has all necessary resizing tools available.

Parameters

an_fs – a filesystem object

test_no_explicit_target_size2()

Because _target_size has been set to size in constructor the resize action resizes filesystem to that size.

test_resize()
test_shrink()
test_too_big2()
test_too_small()

tests.formats_test.fslabeling module

class tests.formats_test.fslabeling.CompleteLabelingAsRoot(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingAsRoot

Tests where it is possible to read the label and to relabel an existing filesystem.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_creating()

Create the filesystem when passing a valid label. Verify that the filesystem has that label.

test_creating_empty()

Create a filesystem with an empty label. Verify that the filesystem has the empty label.

test_creating_none()

Create a filesystem with the label None. Verify that the filesystem has the default label.

test_labeling()

A sequence of tests of filesystem labeling.

  • create the filesystem when passing an invalid label and verify that the filesystem has the default label

  • relabel the filesystem with a valid label and verify that the filesystem has that label

  • relabel the filesystem with an empty label and verify that the filesystem has that label

  • raise an exception when relabeling when None is specified

  • raise an exception when relabeling with an invalid label

class tests.formats_test.fslabeling.LabelingAsRoot(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

Tests various aspects of labeling a filesystem where there is no easy way to read the filesystem’s label once it has been set and where the filesystem can not be relabeled.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

setUp()

Hook method for setting up the test fixture before exercising it.

test_creating()

Create the filesystem when passing a valid label

test_creating_empty()

Create the filesystem when passing the empty label.

test_creating_none()

Create the filesystem when passing None (indicates filesystem default)

test_labeling()

A sequence of tests of filesystem labeling.

  • create the filesystem when passing an invalid label

  • raise an exception when reading the filesystem

  • raise an exception when relabeling the filesystem

class tests.formats_test.fslabeling.LabelingWithRelabeling(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingAsRoot

Tests labeling where it is possible to relabel.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_labeling()

A sequence of tests of filesystem labeling.

  • create the filesystem when passing an invalid label

  • raise an exception when reading the filesystem

  • relabel the filesystem with a valid label

  • relabel the filesystem with an empty label

  • raise an exception when relabeling when None is specified

  • raise an exception when relabeling with an invalid label

tests.formats_test.fstesting module

class tests.formats_test.fstesting.FSAsRoot(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

can_resize(an_fs)

Returns True if this filesystem has all necessary resizing tools available.

Parameters

an_fs – a filesystem object

test_creation()
test_instantiation()
test_labeling()
test_mounting()
test_mountpoint()
test_no_explicit_target_size()

Because _target_size has not been set, resize sets to min size.

test_no_explicit_target_size2()

Because _target_size has been set to size in constructor the resize action resizes filesystem to that size.

test_relabeling()
test_resize()
test_shrink()
test_too_big()
test_too_big2()
test_too_small()

tests.formats_test.fsuuid module

class tests.formats_test.fsuuid.SetUUID(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

Base class for UUID tests without any test methods.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

setUp()

Hook method for setting up the test fixture before exercising it.

class tests.formats_test.fsuuid.SetUUIDAfterMkFs(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUID

Tests various aspects of setting an UUID for a filesystem where the native mkfs tool can’t set the UUID.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

setUp()

Hook method for setting up the test fixture before exercising it.

test_reset_uuid()

Create the filesystem with random UUID and reset it later.

test_set_invalid_uuid_later()

Create the filesystem and try to reassign an invalid UUID later.

test_set_uuid_later()

Create the filesystem with random UUID and reassign later.

class tests.formats_test.fsuuid.SetUUIDWithMkFs(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUID

Tests various aspects of setting an UUID for a filesystem where the native mkfs tool can set the UUID.

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_set_invalid_uuid()

Create the filesystem with an invalid UUID.

test_set_uuid()

Create the filesystem with a valid UUID.

tests.formats_test.init_test module

class tests.formats_test.init_test.FormatsTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_formats_methods()

tests.formats_test.labeling_test module

class tests.formats_test.labeling_test.Ext2FSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.CompleteLabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.FATFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.CompleteLabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.HFSPlusTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.HFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.InitializationTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test FS object initialization.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_labels()

Initialize some filesystems with valid and invalid labels.

class tests.formats_test.labeling_test.JFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingWithRelabeling

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.LabelingSwapSpaceTestCase(methodName='run_test', device_spec=None, block_size=None)

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_creating_swap_space_empty()
test_creating_swap_space_none()
test_labeling()
test_relabel()
class tests.formats_test.labeling_test.NTFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.CompleteLabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.ReiserFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.LabelingWithRelabeling

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.labeling_test.XFSTestCase(methodName='run_test')

Bases: tests.formats_test.fslabeling.CompleteLabelingAsRoot

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

tests.formats_test.loopbackedtestcase module

class tests.formats_test.loopbackedtestcase.LoopBackedTestCase(methodName='run_test', device_spec=None, block_size=None)

Bases: unittest.case.TestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

DEFAULT_BLOCK_SIZE = Size (1024 B)
DEFAULT_STORE_SIZE = Size (100 MiB)
setUp()

Hook method for setting up the test fixture before exercising it.

tests.formats_test.loopbackedtestcase.get_free_loop_dev()

Get the name of the free loop device that losetup reports.

Returns

the name of the free loop device

Return type

str

Raises

OSError – on failure

tests.formats_test.loopbackedtestcase.make_loop_dev(device_name, file_name)

Set up a loop device with a backing store.

Parameters
  • device_name (str) – the path of the loop device

  • file_name (str) – the path of the backing file

tests.formats_test.loopbackedtestcase.make_store(file_name, num_blocks=102400, block_size=1024)

Set up the backing store for a loop device.

Parameters
  • file_name (str) – the path of the backing file

  • num_blocks (int) – the size of file_name in number of blocks

  • block_size (int) – the number of bytes in a block

tests.formats_test.loopbackedtestcase.remove_loop_dev(device_name)

tests.formats_test.luks_test module

class tests.formats_test.luks_test.IntegrityTestCase(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_integrity()
class tests.formats_test.luks_test.LUKSNodevTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_create_discard_option()
test_key_size()
test_sector_size()
class tests.formats_test.luks_test.LUKSTestCase(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_map_name()
test_resize()
test_size()

tests.formats_test.lvmpv_test module

class tests.formats_test.lvmpv_test.LVMPVTestCase(methodName='run_test')

Bases: tests.formats_test.loopbackedtestcase.LoopBackedTestCase

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

test_resize()
test_size()

tests.formats_test.methods_test module

class tests.formats_test.methods_test.EFIFSMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FSMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.fs.EFIFS

class tests.formats_test.methods_test.Ext4FSMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FSMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.fs.Ext4FS

class tests.formats_test.methods_test.FSMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FormatMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class = None
setUp()

Hook method for setting up the test fixture before exercising it.

set_os_path_exists(value)
set_patches()
test_create()
test_destroy()
test_setup()
test_teardown()
class tests.formats_test.methods_test.FormatMethodsTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.DeviceFormat

setUp()

Hook method for setting up the test fixture before exercising it.

set_os_path_exists(value)
set_patches()
start_patches()
stop_patches()
test_create()
test_destroy()
test_setup()
test_teardown()
class tests.formats_test.methods_test.LUKSMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FormatMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.luks.LUKS

set_patches()
class tests.formats_test.methods_test.LVMPhysicalVolumeMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FormatMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.lvmpv.LVMPhysicalVolume

set_patches()
class tests.formats_test.methods_test.MDRaidMemberMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FormatMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.mdraid.MDRaidMember

set_patches()
class tests.formats_test.methods_test.SwapMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FormatMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.swap.SwapSpace

set_patches()
class tests.formats_test.methods_test.XFSMethodsTestCase(methodName='runTest')

Bases: tests.formats_test.methods_test.FSMethodsTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

format_class

alias of blivet.formats.fs.XFS

tests.formats_test.misc_test module

class tests.formats_test.misc_test.FSOverheadTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_biggest_overhead_FS()
test_required_size_FS()

tests.formats_test.selinux_test module

class tests.formats_test.selinux_test.SELinuxContextTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Testing SELinux contexts.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

exec_mount_selinux_format(formt, *args)

Test of correct selinux context parameter value when mounting

setUp()

Hook method for setting up the test fixture before exercising it.

test_mount_selinux_ext2fs()

Test of correct selinux context parameter value when mounting ext2

test_mount_selinux_xfs()

Test of correct selinux context parameter value when mounting XFS

tests.formats_test.swap_test module

class tests.formats_test.swap_test.SwapNodevTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_swap_max_size()

tests.formats_test.uuid_test module

class tests.formats_test.uuid_test.Ext2FSAfterTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.Ext2FSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDWithMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.FATFSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDWithMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.HFSPlusTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.InitializationTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test FS object initialization.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_generate_new_uuid()

Test that newly generated UUIDs are considered valid

test_uuids()

Initialize some filesystems with valid and invalid UUIDs.

class tests.formats_test.uuid_test.JFSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.NTFSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.ReiserFSAfterTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.ReiserFSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDWithMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.SwapSpaceTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDWithMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.XFSAfterTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDAfterMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

class tests.formats_test.uuid_test.XFSTestCase(methodName='run_test')

Bases: tests.formats_test.fsuuid.SetUUIDWithMkFs

LoopBackedTestCase manages loop devices.

It constructs loop devices according to loop_device_spec, sets them up, and tears them down again.

Parameters
  • device_spec (list of Size or NoneType) – list containing the size of each loop device

  • block_size (Size or NoneType) – block size for dd command when making devices

Module contents