lib/virt_autotest/utils.pm

check_port_state

check_port_state($dst_machine, $dst_port, $retries, $delay)

Check whether given port is open on remote machine. This subroutine accepts four arguments, dst_machine, dst_port, retries and delay, which are fqdn or ip addr of remote machine, port on remote machine, the number of retries and delay value respectively. Default retries is 1 and default delay is 30 seconds. dst_machine and dst_port have no default value and test will die if the subroutine is called without being passed value to dst_machine or dst_port.The subroutine will return 1 if the given port is open on the specified remote machine, otherwise it will return 0.

is_registered_system

is_registered_system(dst_machine => $machine)

Detect whether system under test is registered. If [dst_machine] is not given, the default value 'localhost' will be used. Using "transactional-update register" if 1 is given to [usetrup], otherwise keeping using SUSEConnect.

do_system_registration

do_system_registration(dst_machine => $machine, activate => 1/0)

Register/de-register system according to argument [activate]. If argument [dst_machine] is not given, the default value 'localhost' will be used. Using "transactional-update register" if 1 is given to [usetrup], otherwise keeping using SUSEConnect.

check_system_registration

check_system_registration(dst_machine => $machine)

Check current system registration status. If argument [dst_machine] is not given, the default value 'localhost' will be used. Using "transactional-update register" if 1 is given to [usetrup], otherwise keeping using SUSEConnect.

subscribe_extensions_and_modules

subscribe_extensions_and_modules(dst_machine => $machine, activate => 1/0, reg_exts => $exts)

Any available extensions and modules listed out by SUSEConnect --list-extensions that do not require additional regcode can be subscribe directly by using command SUSEConnect -p [extension or module]. Subscription is to be performed on localhost by default if argument dst_machine is not given any other address, and successful access to dst_machine via ssh should be guaranteed in advance if dst_machine points to a remote machine. Deactivation is also supported if argument activate is given 0 explicitly. Multiple extensions or modules can be passed in as a single string separated by space to argument reg_exts to be subscribed one by one. Using "transactional-update register" for newer OS like SLE Micro 6.0, which is the more preferred way to do registration.

is_sev_es_guest

is_sev_es_guest($guest_name)

Check whether a guest is sev-es, sev only or not sev/sev-es guest by searching whether sev-es or sev word is available in its name. The only argument for the subroutine is guest_name. It returns sev-es or sev if either is found in guest name, otherwise it returns 0.

get_guest_regcode

get_guest_regcode(separator => 'string separator')

Pass guest registration code in dynamically via GUEST_SCC_REGCODE and GUEST_SCC_REGCODE_LTSS. If they are not provided, SCC_REGCODE and SCC_REGCODE_LTSS_15 will be used. If there are multiple guest patterns , their corresponding registration codes should also be specified in the same order and separated by separators like pipe, comma or others. Empty value is allowed. For example, regcode_guest1|regcode_guest2|| regcode_guest4, because regcode_guest3 is emety, empty value is passed in to preserve order. For multiple guest patterns, an empty registration code for specific guest pattern will not be filled out by any default value and at the same time this means registration code is not needed for it at all. This subroutine has one argument separator and returns generated registration codes joined together by specified separator.