From 297db931c76307732de9c223b472a73761e3b547 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Wed, 8 Mar 2023 11:11:48 +0100 Subject: [PATCH 1/9] QE: Rename Cobbler distro test file I renamed the Cobbler distro test file to be more consistent with the other names of the feature files. Signed-off-by: Dominik Gedon --- .../{srv_distro_cobbler.feature => srv_cobbler_distro.feature} | 0 testsuite/run_sets/secondary_parallelizable.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename testsuite/features/secondary/{srv_distro_cobbler.feature => srv_cobbler_distro.feature} (100%) diff --git a/testsuite/features/secondary/srv_distro_cobbler.feature b/testsuite/features/secondary/srv_cobbler_distro.feature similarity index 100% rename from testsuite/features/secondary/srv_distro_cobbler.feature rename to testsuite/features/secondary/srv_cobbler_distro.feature diff --git a/testsuite/run_sets/secondary_parallelizable.yml b/testsuite/run_sets/secondary_parallelizable.yml index a7a3d6e3dd81..754c83c9a2fe 100644 --- a/testsuite/run_sets/secondary_parallelizable.yml +++ b/testsuite/run_sets/secondary_parallelizable.yml @@ -14,7 +14,7 @@ - features/secondary/srv_clone_channel_npn.feature - features/secondary/srv_manage_activationkey.feature - features/secondary/srv_activationkey_api.feature -- features/secondary/srv_distro_cobbler.feature +- features/secondary/srv_cobbler_distro.feature - features/secondary/srv_cobbler_buildiso.feature - features/secondary/srv_mainpage.feature - features/secondary/srv_user_api.feature From f5db84f8a488a595e4d0b010234fdd1372e0a613 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Wed, 8 Mar 2023 11:13:02 +0100 Subject: [PATCH 2/9] QE: Rename and update Cobbler sync step Signed-off-by: Dominik Gedon --- testsuite/features/secondary/proxy_cobbler_pxeboot.feature | 5 ++--- testsuite/features/step_definitions/cobbler_steps.rb | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/testsuite/features/secondary/proxy_cobbler_pxeboot.feature b/testsuite/features/secondary/proxy_cobbler_pxeboot.feature index 50dc3638def6..fc655bbb2696 100644 --- a/testsuite/features/secondary/proxy_cobbler_pxeboot.feature +++ b/testsuite/features/secondary/proxy_cobbler_pxeboot.feature @@ -1,6 +1,5 @@ # Copyright (c) 2021-2022 SUSE LLC # Licensed under the terms of the MIT license. -# @proxy @private_net @@ -78,11 +77,11 @@ Feature: PXE boot a terminal with Cobbler When I restart cobbler on the server Then service "cobblerd" is active on "server" - Scenario: Set up tftp installation + Scenario: Set up tftp installation and synchronize it When I configure tftp on the "server" And I start tftp on the proxy And I configure tftp on the "proxy" - And I synchronize the tftp configuration on the proxy with the server + And I run Cobbler sync with error checking Scenario: Restart squid so proxy.example.org is recognized When I restart squid service on the proxy diff --git a/testsuite/features/step_definitions/cobbler_steps.rb b/testsuite/features/step_definitions/cobbler_steps.rb index bcdfce6e77ac..8e371f1c4dad 100644 --- a/testsuite/features/step_definitions/cobbler_steps.rb +++ b/testsuite/features/step_definitions/cobbler_steps.rb @@ -230,7 +230,11 @@ raise 'File injection failed' unless return_codes.all?(&:zero?) end -When(/^I synchronize the tftp configuration on the proxy with the server$/) do +When(/^I run Cobbler sync (with|without) error checking$/) do |checking| + if checking == 'with' out, _code = $server.run('cobbler sync') raise 'cobbler sync failed' if out.include? 'Push failed' + else + _out, _code = $server.run('cobbler sync') + end end From f9a046ea476ad8b913d3361dfe8f13356808119a Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Wed, 8 Mar 2023 11:14:43 +0100 Subject: [PATCH 3/9] QE: Add Cobbler profile tests This will add specific Cobbler profile tests and extends our test suite to be able to use more Cobbler and SUMA XML-RPC API calls. See https://github.com/SUSE/spacewalk/issues/20409 Signed-off-by: Dominik Gedon --- .../secondary/srv_cobbler_profile_ise.feature | 102 +++++++++++ .../features/step_definitions/api_common.rb | 13 ++ .../step_definitions/cobbler_steps.rb | 16 +- testsuite/features/support/cobbler_test.rb | 169 ++++++++++++++++++ .../features/support/namespaces/kickstart.rb | 39 ++++ .../features/support/namespaces/system.rb | 13 +- testsuite/run_sets/secondary.yml | 1 + 7 files changed, 350 insertions(+), 3 deletions(-) create mode 100644 testsuite/features/secondary/srv_cobbler_profile_ise.feature diff --git a/testsuite/features/secondary/srv_cobbler_profile_ise.feature b/testsuite/features/secondary/srv_cobbler_profile_ise.feature new file mode 100644 index 000000000000..55baf23c2f3f --- /dev/null +++ b/testsuite/features/secondary/srv_cobbler_profile_ise.feature @@ -0,0 +1,102 @@ +# Copyright (c) 2023 SUSE LLC. +# Licensed under the terms of the MIT license. + +@scope_cobbler +Feature: Cobbler editing profiles results in ISE + Tests for occuring Cobbler issue (bsc#1207532) + This feature is split up into 2 section + The first section uses the webUI + The second one uses the XML-RPC API + + Background: The Cobbler service should be running + Given cobblerd is running + + Scenario: Copy cobbler profiles on the server + When I copy autoinstall mocked files on server + + Scenario: Log in as testing user + Given I am authorized as "testing" with password "testing" + + ## UI tests + Scenario: Create a Cobbler distribution via the UI + When I follow the left menu "Systems > Autoinstallation > Distributions" + And I follow "Create Distribution" + When I enter "isedistro_ui" as "label" + And I enter "/var/autoinstall/Fedora_12_i386/" as "basepath" + And I select "Fedora" from "installtype" + And I click on "Create Autoinstallable Distribution" + Then I should see a "Autoinstallable Distributions" text + And I should see a "isedistro_ui" link + + Scenario: Create a Cobbler profile via the UI + When I follow the left menu "Systems > Autoinstallation > Profiles" + And I follow "Create Kickstart Profile" + When I enter "iseprofile_ui" as "kickstartLabel" + And I click on "Next" + And I click on "Next" + And I enter "linux" as "rootPassword" + And I enter "linux" as "rootPasswordConfirm" + And I click on "Finish" + Then I should see a "Autoinstallation: iseprofile_ui" text + And I should see a "Autoinstallation Details" link + + Scenario: Check Cobbler created distro and profile via the UI + When I follow the left menu "Systems > Autoinstallation > Profiles" + Then I should see a "iseprofile_ui" text + And I should see a "isedistro_ui" text + + Scenario: Change profile variables using the UI + When I follow the left menu "Systems > Autoinstallation > Profiles" + And I follow "iseprofile_ui" + And I follow "Variables" + And I enter "ise_ui_test=ISE_UI_TEST" as "variables" + And I click on "Update Variables" + And I refresh the page + Then I should see a "ISE_UI_TEST" text + + ## XML-RPC API tests + Scenario: Create a Cobbler distribution via the UI in the XML-RPC context + When I follow the left menu "Systems > Autoinstallation > Distributions" + And I follow "Create Distribution" + When I enter "isedistro_api" as "label" + And I enter "/var/autoinstall/Fedora_12_i386/" as "basepath" + And I select "Fedora" from "installtype" + And I click on "Create Autoinstallable Distribution" + Then I should see a "Autoinstallable Distributions" text + And I should see a "isedistro_api" link + + Scenario: Create a Cobbler profile via the UI in the XML-RPC context + When I follow the left menu "Systems > Autoinstallation > Profiles" + And I follow "Create Kickstart Profile" + When I enter "iseprofile_api" as "kickstartLabel" + And I click on "Next" + And I click on "Next" + And I enter "linux" as "rootPassword" + And I enter "linux" as "rootPasswordConfirm" + And I click on "Finish" + Then I should see a "Autoinstallation: iseprofile_api" text + And I should see a "Autoinstallation Details" link + + Scenario: Check Cobbler created distro and profile via the UI in the XML-RPC context + When I follow the left menu "Systems > Autoinstallation > Profiles" + Then I should see a "iseprofile_api" text + And I should see a "isedistro_api" text + + Scenario: Create a Cobbler system via the XML-RPC API + And I create a system record with name "isesystem_api" and kickstart label "iseprofile_api" + + Scenario: Create and modify a System profile using the XML-RPC API + # XML-RPC should return an error here + And I create and modify the kickstart system "isesystem_api" with hostname "ise-system.test" via XML-RPC + | inst.repo | http://ise.cobbler.test | + | self_update | http://ise.cobbler.test | + + Scenario: Cleanup: delete test distros and profiles + When I remove kickstart profiles and distros + And I follow the left menu "Systems > System List" + And I wait until I see the "isesystem_api" system, refreshing the page + And I follow "isesystem_api" + And I follow "Delete System" + Then I should see a "Confirm System Profile Deletion" text + When I click on "Delete Profile" + And I wait until I see "has been deleted" text diff --git a/testsuite/features/step_definitions/api_common.rb b/testsuite/features/step_definitions/api_common.rb index c16bf3905cc1..50586b623656 100644 --- a/testsuite/features/step_definitions/api_common.rb +++ b/testsuite/features/step_definitions/api_common.rb @@ -67,6 +67,11 @@ $api_test.system.create_system_record('testserver', 'fedora_kickstart_profile_upload', '', 'my test server', [dev]) end +When(/^I create a system record with name "([^"]*)" and kickstart label "([^"]*)"$/) do |name, label| + dev = { 'name' => 'eth0', 'ip' => '1.1.1.2', 'mac' => '00:22:22:77:EE:DD', 'dnsname' => 'testserver.example.com' } + $api_test.system.create_system_record(name, label, '', 'my test server', [dev]) +end + When(/^I wait for the OpenSCAP audit to finish$/) do @sle_id = $api_test.system.retrieve_server_id($minion.full_hostname) begin @@ -570,3 +575,11 @@ def wait_action_complete(actionid, timeout: DEFAULT_TIMEOUT) Then(/^"([^"]*)" should be present in the result$/) do |profile_name| assert($output.select { |p| p['name'] == profile_name }.count == 1) end + +When(/^I create and modify the kickstart system "([^"]*)" with hostname "([^"]*)" via XML-RPC$/) do |name, hostname, values| + system_id = $api_test.system.create_system_profile(name, 'hostname' => hostname) + STDOUT.puts "system_id: #{system_id}" + # this works only with a 2 column table where the key is in the left column + variables = values.rows_hash + _command = $api_test.system.set_variables(system_id, variables) +end diff --git a/testsuite/features/step_definitions/cobbler_steps.rb b/testsuite/features/step_definitions/cobbler_steps.rb index 8e371f1c4dad..da957e0b82ac 100644 --- a/testsuite/features/step_definitions/cobbler_steps.rb +++ b/testsuite/features/step_definitions/cobbler_steps.rb @@ -54,6 +54,18 @@ ct.system_remove(system) end +When(/^I remove profile "([^"]*)" as user "([^"]*)" with password "([^"]*)"$/) do |system, user, pwd| + ct = ::CobblerTest.new + ct.login(user, pwd) + ct.profile_remove(system) +end + +When(/^I remove distro "([^"]*)" as user "([^"]*)" with password "([^"]*)"$/) do |system, user, pwd| + ct = ::CobblerTest.new + ct.login(user, pwd) + ct.distro_remove(system) +end + When(/^I remove kickstart profiles and distros$/) do host = $server.full_hostname # ------------------------------- @@ -232,8 +244,8 @@ When(/^I run Cobbler sync (with|without) error checking$/) do |checking| if checking == 'with' - out, _code = $server.run('cobbler sync') - raise 'cobbler sync failed' if out.include? 'Push failed' + out, _code = $server.run('cobbler sync') + raise 'cobbler sync failed' if out.include? 'Push failed' else _out, _code = $server.run('cobbler sync') end diff --git a/testsuite/features/support/cobbler_test.rb b/testsuite/features/support/cobbler_test.rb index a6baa86bd6bb..9f289ba64c3e 100644 --- a/testsuite/features/support/cobbler_test.rb +++ b/testsuite/features/support/cobbler_test.rb @@ -237,4 +237,173 @@ def get(what, name, key) end result end + + ## + # Modifies a profile and saves it afterwards. + # + # For more information, see https://cobbler.readthedocs.io/en/latest/cobbler.html#cobbler-profile + # Args: + # name: The name of the profile + # attribute: The attribute you want to modify + # value: The new value you want to set for attribute + def profile_modify(name, attribute, value) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: profile.uid + profile = @server.call('get_profile_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "Profile with name #{name} not found. #{$ERROR_INFO}") + end + begin + @server.call('modify_profile', profile, attribute, value, @token) + rescue ::StandardError + raise(::StandardError, "Modifying profile failed. #{$ERROR_INFO}") + end + begin + @server.call('save_profile', profile, @token) + rescue ::StandardError + raise(::StandardError, "Saving profile failed. #{$ERROR_INFO}") + end + profile + end + + ## + # Modifies a distribution and saves it afterwards. + # + # For more information, see https://cobbler.readthedocs.io/en/latest/cobbler.html#cobbler-distro + # Args: + # name: The name of the distribution + # attribute: The attribute you want to modify + # value: The new value you want to set for attribute + def distro_modify(name, attribute, value) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: distro.uid + distro = @server.call('get_distro_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "Distribution with name #{name} not found. #{$ERROR_INFO}") + end + begin + @server.call('modify_distro', distro, attribute, value, @token) + rescue ::StandardError + raise(::StandardError, "Modifying distribution failed. #{$ERROR_INFO}") + end + begin + @server.call('save_distro', distro, @token) + rescue ::StandardError + raise(::StandardError, "Saving distribution failed. #{$ERROR_INFO}") + end + distro + end + + ## + # Modifies a system and saves it afterwards. + # + # For more information, see https://cobbler.readthedocs.io/en/latest/cobbler.html#cobbler-system + # Args: + # name: The name of the system + # attribute: The attribute you want to modify + # value: The new value you want to set for attribute + def system_modify(name, attribute, value) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: system.uid + system = @server.call('get_system_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "System with name #{name} not found. #{$ERROR_INFO}") + end + begin + @server.call('modify_system', system, attribute, value, @token) + rescue ::StandardError + raise(::StandardError, "Modifying system failed. #{$ERROR_INFO}") + end + begin + @server.call('save_system', system, @token) + rescue ::StandardError + raise(::StandardError, "Saving system failed. #{$ERROR_INFO}") + end + system + end + + ## + # Removes a distribution from the Spacewalk server. + # + # The first thing this function does is check to see if the distribution exists. If it doesn't, it raises an error. + # If it does, it calls the remove_distro function on the Spacewalk server. If that fails, it raises an error. + # + # Args: + # name: The name of the distribution to be removed. + def distro_remove(name) + raise(::IndexError, "Distribution cannot be found. #{$ERROR_INFO}") unless distro_exists(name) + begin + @server.call('remove_distro', name, @token) + rescue ::StandardError + raise(::StandardError, "Deleting distribution failed. #{$ERROR_INFO}") + end + end + + ## + # Removes a profile from the Spacewalk server. + # + # The first thing this function does is check to see if the profile exists. If it doesn't, it raises an error. If it + # does, it calls the remove_profile function on the Spacewalk server. If that fails, it raises an error. + # + # Args: + # name: The name of the profile to be removed. + def profile_remove(name) + raise(::IndexError, "Profile cannot be found. #{$ERROR_INFO}") unless profile_exists(name) + begin + @server.call('remove_profile', name, @token) + rescue ::StandardError + raise(::StandardError, "Deleting profile failed. #{$ERROR_INFO}") + end + end + + ## + # Get a handle for a system. + # + # Get a handle for a system which allows you to use the functions modify_* or save_* to manipulate it. + # + # Args: + # name: The name of the system to get the ID of + def get_system_handle(name) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: system.uid + system = @server.call('get_system_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "System with name #{name} not found. #{$ERROR_INFO}") + end + system + end + + ## + # Get a handle for a profile. + # + # Get a handle for a profile which allows you to use the functions modify_* or save_* to manipulate it. + # + # Args: + # name: The name of the profile to get the ID of + def get_profile_handle(name) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: profile.uid + system = @server.call('get_profile_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "Profile with name #{name} not found. #{$ERROR_INFO}") + end + system + end + + ## + # Get a handle for a distribution. + # + # Get a handle for a distribution which allows you to use the functions modify_* or save_* to manipulate it. + # + # Args: + # name: The name of the distribution to get the ID of + def get_distro_handle(name) + begin + # TODO: Starting with Cobbler 3.4.0 the handle will be the UID: distro.uid + system = @server.call('get_distro_handle', name, @token) + rescue ::StandardError + raise(::StandardError, "Distribution with name #{name} not found. #{$ERROR_INFO}") + end + system + end end diff --git a/testsuite/features/support/namespaces/kickstart.rb b/testsuite/features/support/namespaces/kickstart.rb index 5488c8594466..7f9a18462813 100644 --- a/testsuite/features/support/namespaces/kickstart.rb +++ b/testsuite/features/support/namespaces/kickstart.rb @@ -11,9 +11,48 @@ class NamespaceKickstart def initialize(api_test) @test = api_test @tree = NamespaceKickstartTree.new(api_test) + @profile = NamespaceKickstartProfile.new(api_test) end attr_reader :tree + attr_reader :profile + + ## + # Create a new kickstart profile using the default download URL for the kickstartable tree and kickstart host + # specified. + # + # Args: + # name: The name of the new kickstart profile + # vmType: Virtualization type, or none + # kstreelabel: The Label of a kickstartable tree + # kshost: The Kickstart hostname (of a server or proxy) used to construct the default download URL + # rootPassword: The root password + # updateType: Set the automatic ks tree update strategy for the profile. Valid choices are "none" or "all". + def create_profile(name, kstreelabel, kshost) + @test.call('kickstart.profile.createProfile', sessionKey: @test.token, profileLabel: name, vmType: 'none', kickstartableTreeLabel: kstreelabel, kickstartHost: kshost, rootPassword: 'linux', updateType: 'all') + end +end + +# Kickstart.profile namespace +class NamespaceKickstartProfile + ## + # It initializes the function. + # + # Args: + # api_test: This is the test object that is passed to the initialize method. + def initialize(api_test) + @test = api_test + end + + ## + # Associates list of kickstart variables with the specified kickstart profile + # + # Args: + # profile: The name of the kickstart profile + # variables: A list of variables to set + def set_variables(profile, variables) + @test.call('kickstart.profile.setVariables', sessionKey: @test.token, ksLabel: profile, variables: variables) + end end # "kickstart.tree" namespace diff --git a/testsuite/features/support/namespaces/system.rb b/testsuite/features/support/namespaces/system.rb index 941da1fbd2aa..c35254ac944b 100644 --- a/testsuite/features/support/namespaces/system.rb +++ b/testsuite/features/support/namespaces/system.rb @@ -128,7 +128,7 @@ def schedule_script_run(server, uid, gid, timeout, script, date) end ## - # Creates a system record in the Satellite 6 server. + # Creates a system record on the Spacewalk server. # # Args: # name: The name of the system record. @@ -166,6 +166,17 @@ def list_empty_system_profiles def obtain_reactivation_key(server) @test.call('system.obtainReactivationKey', sessionKey: @test.token, sid: server) end + + ## + # Sets a list of kickstart variables in the Cobbler system record for the specified server. + # + # Args: + # server: The server ID of the server you want to reactivate + # netboot: Enabled by default here + # variables: A list of system kickstart variables to set + def set_variables(server, variables) + @test.call('system.setVariables', sessionKey: @test.token, sid: server, netboot: true, variables: variables) + end end # System Configuration namespace diff --git a/testsuite/run_sets/secondary.yml b/testsuite/run_sets/secondary.yml index ed1f055d61e3..7afa7b948196 100644 --- a/testsuite/run_sets/secondary.yml +++ b/testsuite/run_sets/secondary.yml @@ -57,4 +57,5 @@ - features/secondary/srv_rename_hostname.feature - features/secondary/proxy_as_pod_basic_tests.feature - features/secondary/srv_logfile.feature +- features/secondary/srv_cobbler_profile_ise.feature ## Secondary features END ## From 8e68e29cc66a52e31cd3c546d391d9cdafa4137e Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Fri, 10 Mar 2023 10:16:49 +0100 Subject: [PATCH 4/9] QE: Add missing Cobbler tag Signed-off-by: Dominik Gedon --- testsuite/features/secondary/srv_cobbler_sync.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/features/secondary/srv_cobbler_sync.feature b/testsuite/features/secondary/srv_cobbler_sync.feature index 5320eb9c22b4..ba44c3d42b45 100644 --- a/testsuite/features/secondary/srv_cobbler_sync.feature +++ b/testsuite/features/secondary/srv_cobbler_sync.feature @@ -1,6 +1,7 @@ -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2022-2023 SUSE LLC # Licensed under the terms of the MIT license. +@scope_cobbler Feature: Run Cobbler Sync via WebUI Scenario: Login as admin From 5f4d56057c4255f792010ef5f01e85b52273953e Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Fri, 10 Mar 2023 10:18:04 +0100 Subject: [PATCH 5/9] QE: Rename testdistro in Cobbler buildiso test This could interfere with other Cobbler tests. If we do not have proper clenaups a scenario can fail because of a distro with the same name. Signed-off-by: Dominik Gedon --- .../secondary/srv_cobbler_buildiso.feature | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/testsuite/features/secondary/srv_cobbler_buildiso.feature b/testsuite/features/secondary/srv_cobbler_buildiso.feature index 061f93e39050..30e8ccdd1b8c 100644 --- a/testsuite/features/secondary/srv_cobbler_buildiso.feature +++ b/testsuite/features/secondary/srv_cobbler_buildiso.feature @@ -13,17 +13,17 @@ Feature: Cobbler buildiso Scenario: Create a dummy distro in the cobbler buildiso context Given cobblerd is running - When I create distro "testdistro" as user "testing" with password "testing" + When I create distro "buildisodistro" as user "testing" with password "testing" Scenario: Create dummy profiles in the cobbler buildiso context - Given distro "testdistro" exists - When I create profile "orchid" for distro "testdistro" as user "testing" with password "testing" - And I create profile "flame" for distro "testdistro" as user "testing" with password "testing" - And I create profile "pearl" for distro "testdistro" as user "testing" with password "testing" + Given distro "buildisodistro" exists + When I create profile "orchid" for distro "buildisodistro" as user "testing" with password "testing" + And I create profile "flame" for distro "buildisodistro" as user "testing" with password "testing" + And I create profile "pearl" for distro "buildisodistro" as user "testing" with password "testing" Scenario: Check cobbler created a distro and profiles in the cobbler buildiso context When I follow the left menu "Systems > Autoinstallation > Profiles" - Then I should see a "testdistro" text + Then I should see a "buildisodistro" text And I should see a "orchid" text And I should see a "flame" text And I should see a "pearl" text @@ -37,29 +37,29 @@ Feature: Cobbler buildiso When I prepare Cobbler for the buildiso command Scenario: Run Cobbler buildiso with all profiles and check isolinux config file in the cobbler buildiso context - When I run Cobbler buildiso for distro "testdistro" and all profiles + When I run Cobbler buildiso for distro "buildisodistro" and all profiles And I check Cobbler buildiso ISO "profile_all" with xorriso And I check the Cobbler parameter "nameserver" with value "9.9.9.9" in the isolinux.cfg And I cleanup xorriso temp files Scenario: Run Cobbler buildiso with selected profile in the cobbler buildiso context - When I run Cobbler buildiso for distro "testdistro" and profile "orchid" + When I run Cobbler buildiso for distro "buildisodistro" and profile "orchid" And I check Cobbler buildiso ISO "orchid" with xorriso And I cleanup xorriso temp files # TODO: Fails unless https://github.com/cobbler/cobbler/issues/2995 is fixed Scenario: Run Cobbler buildiso with selected profile and without dns entries in the cobbler buildiso context - When I run Cobbler buildiso for distro "testdistro" and profile "orchid" without dns entries + When I run Cobbler buildiso for distro "buildisodistro" and profile "orchid" without dns entries And I check Cobbler buildiso ISO "orchid" with xorriso And I cleanup xorriso temp files Scenario: Run Cobbler buildiso airgapped with all profiles in the cobbler buildiso context - When I run Cobbler buildiso "airgapped" for distro "testdistro" + When I run Cobbler buildiso "airgapped" for distro "buildisodistro" And I check Cobbler buildiso ISO "airgapped" with xorriso And I cleanup xorriso temp files Scenario: Run Cobbler buildiso standalone with all profiles in the cobbler buildiso context - When I run Cobbler buildiso "standalone" for distro "testdistro" + When I run Cobbler buildiso "standalone" for distro "buildisodistro" And I check Cobbler buildiso ISO "standalone" with xorriso And I cleanup xorriso temp files @@ -68,7 +68,7 @@ Feature: Cobbler buildiso When I remove system "testsystem" as user "testing" with password "testing" And I remove kickstart profiles and distros And I follow the left menu "Systems > Autoinstallation > Profiles" - Then I should not see a "testdistro" text + Then I should not see a "buildisodistro" text And I should not see a "orchid" text And I should not see a "flame" text And I should not see a "flame" text From d2eea955fc291f7496f633af579f28cecc501174 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Fri, 10 Mar 2023 11:04:01 +0100 Subject: [PATCH 6/9] QE: Move all Cobbler tests to `secondary.yml` We cannot successfully reproduce Cobbler race conditions so we do not want them to occur unwillingly. Therefore I moved all Cobbler tests from `secondary_parallelizable.yml` to to `secondary.yml`. Signed-off-by: Dominik Gedon --- testsuite/run_sets/secondary.yml | 3 +++ testsuite/run_sets/secondary_parallelizable.yml | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/run_sets/secondary.yml b/testsuite/run_sets/secondary.yml index 7afa7b948196..bb345692e0fd 100644 --- a/testsuite/run_sets/secondary.yml +++ b/testsuite/run_sets/secondary.yml @@ -57,5 +57,8 @@ - features/secondary/srv_rename_hostname.feature - features/secondary/proxy_as_pod_basic_tests.feature - features/secondary/srv_logfile.feature +- features/secondary/srv_cobbler_sync.feature +- features/secondary/srv_cobbler_distro.feature +- features/secondary/srv_cobbler_buildiso.feature - features/secondary/srv_cobbler_profile_ise.feature ## Secondary features END ## diff --git a/testsuite/run_sets/secondary_parallelizable.yml b/testsuite/run_sets/secondary_parallelizable.yml index 754c83c9a2fe..2ed3ff03f5de 100644 --- a/testsuite/run_sets/secondary_parallelizable.yml +++ b/testsuite/run_sets/secondary_parallelizable.yml @@ -14,8 +14,6 @@ - features/secondary/srv_clone_channel_npn.feature - features/secondary/srv_manage_activationkey.feature - features/secondary/srv_activationkey_api.feature -- features/secondary/srv_cobbler_distro.feature -- features/secondary/srv_cobbler_buildiso.feature - features/secondary/srv_mainpage.feature - features/secondary/srv_user_api.feature - features/secondary/srv_salt_download_endpoint.feature @@ -39,7 +37,6 @@ - features/secondary/srv_reportdb.feature - features/secondary/srv_dist_channel_mapping.feature - features/secondary/srv_task_status_engine.feature -- features/secondary/srv_cobbler_sync.feature - features/secondary/proxy_retail_pxeboot_and_mass_import.feature - features/secondary/allcli_overview_systems_details.feature From 4cc2ff60b9af55d22347f5ad32bf3ebf674cd842 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Fri, 10 Mar 2023 14:43:33 +0100 Subject: [PATCH 7/9] QE: Add missing `@sle_minion` tag This will add the missing `@sle_minion` tag to the power management tests that require a SLE minion. Signed-off-by: Dominik Gedon --- testsuite/features/secondary/srv_power_management.feature | 1 + testsuite/features/secondary/srv_power_management_api.feature | 1 + .../features/secondary/srv_power_management_redfish.feature | 1 + 3 files changed, 3 insertions(+) diff --git a/testsuite/features/secondary/srv_power_management.feature b/testsuite/features/secondary/srv_power_management.feature index 59508a608a70..feb0ea59c8aa 100644 --- a/testsuite/features/secondary/srv_power_management.feature +++ b/testsuite/features/secondary/srv_power_management.feature @@ -3,6 +3,7 @@ @scope_power_management @scope_cobbler +@sle_minion Feature: IPMI Power management Scenario: Fake an IPMI host diff --git a/testsuite/features/secondary/srv_power_management_api.feature b/testsuite/features/secondary/srv_power_management_api.feature index a932238694e2..63c29afcc143 100644 --- a/testsuite/features/secondary/srv_power_management_api.feature +++ b/testsuite/features/secondary/srv_power_management_api.feature @@ -2,6 +2,7 @@ # Licensed under the terms of the MIT license. @scope_api +@sle_minion Feature: IPMI Power management API Scenario: Setup an IPMI host for API test diff --git a/testsuite/features/secondary/srv_power_management_redfish.feature b/testsuite/features/secondary/srv_power_management_redfish.feature index 81a25643f438..215c57ba83b5 100644 --- a/testsuite/features/secondary/srv_power_management_redfish.feature +++ b/testsuite/features/secondary/srv_power_management_redfish.feature @@ -3,6 +3,7 @@ @scope_power_management @scope_cobbler +@sle_minion Feature: Redfish Power management Scenario: Setup a Redfish host From d62a812592829bc26c3970191cd82dab04d7e4d0 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Fri, 10 Mar 2023 15:30:30 +0100 Subject: [PATCH 8/9] QE: Add comment to new Cobbler profile test Specify that the XML-API test here will fail until Enno provides a fix for it. Signed-off-by: Dominik Gedon --- ...cobbler_profile_ise.feature => srv_cobbler_profile.feature} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename testsuite/features/secondary/{srv_cobbler_profile_ise.feature => srv_cobbler_profile.feature} (96%) diff --git a/testsuite/features/secondary/srv_cobbler_profile_ise.feature b/testsuite/features/secondary/srv_cobbler_profile.feature similarity index 96% rename from testsuite/features/secondary/srv_cobbler_profile_ise.feature rename to testsuite/features/secondary/srv_cobbler_profile.feature index 55baf23c2f3f..ce49f80553cf 100644 --- a/testsuite/features/secondary/srv_cobbler_profile_ise.feature +++ b/testsuite/features/secondary/srv_cobbler_profile.feature @@ -86,7 +86,8 @@ Feature: Cobbler editing profiles results in ISE And I create a system record with name "isesystem_api" and kickstart label "iseprofile_api" Scenario: Create and modify a System profile using the XML-RPC API - # XML-RPC should return an error here + # This should intentionally fail and XML-RPC should return an error here until + # https://github.com/uyuni-project/uyuni/pull/6676 gets merged by Ion And I create and modify the kickstart system "isesystem_api" with hostname "ise-system.test" via XML-RPC | inst.repo | http://ise.cobbler.test | | self_update | http://ise.cobbler.test | From c888aef7e9c60c95096aba15e15252762cbed09e Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Mon, 13 Mar 2023 12:01:13 +0100 Subject: [PATCH 9/9] QE: Address Cobbler suggestions from reviewers Signed-off-by: Dominik Gedon --- testsuite/features/secondary/srv_cobbler_profile.feature | 2 +- testsuite/features/step_definitions/api_common.rb | 2 +- testsuite/features/support/namespaces/system.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/features/secondary/srv_cobbler_profile.feature b/testsuite/features/secondary/srv_cobbler_profile.feature index ce49f80553cf..43ba5879859b 100644 --- a/testsuite/features/secondary/srv_cobbler_profile.feature +++ b/testsuite/features/secondary/srv_cobbler_profile.feature @@ -4,7 +4,7 @@ @scope_cobbler Feature: Cobbler editing profiles results in ISE Tests for occuring Cobbler issue (bsc#1207532) - This feature is split up into 2 section + This feature is split up into 2 sections The first section uses the webUI The second one uses the XML-RPC API diff --git a/testsuite/features/step_definitions/api_common.rb b/testsuite/features/step_definitions/api_common.rb index 50586b623656..301d7ef59952 100644 --- a/testsuite/features/step_definitions/api_common.rb +++ b/testsuite/features/step_definitions/api_common.rb @@ -581,5 +581,5 @@ def wait_action_complete(actionid, timeout: DEFAULT_TIMEOUT) STDOUT.puts "system_id: #{system_id}" # this works only with a 2 column table where the key is in the left column variables = values.rows_hash - _command = $api_test.system.set_variables(system_id, variables) + $api_test.system.set_variables(system_id, variables) end diff --git a/testsuite/features/support/namespaces/system.rb b/testsuite/features/support/namespaces/system.rb index c35254ac944b..039fe17165ca 100644 --- a/testsuite/features/support/namespaces/system.rb +++ b/testsuite/features/support/namespaces/system.rb @@ -128,7 +128,7 @@ def schedule_script_run(server, uid, gid, timeout, script, date) end ## - # Creates a system record on the Spacewalk server. + # Creates a system record on the SUMA server. # # Args: # name: The name of the system record.