Skip to content

Commit

Permalink
Merge pull request #5150 from Soulofdestiny/s390kvm/dhcp
Browse files Browse the repository at this point in the history
s390x-kvm: Drop static ips due to dhcp setup
  • Loading branch information
okurz committed Jun 11, 2018
2 parents 5adc569 + 9026035 commit 47f4e91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 69 deletions.
3 changes: 2 additions & 1 deletion lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,9 @@ sub zkvm_add_interface {
# temporary use of hardcoded '+4' to workaround messed up network setup on z/KVM
my $vtap = $svirt->instance + 4;
my $netdev = get_required_var('NETDEV');
my $mac = get_required_var('VIRSH_MAC');
# direct access to the tap device, use of $vtap temporarily
$svirt->add_interface({type => 'direct', source => {dev => $netdev, mode => 'bridge'}, target => {dev => 'macvtap' . $vtap}});
$svirt->add_interface({type => 'direct', source => {dev => $netdev, mode => 'bridge'}, target => {dev => 'macvtap' . $vtap}, mac => {address => $mac}});
}

# On Hyper-V and Xen PV we need to add special framebuffer provisions
Expand Down
4 changes: 0 additions & 4 deletions lib/main_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -922,10 +922,6 @@ sub load_inst_tests {
if (get_var("UEFI") && get_var("SECUREBOOT")) {
loadtest "installation/secure_boot";
}
# for upgrades on s390 zKVM we need to change the static ip adress of the image to reboot properly
if (check_var('BACKEND', 'svirt') && check_var('ARCH', 's390x') && get_var('UPGRADE')) {
loadtest "installation/set_static_ip";
}
if (installyaststep_is_applicable()) {
loadtest "installation/installation_overview";
# On Xen PV we don't have GRUB on VNC
Expand Down
37 changes: 8 additions & 29 deletions lib/opensusebasetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -273,33 +273,6 @@ sub handle_uefi_boot_disk_workaround {
wait_screen_change { send_key 'ret' };
}

=head2 rewrite_static_svirt_network_configuration
Rewrite the static network configuration within a SUT over the svirt console
based on the worker specific configuration to allow reuse of images created on
one host and booted on another host. Can also be used for debugging in case of
consoles relying on remote connections to within the SUT being blocked by
malfunctioning network or services within the SUT.
Relies on the C<$pty> variable set in the remote svirt shell by C<utils::save_svirt_pty>.
Also see poo#18016 for details.
=cut
sub rewrite_static_svirt_network_configuration {
my ($self) = @_;
type_line_svirt "root", expect => 'Password';
type_line_svirt "$testapi::password";
my $virsh_guest = get_required_var('VIRSH_GUEST');
type_line_svirt "sed -i \"\\\"s:IPADDR='[0-9.]*/\\([0-9]*\\)':IPADDR='$virsh_guest/\\1':\\\" /etc/sysconfig/network/ifcfg-\*\"", expect => '#';
type_string "# output of current network configuration for debugging\n";
type_line_svirt "\"cat /etc/sysconfig/network/ifcfg-\*\"", expect => '#';
type_line_svirt "systemctl restart network", expect => '#';
type_line_svirt "systemctl is-active network", expect => 'active';
type_line_svirt 'systemctl is-active sshd', expect => 'active';
# make sure we can reach the SSH server in the SUT
type_string "for i in {1..7}; do (nc -z $virsh_guest 22 && break) || (echo \"retry: \$i\" ; sleep 5; false); done\n";
}

=head2 wait_boot
wait_boot([bootloader_time => $bootloader_time] [, textmode => $textmode] [,ready_time => $ready_time] [,in_grub => $in_grub] [, nologin => $nologin] [, forcenologin => $forcenologin]);
Expand Down Expand Up @@ -351,13 +324,19 @@ sub wait_boot {
}
else {
my $worker_hostname = get_required_var('WORKER_HOSTNAME');
my $virsh_guest = get_required_var('VIRSH_GUEST');
workaround_type_encrypted_passphrase if get_var('S390_ZKVM');
wait_serial('GNU GRUB') || diag 'Could not find GRUB screen, continuing nevertheless, trying to boot';
select_console('svirt');
save_svirt_pty;
type_line_svirt '', expect => $login_ready, timeout => $ready_time + 100, fail_message => 'Could not find login prompt';
$self->rewrite_static_svirt_network_configuration();
type_line_svirt "systemctl is-active sshd", expect => 'active';
type_line_svirt "root", expect => 'Password';
type_line_svirt "$testapi::password";
type_line_svirt "systemctl is-active network", expect => 'active';
type_line_svirt 'systemctl is-active sshd', expect => 'active';
# make sure we can reach the SSH server in the SUT
type_string "for i in {1..7}; do nc -zv $virsh_guest 22 && break || (echo \"retry: \$i\" ; sleep 5; false); done;\n";
save_screenshot;
}

# on z/(K)VM we need to re-select a console
Expand Down
35 changes: 0 additions & 35 deletions tests/installation/set_static_ip.pm

This file was deleted.

0 comments on commit 47f4e91

Please sign in to comment.