Skip to content

Commit

Permalink
QE: Refactor systemd service steps
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
  • Loading branch information
nodeg committed Sep 15, 2023
1 parent 7e4f5c3 commit ee22a42
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 32 deletions.
8 changes: 4 additions & 4 deletions testsuite/documentation/cucumber-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ Note that the text area variant handles the new lines characters while the other
Then service "bind" is enabled on "proxy"
And service "dhcpd" is running on "proxy"
When I restart the "bind" service on "sle_minion"
And I start the "apache2" service on "proxy"
And I stop the "apache2" service on "proxy"
And I reload the "apache2" service on "proxy"
And I start "apache2" service on "proxy"
And I stop "apache2" service on "proxy"
And I enable "apache2" service on "proxy"
And I disable "apache2" service on "proxy"
And I enable the "apache2" service on "proxy"
And I disable the "apache2" service on "proxy"
```

* File removal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Register and test a Containerized Proxy
When I stop salt-minion on "proxy"
And I run "spacewalk-proxy stop" on "proxy"
# workaround for bsc#1205976
And I stop "tftp" service on "proxy"
And I stop the "tftp" service on "proxy"
And I wait until "squid" service is inactive on "proxy"
And I wait until "apache2" service is inactive on "proxy"
And I wait until "tftp" service is inactive on "proxy"
Expand All @@ -45,7 +45,7 @@ Feature: Register and test a Containerized Proxy
And I add avahi hosts in Containerized Proxy configuration

Scenario: Start Containerized Proxy services
When I start "uyuni-proxy-pod" service on "proxy"
When I start the "uyuni-proxy-pod" service on "proxy"
And I wait until "uyuni-proxy-pod" service is active on "proxy"
And I wait until "uyuni-proxy-httpd" service is active on "proxy"
And I wait until "uyuni-proxy-salt-broker" service is active on "proxy"
Expand Down Expand Up @@ -227,7 +227,7 @@ Feature: Register and test a Containerized Proxy
Then "containerized_proxy" should not be registered

Scenario: Cleanup: Stop Containerized Proxy services
When I stop "uyuni-proxy-pod" service on "proxy"
When I stop the "uyuni-proxy-pod" service on "proxy"

Scenario: Cleanup: Remove Containerized Proxy configuration
When I ensure folder "/etc/uyuni/proxy/*" doesn't exist on "proxy"
Expand All @@ -245,7 +245,7 @@ Feature: Register and test a Containerized Proxy
When I start salt-minion on "proxy"
And I run "spacewalk-proxy start" on "proxy"
# workaround for bsc#1205976
And I start "tftp" service on "proxy"
And I start the "tftp" service on "proxy"
And I wait until "squid" service is active on "proxy"
And I wait until "apache2" service is active on "proxy"
And I wait until "tftp" service is active on "proxy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ Feature: Smoke tests for <client>
And I click on "Apply Highstate"
Then I should see a "Applying the highstate has been scheduled." text
And I wait until event "Apply highstate scheduled by admin" is completed
And I start "prometheus-node_exporter.service" service on "<client>"
And I enable "prometheus-node_exporter.service" service on "<client>"
And I start the "prometheus-node_exporter.service" service on "<client>"
And I enable the "prometheus-node_exporter.service" service on "<client>"

@skip_for_sle_micro_ssh_minion
Scenario: Visit Node monitoring endpoint on the <client>
Expand Down
4 changes: 2 additions & 2 deletions testsuite/features/init_clients/proxy_register_as_pod.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: Setup Containerized Proxy
When I stop salt-minion on "proxy"
And I run "spacewalk-proxy stop" on "proxy"
# workaround for bsc#1205976
And I stop "tftp" service on "proxy"
And I stop the "tftp" service on "proxy"
And I wait until "squid" service is inactive on "proxy"
And I wait until "apache2" service is inactive on "proxy"
And I wait until "tftp" service is inactive on "proxy"
Expand All @@ -35,7 +35,7 @@ Feature: Setup Containerized Proxy
And I add avahi hosts in Containerized Proxy configuration

Scenario: Start Containerized Proxy services
When I start "uyuni-proxy-pod" service on "proxy"
When I start the "uyuni-proxy-pod" service on "proxy"
And I wait until "uyuni-proxy-pod" service is active on "proxy"
And I wait until "uyuni-proxy-httpd" service is active on "proxy"
And I wait until "uyuni-proxy-salt-broker" service is active on "proxy"
Expand Down
8 changes: 4 additions & 4 deletions testsuite/features/secondary/proxy_as_pod_basic_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: Register and test a Containerized Proxy
When I stop salt-minion on "proxy"
And I run "spacewalk-proxy stop" on "proxy"
# workaround for bsc#1205976
And I stop "tftp" service on "proxy"
And I stop the "tftp" service on "proxy"
And I wait until "squid" service is inactive on "proxy"
And I wait until "apache2" service is inactive on "proxy"
And I wait until "tftp" service is inactive on "proxy"
Expand All @@ -57,7 +57,7 @@ Feature: Register and test a Containerized Proxy
And I add avahi hosts in Containerized Proxy configuration

Scenario: Start Containerized Proxy services
When I start "uyuni-proxy-pod" service on "proxy"
When I start the "uyuni-proxy-pod" service on "proxy"
And I wait until "uyuni-proxy-pod" service is active on "proxy"
And I wait until "uyuni-proxy-httpd" service is active on "proxy"
And I wait until "uyuni-proxy-salt-broker" service is active on "proxy"
Expand Down Expand Up @@ -239,7 +239,7 @@ Feature: Register and test a Containerized Proxy
Then "containerized_proxy" should not be registered

Scenario: Cleanup: Stop Containerized Proxy services
When I stop "uyuni-proxy-pod" service on "proxy"
When I stop the "uyuni-proxy-pod" service on "proxy"

Scenario: Cleanup: Remove Containerized Proxy configuration
When I ensure folder "/etc/uyuni/proxy/*" doesn't exist on "proxy"
Expand All @@ -257,7 +257,7 @@ Feature: Register and test a Containerized Proxy
When I start salt-minion on "proxy"
And I run "spacewalk-proxy start" on "proxy"
# workaround for bsc#1205976
And I start "tftp" service on "proxy"
And I start the "tftp" service on "proxy"
And I wait until "squid" service is active on "proxy"
And I wait until "apache2" service is active on "proxy"
And I wait until "tftp" service is active on "proxy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,5 +433,5 @@ Feature: PXE boot a Retail terminal
And I wait until event "Apply highstate scheduled by admin" is completed

Scenario: Reset TFTP defaults
When I stop tftp on the proxy
When I stop the "tftp" service on "proxy"
And I reset tftp defaults on the proxy
12 changes: 1 addition & 11 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@
raise "Command Output #{@command_output} don't include #{arg1}" unless @command_output.include? arg1
end

When(/^I (start|stop|restart|reload|enable|disable) "([^"]*)" service on "([^"]*)"$/) do |action, service, host|
When(/^I (start|stop|restart|reload|enable|disable) the "([^"]*)" service on "([^"]*)"$/) do |action, service, host|
node = get_target(host)
node.run("systemctl #{action} #{service}", check_errors: true, verbose: true)
end
Expand Down Expand Up @@ -1518,16 +1518,6 @@
output.include? '9100/tcp 9117/tcp 9187/tcp'
end

When(/^I restart the "([^"]*)" service on "([^"]*)"$/) do |service, minion|
node = get_target(minion)
node.run("systemctl restart #{service}", check_errors: true, verbose: true)
end

When(/^I reload the "([^"]*)" service on "([^"]*)"$/) do |service, minion|
node = get_target(minion)
node.run("systemctl reload #{service}", check_errors: true, verbose: true)
end

When(/^I delete the system "([^"]*)" via spacecmd$/) do |minion|
node = get_system_name(minion)
command = "spacecmd -u admin -p admin -y system_delete #{node}"
Expand Down
4 changes: 0 additions & 4 deletions testsuite/features/step_definitions/retail_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ def compute_kiwi_profile_version(host)
end
end

When(/^I stop tftp on the proxy$/) do
get_target('proxy').run('systemctl stop tftp.service')
end

When(/^I set up the private network on the terminals$/) do
proxy = net_prefix + ADDRESSES['proxy']
# /etc/sysconfig/network/ifcfg-eth1 and /etc/resolv.conf
Expand Down

0 comments on commit ee22a42

Please sign in to comment.