lib/version_utils.pm

VERSION_UTILS

SYNOPSIS

Contains all the functions related to version checking

is_jeos

Returns true if called on jeos

is_vmware

Returns true if called on vmware

is_krypton_argon

Returns true if called on krypton or argon

is_gnome_next

Returns true if called on Gnome-Live

is_installcheck

Returns true if 'INSTALLCHECK' is set

is_rescuesystem

Returns true if called on a rescue system

is_virtualization_server

Returns true if called on a virutalization server

is_livecd

Returns true if executed on a live cd

check_version

Usage: check_version('>15.0', get_var('VERSION'), '\d{2}') Query format: [= > < >= <=] version [+] (Example: <=12-sp3 =12-sp1 <4.0 >=15 3.0+) Check agains: product version to check against - probably get_var('VERSION') Regex format: checks query version format (Example: /\d{2}\.\d/)#

is_caasp

Check if distribution is CaaSP or MicroOS with optional filter: Media type: DVD (iso) or VMX (all disk images) Version: 1.0 | 2.0 | 2.0+ Flavor: DVD | MS-HyperV | XEN | KVM-and-Xen | ..

is_tumbleweed

Returns true if called on tumbleweed

is_leap

Check if distribution is Leap with optional filter for: Version: <=42.2 =15.0 >15.0 >=42.3 15.0+

is_opensuse

Returns true if called on opensuse

is_sle

Check if distribution is SLE with optional filter for: Version: <=12-sp3 =12-sp1 >11-sp1 >=15 15+ (>=15 and 15+ are equivalent)

is_transactional

Returns true if called on a transactional server

is_sles4migration

Returns true if called in a migration scenario

is_sles4sap

Returns true if called in a SAP test

is_sles4sap_standard

Returns true if called in an SAP standard test

is_rt

Returns true if called on a real time system

is_hpc

Returns true if called in an HPC test

is_released

Returns true if called on a released build

is_staging

Returns true if called in staging

is_storage_ng

Returns true if storage_ng is used

is_upgrade

Returns true in upgrade scenarios

is_sle12_hdd_in_upgrade

Returns true if called in SLES12 upgrade scenario

is_desktop_installed

Returns true if a desktop is installed

is_system_upgrading

#TODO this should be documented

is_pre15

Returns if system is older than SLE or Leap 15

is_aarch64_uefi_boot_hdd

Returns true if system is aarch64 with uefi and shall boot an hdd image

is_server

Returns true if executed on a server pattern, SLES4SAP or SLES4MIGRATION

install_this_version

Returns true if INSTALL_TO_OTHERS is not set

install_to_other_at_least

Check the real version of the test machine is at least some value, rather than the VERSION variable It is for version checking for tests with variable "INSTALL_TO_OTHERS".

is_using_system_role

system_role selection during installation was added as a new feature since sles12sp2 so system_role.pm should be loaded for all tests that actually install to versions over sles12sp2 no matter with or without INSTALL_TO_OTHERS tag On SLE 15 SP0 we unconditionally have system roles screen SLE 15 SP1: * Has system roles only if more than one is available, meaning either registered or with all packages DVD; * RT Product has only one (minimal) role. On microos, leap 15.1+, TW we have it instead of desktop selection screen

is_using_system_role_first_flow

On leap 15.0 we have desktop selection first, and everywhere, where we have system roles

requires_role_selection

If there is only one role, there is no selection offered

has_product_selection

    has_product_selection;

Identify cases when Installer has to show Product Selection screen.

Starting with SLE 15, all products are distributed using one medium, and Product to install has to be chosen explicitly.

Though, there are some exceptions (like s390x on Sle15 SP0) when there is only one Product, so that License agreement is shown directly, skipping the Product selection step. Also, Product Selection screen is not shown during upgrade. on SLE 15+, zVM preparation test shouldn't show Product Selection screen.

Returns true (1) if Product Selection step has to be shown for the certain configuration, otherwise returns false (0).

has_license_on_welcome_screen

    has_license_on_welcome_screen;

Identify cases when License Agreement has to be shown on Welcome screen and should be accepted there.

Returns true (1) if License Agreement has to be shown on Welcome screen for the certain configuration, otherwise returns false (0).

has_license_to_accept

Returns true if the system has a license that needs to be accepted

uses_qa_net_hardware

Returns true if the SUT uses qa net hardware

get_sles_release

Get SLE release version and service spack info from any running sles os without any dependencies It parses the info from /etc/os-release file, which can reside in any physical host or virtual machine The file can also be placed anywhere as long as it can be reached somehow by its absolute file path, which should be passed in as the second argument os_release_file, for example, "/etc/os-release" At the same time, connection method to the entity in which the file reside should be passed in as the firt argument go_to_target, for example, "ssh root at name or ip address" or "way to download the file" For use only on locahost, no argument needs to be specified

is_public_cloud

Returns true if PUBLIC_CLOUD is set to 1