lib/repo_tools.pm

repo_tools

Tools for repositories used by openQA:

add_qa_head_repo

add_qa_head_repo();

Helper to add QA:HEAD repository repository (usually from IBS). This repository *is* mandatory.

add_qa_web_repo

add_qa_web_repo();

Helper to add QA web repository repository. This repository is *not* mandatory.

get_installed_patterns

get_installed_patterns();

Here zypper uses XML as output format for more precise parsing (by using '-x' command parameter). Then the names of patterns are parsed from the XML.

Returns array containing all installed patterns in the system.

get_repo_var_name

get_repo_var_name($repo_name);

This takes something like "MODULE_BASESYSTEM_SOURCE" as parameter $repo_name and returns "REPO_SLE15_SP1_MODULE_BASESYSTEM_SOURCE" when being called on SLE15-SP1.

smt_wizard

smt_wizard();

Run smt wizard workflow and to get repository synced with smt server

get_repo_var_name

get_repo_var_name();

Verify smt mirror function and mirror a tiny released repo from SCC. Hardcode it as SLES12-SP3-Installer-Updates.

type_password_twice

type_password_twice();

Type password, TAB, password, ALT+o. This is for use within YaST.

rmt_wazard

rmt_wizard();

Install Repository Mirroring Tool and mariadb database

rmt_sync

rmt_sync();

Function to sync rmt server

rmt_enable_pro

rmt_enable_pro();

Function to enable products

rmt_mirror_repo

rmt_mirror_repo();

Function to mirror the enabled repository

rmt_list_pro

rmt_list_pro();

Function to list products

rmt_import_data

rmt_import_data($datafile);

RMT server import data from one folder which stored RMT export data about available repositories and the mirrored packages $datafile is repository source.

rmt_export_data

rmt_export_data();

RMT server export data about available repositories and the mirrored packages

prepare_source_repo

prepare_source_repo($repo_name);

Prepare SLES or OSS souce repositories

disable_source_repo

disable_source_repo();

Disable source repositories

generate_version

generate_version($separator);

Generate SLE or openSUSE versions. $separator is separator used for version number, it will be default to _ if omitted. Example: SLES-12-4, openSUSE_Leap

validate_repo_properties

validate_repo_properties($args);

Validates that repo with given search criteria (uri, alias, number) has other properties mathing the expectations. If one of the keys is not provided, that field will NOT be validated. $args should have following keys defined: - Alias: repository alias, optional - Autorefresh: repository Autorefresh property, optional - Enabled: repository Enabled property, optional - Filter: repository search criteria (alias, uri, number), uri is used if not defined - Name: repository name, optional - URI: repository uri, used as a search criteria if no Filter provided.

parse_repo_data

parse_repo_data($repo_identifier);

Parses the output of 'zypper lr $repo_identifier' command (detailed information about specific repository) and returns it as Hash reference.

$repo_identifier can be either alias, name, number from simple zypper lr, or URI. Please, search for 'repos (lr)' on 'https://en.opensuse.org/SDB:Zypper_manual' page for more details of the command usage and its output.

Returns Hash reference with all the parsed properties and their values, for example: {Alias => 'repo-oss', Name => 'openSUSE-Tumbleweed-Oss', Enabled => 'Yes', ...}

verify_software

verify_software(%args);

Validates that package or pattern is installed, or not installed and/or if package is available in the given repo. returns string with error or empty string in case of matching expectations. %args should have following keys defined: - name: package or pattern name - installed: if set to true, validate that package or pattern is installed - pattern: set to true if is pattern, otherwise validating package - available: if set to true, validate that package or pattern is available in the list of packages with given search criteria, otherwise expect zypper command to fail - repo: Optional, name of the repo where the package should be available. Check is triggered only if available is set to true

Verify that install repo mirror corresponds to the one expected one.