diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index 59f38bac..a6b0d6cc 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -72,8 +72,13 @@ sub root_console { } sub select_disks { - my ($self, $disks) = @_; - $disks ||= 1; + my $self = shift; + my %args = ( + disks => 1, + iscsi => {}, + @_ + ); + my %iscsi = %{$args{iscsi}}; # Anaconda hub assert_screen "anaconda_main_hub", 300; # # Damn animation delay can cause bad clicks here too - wait for it @@ -83,22 +88,44 @@ sub select_disks { if (get_var('NUMDISKS') > 1) { # Multi-disk case. Select however many disks the test needs. If # $disks is 0, this will do nothing, and 0 disks will be selected. - for my $n (1 .. $disks) { + for my $n (1 .. $args{disks}) { assert_and_click "anaconda_install_destination_select_disk_$n"; } } else { # Single disk case. - if ($disks == 0) { + if ($args{disks} == 0) { # Clicking will *de*-select. assert_and_click "anaconda_install_destination_select_disk_1"; } - elsif ($disks > 1) { - die "Only one disk is connected! Cannot select $disks disks."; + elsif ($args{disks} > 1) { + die "Only one disk is connected! Cannot select $args{disks} disks."; } # For exactly 1 disk, we don't need to do anything. } + # Handle network disks. + if (%iscsi) { + assert_and_click "anaconda_install_destination_add_network_disk"; + foreach my $target (keys %iscsi) { + my $ip = $iscsi{$target}; + assert_and_click "anaconda_install_destination_add_iscsi_target"; + type_string $ip; + wait_still_screen 2; + send_key "tab"; + type_string $target; + wait_still_screen 2; + # start discovery + send_key "tab"; + send_key "tab"; + send_key "tab"; + send_key "ret"; + assert_and_click "anaconda_install_destination_target_login"; + assert_and_click "anaconda_install_destination_select_target"; + } + assert_and_click "anaconda_spoke_done"; + } + # If this is a custom partitioning test, select custom partitioning. if (get_var('PARTITIONING') =~ /^custom_/) { assert_and_click "anaconda_manual_partitioning"; @@ -137,6 +164,17 @@ sub custom_change_fs { assert_and_click "anaconda_part_update_settings"; } +sub custom_change_device { + my ($self, $part, $devices) = @_; + assert_and_click "anaconda_part_select_$part"; + assert_and_click "anaconda_part_device_modify"; + foreach my $device (split(/ /, $devices)) { + assert_and_click "anaconda_part_device_${device}"; + } + assert_and_click "anaconda_part_device_select"; + assert_and_click "anaconda_part_update_settings"; +} + sub custom_delete_part { my ($self, $part) = @_; return if not $part; diff --git a/lib/fedorabase.pm b/lib/fedorabase.pm index 5cf8d9c4..029ecf30 100644 --- a/lib/fedorabase.pm +++ b/lib/fedorabase.pm @@ -212,6 +212,18 @@ sub console_switch_layout { } } +sub get_host_dns { + # get DNS server addresses from the host + my @forwards; + open(FH, '<', "/etc/resolv.conf"); + while () { + if ($_ =~ m/^nameserver +(.+)/) { + push @forwards, $1; + } + } + return @forwards; +} + 1; # vim: set sw=4 et: diff --git a/main.pm b/main.pm index 4e72cfc3..0dc98883 100644 --- a/main.pm +++ b/main.pm @@ -119,6 +119,11 @@ sub load_install_tests() { # if this is a kickstart install, that's all folks return if (get_var("KICKSTART")); + ## Networking + if (get_var('ANACONDA_STATIC')) { + autotest::loadtest "tests/_network_static.pm"; + } + ## Installation source if (get_var('MIRRORLIST_GRAPHICAL') || get_var("REPOSITORY_GRAPHICAL")){ autotest::loadtest "tests/install_source_graphical.pm"; @@ -182,8 +187,9 @@ sub load_postinstall_tests() { # of PARTITIONING my $storagepost = ''; if (get_var('PARTITIONING')) { - my $loc = "tests/disk_".get_var('PARTITIONING')."_postinstall.pm"; - $storagepost = $loc if (-e $loc); + my $casedir = get_var("CASEDIR"); + my $loc = "tests/disk_" . get_var('PARTITIONING') . "_postinstall.pm"; + $storagepost = $loc if (-e "$casedir/$loc"); } autotest::loadtest $storagepost if ($storagepost); @@ -216,8 +222,8 @@ if (get_var("ENTRYPOINT")) { elsif (get_var("UPGRADE")) { load_upgrade_tests; } -elsif (!get_var("START_AFTER_TEST")) { - # for now we can assume START_AFTER_TEST means this test picks up +elsif (!get_var("BOOTFROM")) { + # for now we can assume BOOTFROM means this test picks up # after an install, so we skip to post-install load_install_tests; } diff --git a/needles/anaconda/install_destination/add_iscsi_target.json b/needles/anaconda/install_destination/add_iscsi_target.json new file mode 100644 index 00000000..f8fbcfd7 --- /dev/null +++ b/needles/anaconda/install_destination/add_iscsi_target.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "anaconda_install_destination_add_iscsi_target" + ], + "area": [ + { + "xpos": 569, + "ypos": 690, + "width": 117, + "height": 16, + "type": "match" + } + ], + "properties": [] +} diff --git a/needles/anaconda/install_destination/add_iscsi_target.png b/needles/anaconda/install_destination/add_iscsi_target.png new file mode 100644 index 00000000..73511bdf Binary files /dev/null and b/needles/anaconda/install_destination/add_iscsi_target.png differ diff --git a/needles/anaconda/install_destination/add_network_disk.json b/needles/anaconda/install_destination/add_network_disk.json new file mode 100644 index 00000000..f8e68055 --- /dev/null +++ b/needles/anaconda/install_destination/add_network_disk.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 44, + "ypos": 369, + "width": 65, + "height": 17, + "type": "match" + } + ], + "tags": [ + "anaconda_install_destination_add_network_disk" + ] +} diff --git a/needles/anaconda/install_destination/add_network_disk.png b/needles/anaconda/install_destination/add_network_disk.png new file mode 100644 index 00000000..fd8a2679 Binary files /dev/null and b/needles/anaconda/install_destination/add_network_disk.png differ diff --git a/needles/anaconda/install_destination/select_target.json b/needles/anaconda/install_destination/select_target.json new file mode 100644 index 00000000..65b8b52c --- /dev/null +++ b/needles/anaconda/install_destination/select_target.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "xpos": 19, + "ypos": 239, + "width": 18, + "height": 17, + "type": "match" + } + ], + "tags": [ + "ENV-DISTRI-fedora", + "anaconda_install_destination_select_target" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/anaconda/install_destination/select_target.png b/needles/anaconda/install_destination/select_target.png new file mode 100644 index 00000000..5ff7eb05 Binary files /dev/null and b/needles/anaconda/install_destination/select_target.png differ diff --git a/needles/anaconda/install_destination/target_login.json b/needles/anaconda/install_destination/target_login.json new file mode 100644 index 00000000..002c2946 --- /dev/null +++ b/needles/anaconda/install_destination/target_login.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "anaconda_install_destination_target_login" + ], + "area": [ + { + "xpos": 747, + "ypos": 557, + "width": 43, + "height": 18, + "type": "match" + } + ], + "properties": [] +} diff --git a/needles/anaconda/install_destination/target_login.png b/needles/anaconda/install_destination/target_login.png new file mode 100644 index 00000000..db1ea4d8 Binary files /dev/null and b/needles/anaconda/install_destination/target_login.png differ diff --git a/needles/anaconda/main_hub/network_host_name.json b/needles/anaconda/main_hub/network_host_name.json new file mode 100644 index 00000000..d280d4fc --- /dev/null +++ b/needles/anaconda/main_hub/network_host_name.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 613, + "ypos": 459, + "width": 76, + "height": 72, + "type": "match" + } + ], + "tags": [ + "anaconda_main_hub_network_host_name" + ] +} \ No newline at end of file diff --git a/needles/anaconda/main_hub/network_host_name.png b/needles/anaconda/main_hub/network_host_name.png new file mode 100644 index 00000000..600d3763 Binary files /dev/null and b/needles/anaconda/main_hub/network_host_name.png differ diff --git a/needles/anaconda/network/address_add.json b/needles/anaconda/network/address_add.json new file mode 100644 index 00000000..6609c186 --- /dev/null +++ b/needles/anaconda/network/address_add.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 773, + "ypos": 332, + "width": 35, + "height": 18, + "type": "match" + } + ], + "tags": [ + "anaconda_network_address_add" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/anaconda/network/address_add.png b/needles/anaconda/network/address_add.png new file mode 100644 index 00000000..9d24d057 Binary files /dev/null and b/needles/anaconda/network/address_add.png differ diff --git a/needles/anaconda/network/configure.json b/needles/anaconda/network/configure.json new file mode 100644 index 00000000..a85095aa --- /dev/null +++ b/needles/anaconda/network/configure.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "anaconda_network_configure" + ], + "area": [ + { + "xpos": 901, + "ypos": 618, + "width": 74, + "height": 19, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/anaconda/network/configure.png b/needles/anaconda/network/configure.png new file mode 100644 index 00000000..ce38ac3e Binary files /dev/null and b/needles/anaconda/network/configure.png differ diff --git a/needles/anaconda/network/connected.json b/needles/anaconda/network/connected.json new file mode 100644 index 00000000..851fc5fd --- /dev/null +++ b/needles/anaconda/network/connected.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 578, + "ypos": 145, + "width": 68, + "height": 19, + "type": "match" + } + ], + "tags": [ + "anaconda_network_connected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/network/connected.png b/needles/anaconda/network/connected.png new file mode 100644 index 00000000..699ef544 Binary files /dev/null and b/needles/anaconda/network/connected.png differ diff --git a/needles/anaconda/network/ipv4.json b/needles/anaconda/network/ipv4.json new file mode 100644 index 00000000..2a126116 --- /dev/null +++ b/needles/anaconda/network/ipv4.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "anaconda_network_ipv4" + ], + "area": [ + { + "xpos": 598, + "ypos": 213, + "width": 101, + "height": 17, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/anaconda/network/ipv4.png b/needles/anaconda/network/ipv4.png new file mode 100644 index 00000000..430417ab Binary files /dev/null and b/needles/anaconda/network/ipv4.png differ diff --git a/needles/anaconda/network/method.json b/needles/anaconda/network/method.json new file mode 100644 index 00000000..94a9a8fa --- /dev/null +++ b/needles/anaconda/network/method.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "anaconda_network_method" + ], + "area": [ + { + "xpos": 484, + "ypos": 262, + "width": 342, + "height": 15, + "type": "match" + } + ] +} diff --git a/needles/anaconda/network/method.png b/needles/anaconda/network/method.png new file mode 100644 index 00000000..9fc54d6e Binary files /dev/null and b/needles/anaconda/network/method.png differ diff --git a/needles/anaconda/network/method_manual.json b/needles/anaconda/network/method_manual.json new file mode 100644 index 00000000..99dd2d72 --- /dev/null +++ b/needles/anaconda/network/method_manual.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "anaconda_network_method_manual" + ], + "area": [ + { + "xpos": 269, + "ypos": 315, + "width": 52, + "height": 16, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/anaconda/network/method_manual.png b/needles/anaconda/network/method_manual.png new file mode 100644 index 00000000..5ef7a157 Binary files /dev/null and b/needles/anaconda/network/method_manual.png differ diff --git a/needles/anaconda/partitioning/device_modify.json b/needles/anaconda/partitioning/device_modify.json new file mode 100644 index 00000000..acb0fae2 --- /dev/null +++ b/needles/anaconda/partitioning/device_modify.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "anaconda_part_device_modify" + ], + "area": [ + { + "xpos": 664, + "ypos": 185, + "width": 55, + "height": 20, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/device_modify.png b/needles/anaconda/partitioning/device_modify.png new file mode 100644 index 00000000..1eeec1b7 Binary files /dev/null and b/needles/anaconda/partitioning/device_modify.png differ diff --git a/needles/anaconda/partitioning/device_sda_selected.json b/needles/anaconda/partitioning/device_sda_selected.json new file mode 100644 index 00000000..8f4504c3 --- /dev/null +++ b/needles/anaconda/partitioning/device_sda_selected.json @@ -0,0 +1,16 @@ +{ + "tags": [ + "anaconda_part_device_sda", + "anaconda_part_device_sda_selected" + ], + "area": [ + { + "xpos": 644, + "ypos": 342, + "width": 41, + "height": 13, + "type": "match" + } + ], + "properties": [] +} diff --git a/needles/anaconda/partitioning/device_sda_selected.png b/needles/anaconda/partitioning/device_sda_selected.png new file mode 100644 index 00000000..edef42cd Binary files /dev/null and b/needles/anaconda/partitioning/device_sda_selected.png differ diff --git a/needles/anaconda/partitioning/device_select.json b/needles/anaconda/partitioning/device_select.json new file mode 100644 index 00000000..066d3f99 --- /dev/null +++ b/needles/anaconda/partitioning/device_select.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "anaconda_part_device_select" + ], + "area": [ + { + "xpos": 713, + "ypos": 476, + "width": 46, + "height": 18, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/device_select.png b/needles/anaconda/partitioning/device_select.png new file mode 100644 index 00000000..953fd478 Binary files /dev/null and b/needles/anaconda/partitioning/device_select.png differ diff --git a/templates b/templates index 61f2400f..dfb0b1e0 100755 --- a/templates +++ b/templates @@ -358,6 +358,17 @@ }, test_suite => { name => "realmd_join_cockpit" }, }, + { + machine => { name => "64bit" }, + prio => 10, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "support_server" }, + }, { machine => { name => "64bit" }, prio => 20, @@ -567,6 +578,17 @@ }, test_suite => { name => "install_no_swap" }, }, + { + machine => { name => "64bit" }, + prio => 40, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "install_iscsi" }, + }, { machine => { name => "64bit" }, prio => 50, @@ -1259,6 +1281,20 @@ } ], TestSuites => [ + { + name => "support_server", + settings => [ + { key => "NUMDISKS", value => "2" }, + { key => "HDD_1", value => "disk_f%CURRREL%_support_x86_64.img" }, + { key => "POSTINSTALL", value => "_support_server" }, + { key => "USER_LOGIN", value => "false" }, + { key => "ROOT_PASSWORD", value => "weakpassword" }, + { key => "BOOTFROM", value => "c" }, + { key => "NICTYPE", value => "tap" }, + { key => "WORKER_CLASS", value => "tap" }, + { key => "GRUB_POSTINSTALL", value => "net.ifnames=0 biosdevname=0" }, + ], + }, { name => "install_default", settings => [ @@ -1587,6 +1623,18 @@ { key => "ROOT_PASSWORD", value => "weakpassword" }, ], }, + { + name => "install_iscsi", + settings => [ + { key => "PARTITIONING", value => "custom_iscsi" }, + { key => "ANACONDA_STATIC", value => "10.0.2.111" }, + { key => "ROOT_PASSWORD", value => "weakpassword" }, + { key => "PARALLEL_WITH", value => "support_server" }, + { key => "INSTALL_UNLOCK", value => "support_ready" }, + { key => "NICTYPE", value => "tap" }, + { key => "WORKER_CLASS", value => "tap" }, + ], + }, { name => "install_package_set_kde", settings => [ diff --git a/tests/_network_static.pm b/tests/_network_static.pm new file mode 100644 index 00000000..e83f3d5e --- /dev/null +++ b/tests/_network_static.pm @@ -0,0 +1,52 @@ +use base "anacondatest"; +use strict; +use testapi; + +sub run { + my $self = shift; + assert_and_click "anaconda_main_hub_network_host_name"; + assert_and_click "anaconda_network_configure"; + assert_and_click "anaconda_network_ipv4"; + assert_and_click "anaconda_network_method"; + assert_and_click "anaconda_network_method_manual"; + assert_and_click "anaconda_network_address_add"; + type_string get_var('ANACONDA_STATIC'); + wait_still_screen 2; + send_key "tab"; + # netmask is automatically set + send_key "tab"; + # assume gateway + wait_still_screen 2; + type_string "10.0.2.2"; + wait_still_screen 2; + send_key "ret"; + # move to DNS servers + send_key "tab"; + send_key "tab"; + send_key "tab"; + wait_still_screen 2; + # set DNS from host + type_string join(',', $self->get_host_dns()); + send_key "tab"; + send_key "tab"; + send_key "tab"; + send_key "tab"; + send_key "tab"; + send_key "ret"; + # can take a bit of time as it seems to wait for all the pending + # DHCP requests to time out before applying the static config + assert_screen "anaconda_network_connected", 90; + assert_and_click "anaconda_spoke_done"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/_support_server_postinstall.pm b/tests/_support_server_postinstall.pm new file mode 100644 index 00000000..d06af0b1 --- /dev/null +++ b/tests/_support_server_postinstall.pm @@ -0,0 +1,37 @@ +use base "installedtest"; +use strict; +use testapi; +use lockapi; +use mmapi; + +sub run { + my $self=shift; + # clone host's /etc/hosts (for phx2 internal routing to work) + # must come *before* setup_tap_static or else it would overwrite + # its changes + $self->clone_host_file("/etc/hosts"); + # set up networking + $self->setup_tap_static("10.0.2.110", "support.domain.local"); + $self->clone_host_file("/etc/resolv.conf"); + # start up iscsi target + assert_script_run "printf '\n backing-store /dev/vdb\n' > /etc/tgt/conf.d/openqa.conf"; + # open firewall port + assert_script_run "firewall-cmd --add-service=iscsi-target"; + assert_script_run "systemctl start tgtd.service"; + assert_script_run 'systemctl is-active tgtd.service'; + # report ready, wait for children + mutex_create('support_ready'); + wait_for_children; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_iscsi.pm b/tests/disk_custom_iscsi.pm new file mode 100644 index 00000000..40e6a161 --- /dev/null +++ b/tests/disk_custom_iscsi.pm @@ -0,0 +1,36 @@ +use base "anacondatest"; +use strict; +use testapi; + +sub run { + my $self = shift; + # iscsi config hash + my %iscsi; + $iscsi{'iqn.2016-06.local.domain:support.target1'} = '10.0.2.110'; + # Anaconda hub + # Go to INSTALLATION DESTINATION and ensure one regular disk + # and the iscsi target are selected. + $self->select_disks(iscsi=>\%iscsi); + assert_and_click "anaconda_spoke_done"; + # now we're at custom part. let's use standard partitioning for + # simplicity + $self->custom_scheme_select("standard"); + # Do 'automatic' partition creation + assert_and_click "anaconda_part_automatic"; + # Make sure / is on the iSCSI target (which appears as sda) + $self->custom_change_device("root", "sda"); + assert_and_click "anaconda_spoke_done"; + assert_and_click "anaconda_part_accept_changes"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_iscsi_postinstall.pm b/tests/disk_custom_iscsi_postinstall.pm new file mode 100644 index 00000000..a37b0649 --- /dev/null +++ b/tests/disk_custom_iscsi_postinstall.pm @@ -0,0 +1,24 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check we have a node for the target. realistically speaking we + # don't need a lot of checking here, it seems extremely unlikely + # that the system could ever actually boot unless everything is + # working. + assert_script_run "test -d '/var/lib/iscsi/nodes/iqn.2016-06.local.domain:support.target1'"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_software_raid.pm b/tests/disk_custom_software_raid.pm index bbe3d576..ce31d420 100644 --- a/tests/disk_custom_software_raid.pm +++ b/tests/disk_custom_software_raid.pm @@ -6,7 +6,7 @@ sub run { my $self = shift; # Go to INSTALLATION DESTINATION and ensure two disks are selected. # Because PARTITIONING starts with 'custom_', this will select custom. - $self->select_disks(2); + $self->select_disks(disks=>2); assert_and_click "anaconda_spoke_done"; # Manual partitioning spoke should be displayed diff --git a/tests/disk_guided_multi.pm b/tests/disk_guided_multi.pm index 94d6e827..551d6df9 100644 --- a/tests/disk_guided_multi.pm +++ b/tests/disk_guided_multi.pm @@ -6,7 +6,7 @@ sub run { my $self = shift; # Anaconda hub # Go to INSTALLATION DESTINATION and select only one disk. - $self->select_disks(1); + $self->select_disks(disks=>1); assert_and_click "anaconda_spoke_done"; # Anaconda hub diff --git a/tests/disk_guided_multi_empty_all.pm b/tests/disk_guided_multi_empty_all.pm index 799972bf..204fea6c 100644 --- a/tests/disk_guided_multi_empty_all.pm +++ b/tests/disk_guided_multi_empty_all.pm @@ -6,7 +6,7 @@ sub run { my $self = shift; # Anaconda hub # Go to INSTALLATION DESTINATION and select two disks. - $self->select_disks(2); + $self->select_disks(disks=>2); assert_and_click "anaconda_spoke_done"; # Anaconda hub diff --git a/tests/role_deploy_domain_controller.pm b/tests/role_deploy_domain_controller.pm index dd68b5a9..84eaddcb 100644 --- a/tests/role_deploy_domain_controller.pm +++ b/tests/role_deploy_domain_controller.pm @@ -28,13 +28,7 @@ sub run { assert_script_run 'systemctl start haveged.service'; # read DNS server IPs from host's /etc/resolv.conf for passing to # rolectl - my @forwards; - open(FH, '<', "/etc/resolv.conf"); - while () { - if ($_ =~ m/^nameserver +(.+)/) { - push @forwards, $1; - } - } + my @forwards = $self->get_host_dns(); # we are now gonna work around a stupid bug in rolekit. we want to # pass it a list of ipv4 DNS forwarders and have no ipv6 DNS # forwarders. but it won't allow you to have a dns_forwarders array