Skip to content

Commit

Permalink
Merge pull request #1615 from mnowaksuse/hostname_inst
Browse files Browse the repository at this point in the history
Hostname in YaST Installer is set properly
  • Loading branch information
okurz committed Aug 2, 2016
2 parents 2e885f9 + aedd068 commit 6585154
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions products/sle/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ sub load_inst_tests() {
}
if (noupdatestep_is_applicable()) {
loadtest "installation/installer_timezone.pm";
# the test should run only in scenarios, where installed
# system is not being tested (e.g. INSTALLONLY etc.)
if (!consolestep_is_applicable()) {
loadtest "installation/hostname_inst.pm";
}
if (!get_var("REMOTE_CONTROLLER")) {
loadtest "installation/logpackages.pm";
}
Expand Down
39 changes: 39 additions & 0 deletions tests/installation/hostname_inst.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SUSE's openQA tests
#
# Copyright © 2016 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

use base "y2logsstep";
use strict;
use warnings;
use testapi;

sub run() {
my $self = shift;

assert_screen "before-package-selection";

select_console('install-shell');

if (my $expected_install_hostname = get_var('EXPECTED_INSTALL_HOSTNAME')) {
# EXPECTED_INSTALL_HOSTNAME contains expected hostname YaST installer
# got from environment (DHCP, 'hostname=' as a kernel cmd line argument
assert_script_run "test \"\$(hostname)\" == $expected_install_hostname";
}
else {
# 'install' is the default hostname if no hostname is get from environment
assert_script_run 'test "$(hostname)" == "install"';
}
save_screenshot;

select_console('installation');

assert_screen "inst-returned-to-yast";
}

1;
# vim: set sw=4 et:
2 changes: 2 additions & 0 deletions variables
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ HDDSIZEGB
HDDVERSION
HTTPPROXY
HW
EXPECTED_INSTALL_HOSTNAME
INSTALLONLY
INSTLANG
IPXE
Expand All @@ -51,6 +52,7 @@ NETBOOT
NFSSERVER
NICEVIDEO
NICMODEL
NICTYPE_USER_OPTIONS
NOAUTOLOGIN
NOIMAGES
NUMDISKS
Expand Down

0 comments on commit 6585154

Please sign in to comment.