From 478b7eff9ea123381af540e9775ac14ea7c56176 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 19 Aug 2020 14:58:02 -0700 Subject: [PATCH] Add initial CoreOS product and test templates Signed-off-by: Adam Williamson --- lib/utils.pm | 7 ++++--- main.pm | 5 +++++ templates.fif.json | 24 ++++++++++++++++++++++++ tests/_coreos_install.pm | 20 ++++++++++++++++++++ tests/podman.pm | 8 +++++--- 5 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 tests/_coreos_install.pm diff --git a/lib/utils.pm b/lib/utils.pm index 82fc679f..1a2b8e21 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -466,9 +466,10 @@ sub setup_workaround_repo { } sub _repo_setup_compose { - # doesn't work for IoT, anything that hits this in an IoT path - # must work with default mirror config... - return if (get_var("SUBVARIANT") eq "IoT"); + # doesn't work for IoT or CoreOS, anything that hits this on those + # paths must work with default mirror config... + my $subvariant = get_var("SUBVARIANT"); + return if ($subvariant eq "IoT" || $subvariant eq "CoreOS"); # Appropriate repo setup steps for testing a compose # disable updates-testing and updates and use the compose location # as the target for fedora and rawhide rather than mirrorlist, so diff --git a/main.pm b/main.pm index fac80ce8..d6fdd423 100644 --- a/main.pm +++ b/main.pm @@ -134,6 +134,11 @@ sub load_upgrade_tests() { } sub load_install_tests() { + # CoreOS is special, so we handle that here + if (get_var("SUBVARIANT") eq "CoreOS") { + autotest::loadtest "tests/_coreos_install.pm"; + return; + } # normal installation test consists of several phases, from which some of them are # loaded automatically and others are loaded based on what env variables are set diff --git a/templates.fif.json b/templates.fif.json index 32fc4db8..b83226b6 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -115,6 +115,17 @@ }, "version": "*" }, + "fedora-CoreOS-colive-iso-x86_64-*": { + "arch": "x86_64", + "distri": "fedora", + "flavor": "CoreOS-colive-iso", + "settings": { + "CANNED": "1", + "TEST_TARGET": "ISO", + "USER_LOGIN": "false" + }, + "version": "*" + }, "fedora-Everything-boot-iso-ppc64le-*": { "arch": "ppc64le", "distri": "fedora", @@ -323,6 +334,10 @@ "machine": "64bit", "product": "fedora-Cloud_Base-qcow2-qcow2-x86_64-*" }, + "fedora-CoreOS-colive-iso-x86_64-*-64bit": { + "machine": "64bit", + "product": "fedora-CoreOS-colive-iso-x86_64-*" + }, "fedora-Everything-boot-iso-ppc64le-*-ppc64le": { "machine": "ppc64le", "product": "fedora-Everything-boot-iso-ppc64le-*" @@ -448,6 +463,7 @@ }, "base_reboot_unmount": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 20, "fedora-KDE-live-iso-x86_64-*-64bit": 22, @@ -480,6 +496,7 @@ }, "base_system_logging": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 20, "fedora-KDE-live-iso-x86_64-*-64bit": 22, @@ -540,6 +557,7 @@ }, "base_services_start": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 40, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 40, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40, "fedora-KDE-live-iso-x86_64-*-64bit": 42, @@ -586,6 +604,7 @@ }, "base_selinux": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 40, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 40, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40, "fedora-KDE-live-iso-x86_64-*-64bit": 42, @@ -618,6 +637,7 @@ }, "base_service_manipulation": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 40, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 40, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40, "fedora-KDE-live-iso-x86_64-*-64bit": 42, @@ -986,6 +1006,7 @@ }, "install_default_upload": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 20, "fedora-KDE-live-iso-x86_64-*-64bit": 15, @@ -1704,6 +1725,7 @@ }, "podman": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40 }, @@ -1721,6 +1743,7 @@ }, "podman_client": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40 }, @@ -1777,6 +1800,7 @@ }, "release_identification": { "profiles": { + "fedora-CoreOS-colive-iso-x86_64-*-64bit": 20, "fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20, "fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 20, "fedora-KDE-live-iso-x86_64-*-64bit": 50, diff --git a/tests/_coreos_install.pm b/tests/_coreos_install.pm new file mode 100644 index 00000000..3cd0b850 --- /dev/null +++ b/tests/_coreos_install.pm @@ -0,0 +1,20 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +sub run { + my $self = shift; + assert_screen "user_console", 300; + type_string "sudo su\n"; + assert_script_run "coreos-installer install /dev/vda --ignition-url https://www.happyassassin.net/temp/openqa.ign", 600; + type_string "reboot\n"; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/podman.pm b/tests/podman.pm index edae9b8a..e3557e34 100644 --- a/tests/podman.pm +++ b/tests/podman.pm @@ -28,9 +28,11 @@ sub run { validate_script_output "podman container ls", sub { m/fedora-httpd/ }; # Test apache is working assert_script_run "curl http://localhost"; - # Open the firewall - assert_script_run "firewall-cmd --permanent --zone=internal --add-interface=cni-podman0"; - assert_script_run "firewall-cmd --permanent --zone=internal --add-port=80/tcp"; + # Open the firewall, except on CoreOS where it's not installed + unless (get_var("SUBVARIANT") eq "CoreOS") { + assert_script_run "firewall-cmd --permanent --zone=internal --add-interface=cni-podman0"; + assert_script_run "firewall-cmd --permanent --zone=internal --add-port=80/tcp"; + } # tell client we're ready and wait for it to send the message mutex_create("podman_server_ready"); my $children = get_children();