tests.dracut_tests package

Submodules

tests.dracut_tests.parse-kickstart_test module

tests.dracut_tests.test_driver_updates module

class tests.dracut_tests.test_driver_updates.DDUtilsTestCase(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_dd_extract(check_output)

dd_extract: call binary with expected arguments

test_dd_list(check_output)

dd_list: returns a list of Driver objects parsed from output

class tests.dracut_tests.test_driver_updates.DeviceInfoTestCase(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_basic(get_disk_labels, check_output)

get_deviceinfo: parses DeviceInfo from blkid etc.

test_shortdev()
class tests.dracut_tests.test_driver_updates.DeviceMenuTestCase(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.

setUp()
test_device_menu(stdout)

device_menu: choosing a number returns that Device

test_device_menu_exit()

device_menu: ‘c’ exits the menu

test_device_menu_refresh()

device_menu: ‘r’ makes the menu refresh

class tests.dracut_tests.test_driver_updates.ExtractDriversTestCase(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_drivers(mock_extract, mock_append, mock_save, *args)

extract_drivers: save repo, write pkglist

test_enhancements(mock_extract, mock_append, mock_save, *args)

extract_drivers: extract selected drivers, don’t save enhancements

test_repo(mock_extract, mock_append, mock_save, *args)

extract_drivers(repos=[...]) extracts all drivers from named repos

class tests.dracut_tests.test_driver_updates.FileTestCaseBase(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.

makefiles(*paths)
setUp()
tearDown()
class tests.dracut_tests.test_driver_updates.FinishedTestCase(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

all_finished: True if all lines from dd_todo are in dd_finished

test_extra_finished()

all_finished: True if dd_finished has more items than dd_todo

test_finish()

finish: mark request finished, and write dd.done if all complete

test_mark_finished()

mark_finished: appends a line to /tmp/dd_finished

class tests.dracut_tests.test_driver_updates.GrabDriverFilesTestCase(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

grab_driver_files: copy drivers into place, return module list

class tests.dracut_tests.test_driver_updates.LoadDriversTestCase(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_basic(call)

load_drivers: runs depmod and modprobes all named modules

class tests.dracut_tests.test_driver_updates.MountTestCase(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_basic(check_call, mkdir)

mount: calls mount(8) to mount a device/image

test_mkdir(check_call, mkdir)

mount: makes mountpoint if needed

test_mount_manager(mock_umount, mock_mount)

mounted: context manager mounts/umounts as expected

test_umount(call)

umount: calls umount(8)

class tests.dracut_tests.test_driver_updates.ProcessDriverDiskTestCase(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.

setUp()
test_basic()

process_driver_disk: mount disk, extract RPMs, grab + load drivers

test_no_drivers()

process_driver_disk: don’t run depmod etc. if no new drivers

test_recursive()

process_driver_disk: recursively process .isos at toplevel

class tests.dracut_tests.test_driver_updates.ProcessDriverRPMTestCase(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.

setUp()
test_basic()

process_driver_rpm: extract RPM, grab + load driver

class tests.dracut_tests.test_driver_updates.SelfTestCase(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

check test helpers

class tests.dracut_tests.test_driver_updates.TestAppendLine(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

append_line: adds a line to the end of an existing file

test_empty()

append_line: create file + append n when needed

class tests.dracut_tests.test_driver_updates.TestCopyFiles(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

copy_file: copy files into destdir, leaving existing contents

test_copy_to_parent()

copy_file: skip files in subdirs of destdir

test_overwrite()

copy_file: overwrite files in destdir if they have the same name

test_samefile()

copy_file: skip files already in destdir

class tests.dracut_tests.test_driver_updates.TestFindRepos(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

find_repos: return RPM dir if a valid repo is found

test_multiple_subdirs()

find_repos: descend multiple subdirs if needed

class tests.dracut_tests.test_driver_updates.TestIterFiles(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

iter_files: iterates over full paths to files under topdir

test_pattern()

iter_files: match filename against glob pattern

class tests.dracut_tests.test_driver_updates.TestMkdirSeq(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

mkdir_seq: first dir ends with 1

test_one_exists()

mkdir_seq: increment number if file exists

class tests.dracut_tests.test_driver_updates.TestMoveFiles(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

move_files: move files to destdir

test_move_to_parent()

move_files: leave files alone if they’re in a subdir of destdir

test_overwrite()

move_files: overwrite files with the same name

test_samefile()

move_files: leave files alone if they’re already in destdir

class tests.dracut_tests.test_driver_updates.TestReadLine(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

read_lines: return [] for empty file

test_missing()

read_lines: return [] for missing file

test_readline_and_append_line()

read_lines: returns items as passed to append_line

test_readlines()

read_lines: returns a list of lines without trailing newlines

class tests.dracut_tests.test_driver_updates.TestSaveRepo(methodName='runTest')

Bases: tests.dracut_tests.test_driver_updates.FileTestCaseBase

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

save_repo: copies a directory to /run/install/DD-X

tests.dracut_tests.test_driver_updates.dd_list_output(driver)
tests.dracut_tests.test_driver_updates.makedir(path)
tests.dracut_tests.test_driver_updates.makefile(path)
tests.dracut_tests.test_driver_updates.makefiles(*paths)
tests.dracut_tests.test_driver_updates.makerepo(topdir, desc=None)
tests.dracut_tests.test_driver_updates.touch(path)

Module contents