tests.devices_test package¶
Submodules¶
tests.devices_test.dependencies_test module¶
-
class
tests.devices_test.dependencies_test.
DeviceDependenciesTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Test external device dependencies.
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_dependencies
()¶
-
-
class
tests.devices_test.dependencies_test.
MockingDeviceDependenciesTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Test availability of external device dependencies.
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.
-
setUp
()¶
-
tearDown
()¶
-
test_availability_mdraidplugin
()¶
-
tests.devices_test.device_names_test module¶
-
class
tests.devices_test.device_names_test.
DeviceNameTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Test device name validation
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_logical_volume
()¶
-
test_storage_device
()¶
-
test_volume_group
()¶
-
tests.devices_test.device_packages_test module¶
-
class
tests.devices_test.device_packages_test.
DevicePackagesTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Test device name validation
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_packages
()¶
-
tests.devices_test.device_properties_test module¶
-
class
tests.devices_test.device_properties_test.
BTRFSDeviceTestCase
(methodName='run_test')¶ Bases:
tests.devices_test.device_properties_test.DeviceStateTestCase
Note that these tests postdate the code that they test. Therefore, they capture the behavior of the code as it is now, not necessarily its intended or correct behavior. See the initial commit message for this file for further details.
-
setUp
()¶
-
test_btrfsdevice_init
()¶ Tests the state of a BTRFSDevice after initialization. For some combinations of arguments the initializer will throw an exception.
-
test_btrfsdevice_methods
()¶ Test for method calls on initialized BTRFS Devices.
-
test_btrfssnap_shot_device_init
()¶
-
-
class
tests.devices_test.device_properties_test.
DeviceStateTestCase
(methodName='run_test')¶ Bases:
unittest.case.TestCase
A class which implements a simple method of checking the state of a device object.
-
state_check
(device, **kwargs)¶ Checks the current state of a device by means of its fields or properties.
Every kwarg should be a key which is a field or property of a Device and a value which is a function of two parameters and should call the appropriate assert* functions. These values override those in the state_functions dict.
If the value is None, then the test starts the debugger instead.
-
-
class
tests.devices_test.device_properties_test.
LVMLogicalVolumeDeviceTestCase
(methodName='run_test')¶ Bases:
tests.devices_test.device_properties_test.DeviceStateTestCase
-
setUp
()¶
-
test_lvmlogical_volume_device_init
()¶
-
test_lvmlogical_volume_device_init_cached
()¶
-
-
class
tests.devices_test.device_properties_test.
MDRaidArrayDeviceTestCase
(methodName='run_test')¶ Bases:
tests.devices_test.device_properties_test.DeviceStateTestCase
Note that these tests postdate the code that they test. Therefore, they capture the behavior of the code as it is now, not necessarily its intended or correct behavior. See the initial commit message for this file for further details.
-
setUp
()¶
-
tearDown
()¶
-
test_mdraid_array_device_init
()¶ Tests the state of a MDRaidArrayDevice after initialization. For some combinations of arguments the initializer will throw an exception.
-
test_mdraid_array_device_methods
()¶ Test for method calls on initialized MDRaidDevices.
-
-
tests.devices_test.device_properties_test.
xform
(func)¶ Simple wrapper function that transforms a function that takes a precalculated value and a message to a function that takes a device and an attribute name, evaluates the attribute, and passes the value and the attribute name as the message to the original function.
Parameters: func ((object * str) -> None) – The function to be transformed. Returns: a function that gets the attribute and passes it to func Return type: (object * str) -> None
tests.devices_test.lvm_test module¶
-
class
tests.devices_test.lvm_test.
LVMDeviceTest
(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_lvm_logical_volume_insuf_seg_type
()¶
-
test_lvm_logical_volume_metadata_size
()¶
-
test_lvm_logical_volume_mirror
()¶
-
test_lvm_logical_volume_pv_free_cached
()¶
-
test_lvm_logical_volume_pv_free_linear
()¶
-
test_lvm_logical_volume_raid_level
()¶
-
test_lvm_logical_volume_segtype_init
()¶
-
test_lvm_logical_volume_segtype_pv_free
()¶
-
test_lvm_logical_volume_with_pvs_init
()¶
-
test_lvmcached_logical_volume_init
()¶
-
test_lvmcached_two_logical_volume_init
()¶
-
test_lvmsnap_shot_device_init
()¶
-
test_lvmthin_snap_shot_device_init
()¶
-
test_target_size
()¶
-
-
class
tests.devices_test.lvm_test.
TypeSpecificCallsTest
(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_type_specific_calls
()¶
-
tests.devices_test.network_test module¶
-
class
tests.devices_test.network_test.
FakeNetDev
(name, fmt=None, uuid=None, size=None, major=None, minor=None, sysfs_path='', parents=None, exists=False, serial=None, vendor='', model='', bus='')¶ Bases:
blivet.devices.storage.StorageDevice
,blivet.devices.network.NetworkStorageDevice
Parameters: - name (str) – the device name (generally a device node’s basename)
- exists (bool) – does this device exist?
- size (
Size
) – the device’s size - parents (list of
StorageDevice
) – a list of parent devices - fmt (
DeviceFormat
or a subclass of it) – this device’s formatting - uuid (str) – universally unique identifier (device – not fs)
- sysfs_path (str) – sysfs device path
- major (int) – the device major
- minor (int) – the device minor
- serial (str) – the ID_SERIAL_SHORT for this device
- vendor (str) – the manufacturer of this Device
- model (str) – manufacturer’s device model string
- bus (str) – the interconnect this device uses
-
class
tests.devices_test.network_test.
NetDevMountOptionTestCase
(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_net_dev_setting
()¶ Verify netdev mount option setting after format assignment.
-
test_net_dev_update
()¶ Verify netdev mount option setting after device creation.
-
tests.devices_test.partition_test module¶
-
class
tests.devices_test.partition_test.
PartitionDeviceTestCase
(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_extended_min_size
()¶
-
test_min_max_size_alignment
()¶
-
test_target_size
()¶
-
tests.devices_test.size_test module¶
-
class
tests.devices_test.size_test.
StorageDeviceSizeTest
(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_size_getter
()¶
-
test_size_setter
()¶
-