taucmdr.cf.software.tests.test_installation module

Test functions.

Functions used for unit tests of installation.py.

class taucmdr.cf.software.tests.test_installation.InstallationEnvironmentTest(methodName='runTest')[source]

Bases: TestCase

Tests for the compile-time and runtime environments an installation contributes.

_LIBRARY_PATH = 'LD_LIBRARY_PATH'
_classSetupFailed = False
_class_cleanups = []
_widget_with_dirs()[source]
setUp()[source]

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

test_bin_and_lib_paths_prepended()[source]

PATH and the loader path start with the installation’s directories.

test_missing_directories_leave_environment_alone()[source]

An installation without bin or lib directories changes nothing.

test_paths_created_when_absent()[source]

Without a PATH or loader path in the environment the installation’s directories become them.

class taucmdr.cf.software.tests.test_installation.InstallationSourceTest(methodName='runTest')[source]

Bases: TestCase

Tests for how Installation resolves the package source given at construction.

_classSetupFailed = False
_class_cleanups = []
test_arch_and_os_specific_repos()[source]

Repositories are looked up by target architecture, then OS, falling back to the defaults.

test_archive_path_is_managed()[source]

A path that is not a directory (an archive) still has to be installed.

test_download_keyword_is_case_insensitive()[source]

‘DOWNLOAD’ works like ‘download’.

test_download_single_repo_string()[source]

A single repository string is a source with no fallbacks.

test_download_uses_repo_list()[source]

‘download’ takes the first repository and keeps the rest as fallbacks.

test_download_without_repos_rejected()[source]

An empty repository list cannot be downloaded from.

test_existing_directory_is_unmanaged()[source]

A directory is an existing installation: unmanaged, and used as the install prefix.

test_failed_download_names_source()[source]

A source that can’t be acquired is named in the error and its hint, whatever kind of source it is.

class taucmdr.cf.software.tests.test_installation.InstallationVerifyTest(methodName='runTest')[source]

Bases: TestCase

Tests for verify() against a fabricated installation prefix.

_classSetupFailed = False
_class_cleanups = []
_touch(*parts, executable=False)[source]
_widget(commands=(), libraries=(), headers=())[source]
setUp()[source]

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

test_complete_installation_verifies()[source]

Executable commands, libraries, and headers in the usual places pass.

test_library_in_lib64_accepted()[source]

Distributions that install into lib64 (e.g. SuSE) pass.

test_missing_command_rejected()[source]

A missing command fails verification.

test_missing_header_rejected()[source]

A missing header fails verification.

test_missing_library_rejected()[source]

A library missing from lib and lib64 fails verification.

test_missing_prefix_rejected()[source]

The prefix itself must exist.

test_no_lists_means_nothing_to_verify()[source]

Packages without commands, libraries, or headers verify nothing beyond the prefix.

test_non_executable_command_rejected()[source]

A command that exists but is not executable fails verification.

class taucmdr.cf.software.tests.test_installation.ParallelMakeFlagsTest(methodName='runTest')[source]

Bases: TestCase

Tests for parallel_make_flags.

_DEFAULT = ['-j', '3']
_classSetupFailed = False
_class_cleanups = []
test_default_leaves_one_core_free()[source]

Without an override, all but one core are used.

test_environment_override()[source]

__TAUCMDR_MAX_MAKE_JOBS__ sets the job count.

test_explicit_count()[source]

An explicit job count is used as-is.

test_invalid_environment_override()[source]

A non-positive count is an error; a non-numeric one falls back to the default.

taucmdr.cf.software.tests.test_installation._widget(src, repos=None, commands=None, libraries=None, headers=None, arch=<taucmdr.cf.platforms.Architecture object>, target_os=<taucmdr.cf.platforms.OperatingSystem object>)[source]

Build a bare Installation for a package named ‘widget’ without touching any storage level.