From 81a5d61c6086b26eb8c0869a744e5a10808ee1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Thu, 30 Mar 2023 10:58:49 +0200 Subject: [PATCH 1/3] testsuite: raise an exception again if the system doesn't exist --- testsuite/features/step_definitions/navigation_steps.rb | 3 +-- testsuite/features/support/twopence_init.rb | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index ebf47cfb99af..b3dc9883cf5b 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -452,9 +452,8 @@ system_name = get_system_name(host) rescue raise "Host #{host} not found" if if_present.empty? - log "Host #{host} is not deployed, not trying to select it" - return + next end step %(I select "#{system_name}" from "#{field}") end diff --git a/testsuite/features/support/twopence_init.rb b/testsuite/features/support/twopence_init.rb index 611eb0b6c9d0..79b245f2a909 100644 --- a/testsuite/features/support/twopence_init.rb +++ b/testsuite/features/support/twopence_init.rb @@ -199,13 +199,8 @@ def get_system_name(host) when 'containerized_proxy' system_name = $proxy.full_hostname.sub('pxy', 'pod-pxy') else - begin - node = get_target(host) - system_name = node.full_hostname - rescue RuntimeError - # If the node for that host is not defined, just return the host parameter as system_name - system_name = host - end + node = get_target(host) + system_name = node.full_hostname end system_name end From fcb304ec9a6be9039eb2f23fd4170e3ca12734cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Thu, 6 Apr 2023 11:00:13 +0200 Subject: [PATCH 2/3] sanity checks: don't check for server hostname The server hostname cannot be used in a kubernetes container as it is set to the pod name, the FQDN and hostname need to be used from `rhn.conf` --- testsuite/features/core/allcli_sanity.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/features/core/allcli_sanity.feature b/testsuite/features/core/allcli_sanity.feature index 4949116b4fca..e28d0750c9f5 100644 --- a/testsuite/features/core/allcli_sanity.feature +++ b/testsuite/features/core/allcli_sanity.feature @@ -6,8 +6,7 @@ Feature: Sanity checks I want to be sure to use a sane environment Scenario: The server is healthy - Then "server" should have a FQDN - And reverse resolution should work for "server" + Then reverse resolution should work for "server" And the clock from "server" should be exact And service "apache2" is enabled on "server" And service "apache2" is active on "server" From 1cf99abb6596715bb7dba776552bb8f4b2621e58 Mon Sep 17 00:00:00 2001 From: Ondrej Holecek Date: Wed, 19 Apr 2023 15:26:25 +0200 Subject: [PATCH 3/3] Use curl instead of wget to download bootstrap script - curl -O always stores file to its filename. When using wget if the file exists it will append .1 and so on to prevent overwriting local file --- testsuite/features/step_definitions/command_steps.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/features/step_definitions/command_steps.rb b/testsuite/features/step_definitions/command_steps.rb index 7b805f2d68fb..f3bd7fc53774 100644 --- a/testsuite/features/step_definitions/command_steps.rb +++ b/testsuite/features/step_definitions/command_steps.rb @@ -454,7 +454,7 @@ When(/^I fetch "([^"]*)" to "([^"]*)"$/) do |file, host| node = get_target(host) - node.run("wget http://#{$server.full_hostname}/#{file}") + node.run("curl -s -O http://#{$server.full_hostname}/#{file}") end When(/^I wait until file "([^"]*)" contains "([^"]*)" on server$/) do |file, content|