lib/y2lan_restart_common.pm

y2lan_restart_common

Library for non-destructive testing using yast2 lan.

initialize_y2lan

 initialize_y2lan();

Initialize yast2 lan. Stop firewalld. Ensure firewalld is stopped. Enable DEBUG. Clear journal.

open_network_settings

 open_network_settings();

Open yast2 lan module, expecting Overview tab and select first device.

Accept warning for Networkmanager controls network device.

close_network_settings

 close_network_settings();

Close network settings checking for return code 0 on serial line.

check_network_status

 check_network_status([$expected_status], [$device]);

Check network status for device, test connection and DNS. Print journal.log on screen if $expected_status is restart.

check_device_state

 check_device_state($args);

Checks state of the device using ip command, receives keys device which contains device name and state which contains expected state of the device.

verify_network_configuration

 verify_network_configuration([$fn], [$expected_status], [$dev_name], [$workaround], [$no_network_check]);

$fn is a reference to the function with the action to be performed.

$dev_name is device name.

$expected_status can be restart, no_restart or reload. If undef is set to no_restart.

$workaround is workaround.

no_network_check means no network check.

Verify network configurations for: device name, network status, workaround or no network check

Check network status $expected_status, $workaround if $no_network_check is defined

validate_etc_hosts_entry

 validate_etc_hosts_entry([$args]);

Validate /etc/hosts entries for ip, fqdn, host.

Run record_soft_failure for bsc#1115644 if $args has not been found in /etc/hosts and print /etc/hosts.

set_network

 set_network([$args]);

Manually configure network settings or set it to DHCP. $args can be static, ip, mask, fqdn

check_etc_hosts_update

 check_etc_hosts_update();

Check update of /etc/hosts. In order to target bugs bsc#1115644 and bsc#1052042, we want to run steps:

handle_Networkmanager_controlled

 handle_Networkmanager_controlled();

Handle Networkmanager controls the network configurations. Confirm if a warning popup for Networkmanager controls networking.

handle_dhcp_popup

 handle_dhcp_popup();

Handle DHCP popup, confirm for DHCP popup.

open_yast2_routing

 open_yast2_routing();

Open yast2 routing

change_ipforward

 change_ipforward([$state], [$should_conflict]);

$state enabled/disabled will used to set the expected needle to match $should_conflict 1 means conflict is expected or 0 otherwise

Open routing module and enable or disable ip_forwarding

open_yast2_lan

 open_yast2_lan();

Open yast2 lan, run handle_dhcp_popup() and install and check firewalld

If network is controlled by Networkmanager, don't change any network settings.

close_yast2_lan

 close_yast2_lan();

Close yast2 lan configuration and check that it is closed successfully

clear_journal_log

 clear_journal_log();

Makes space for better readability of the console and clears journal.log, so that the existing logs will not interfere with the new ones.

wait_for_xterm_to_be_visible

 wait_for_xterm_to_be_visible();

The function waits for the already opened xterm to be visible.

Raises failure in case it is not visible after timeout exceeded.

It is used to be sure, that all the yast2 lan windows are closed, so that all further actions in xterm can be made.

close_xterm

 close_xterm();

The function kills all the instances of xterm terminal to clear desktop for further tests.