tests.vmtests package

Submodules

tests.vmtests.blivet_reset_vmtest module

class tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase(methodName='runTest')

Bases: tests.vmtests.vmbackedtestcase.VMBackedTestCase

A class to test the results of Blivet.reset (and DeviceTree.populate).

Create a device stack on disk images, catalog a set of attributes of every device we created, reset the Blivet instance, and then verify that the devices are all discovered and have attributes matching those we cataloged previously.

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.

collect_expected_data()

Collect the attribute data we plan to validate later.

find_device(attr_dict)
setUp()

Do any setup required prior to running a test.

skip_attr(device, attr)

Return True if attr should not be checked for device.

test_run()

Verify that the devices and their attributes match across reset.

class tests.vmtests.blivet_reset_vmtest.LVMOnMDTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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.

class tests.vmtests.blivet_reset_vmtest.LVMRaidTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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()

Do any setup required prior to running a test.

class tests.vmtests.blivet_reset_vmtest.LVMSnapShotTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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()

Do any setup required prior to running a test.

class tests.vmtests.blivet_reset_vmtest.LVMTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

Test that the devicetree can populate with the product of autopart.

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.

class tests.vmtests.blivet_reset_vmtest.LVMThinSnapShotTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.LVMThinpTestCase

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()

Do any setup required prior to running a test.

class tests.vmtests.blivet_reset_vmtest.LVMThinpTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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.

class tests.vmtests.blivet_reset_vmtest.LVMVDOTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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.

class tests.vmtests.blivet_reset_vmtest.MDRaid0TestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

Verify correct detection of MD RAID0 arrays.

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.

level = 'raid0'
skip_attr(device, attr)

Return True if attr should not be checked for device.

class tests.vmtests.blivet_reset_vmtest.StratisTestCase(methodName='runTest')

Bases: tests.vmtests.blivet_reset_vmtest.BlivetResetTestCase

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.

tests.vmtests.blivet_reset_vmtest.recursive_getattr(x, attr, default=None)

Resolve a possibly-dot-containing attribute name.

tests.vmtests.runvmtests module

tests.vmtests.runvmtests.main()
tests.vmtests.runvmtests.parse_args()
tests.vmtests.runvmtests.request_cred(credentials, cmd_args)
tests.vmtests.runvmtests.run_tests(cmd_args)

Run tests in the VM

Parameters

cmd_args – parsed args from command line

tests.vmtests.runvmtests.ssh_connection(cmd_args)
tests.vmtests.runvmtests.virtual_machine(cmd_args)

tests.vmtests.vmbackedtestcase module

class tests.vmtests.vmbackedtestcase.VMBackedTestCase(methodName='runTest')

Bases: unittest.case.TestCase

A class to encapsulate testing of blivet using block devices.

The basic idea is you create some scratch block devices and then run some test code on them.

disks defines the set of disk images.

_set_up_storage() is where you specify the initial layout of the disks. It will be written to the disk images in set_up_storage().

You then write test methods as usual that use the disk images, which will be cleaned up and removed when each test method finishes.

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.

initialize_disks = True
setUp()

Do any setup required prior to running a test.

set_up_disks()

Create disk image files to build the test’s storage on.

If you are actually creating the disk image files here don’t forget to set the initialize_disks flag so they get a fresh disklabel when clear_partitions gets called from create_storage later.

set_up_storage()

Create a device stack on top of disk images for this test to run on.

This will write the configuration to whatever disk images are defined in set_up_disks.

Module contents