Skip to content

Commit

Permalink
QE: Get rid of tools pool repos
Browse files Browse the repository at this point in the history
  • Loading branch information
srbarrios committed Jan 23, 2025
1 parent 2024f09 commit 25fbeae
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 84 deletions.
20 changes: 4 additions & 16 deletions testsuite/features/secondary/min_ansible_control_node.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 SUSE LLC
# Copyright (c) 2021-2025 SUSE LLC
# Licensed under the terms of the MIT license.

@scope_ansible
Expand All @@ -9,17 +9,12 @@ Feature: Operate an Ansible control node in a normal minion

Scenario: Pre-requisite: Deploy test playbooks and inventory file
When I deploy testing playbooks and inventory files to "sle_minion"
@skip_if_github_validation
@susemanager
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_update_repo tools_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"

# TODO: Check why tools_update_repo is not available on the openSUSE minion
# TODO: Check why tools_update_repo is not available on the openSUSE minion
@skip_if_github_validation
@uyuni
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_pool_repo os_pool_repo" on this "sle_minion"
When I enable repository "os_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"

Scenario: Enable "Ansible control node" system type
Expand Down Expand Up @@ -90,16 +85,9 @@ Feature: Operate an Ansible control node in a normal minion
And I remove package "orion-dummy" from this "sle_minion" without error control
And I remove "/tmp/file.txt" from "sle_minion"

@skip_if_github_validation
@susemanager
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "sle_minion"
When I disable the repositories "tools_update_repo tools_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"

@skip_if_github_validation
@uyuni
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "sle_minion"
When I disable the repositories "tools_pool_repo os_pool_repo" on this "sle_minion"
When I disable repository "os_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"
8 changes: 0 additions & 8 deletions testsuite/features/secondary/min_deblike_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ Feature: Monitor SUMA environment with Prometheus on a Debian-like Salt minion
As an authorized user
I want to enable Prometheus exporters

@skip_if_github_validation
Scenario: Pre-requisite: enable Prometheus exporters repository on the Debian-like minion
When I enable the necessary repositories before installing Prometheus exporters on this "deblike_minion"

Scenario: Log in as org admin user
Given I am authorized

Expand Down Expand Up @@ -69,7 +65,3 @@ Feature: Monitor SUMA environment with Prometheus on a Debian-like Salt minion
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" is completed

@skip_if_github_validation
Scenario: Cleanup: disable Prometheus exporters repository on the Debian-like minion
When I disable the necessary repositories before installing Prometheus exporters on this "deblike_minion" without error control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2023 SUSE LLC
# Copyright (c) 2017-2025 SUSE LLC
# Licensed under the terms of the MIT license.

@scope_openscap
Expand All @@ -15,7 +15,6 @@ Feature: OpenSCAP audit of Debian-like Salt minion
@skip_if_github_validation
Scenario: Enable all the necessary repositories for OpenSCAP on Debian-like minion
When I enable Debian-like "universe" repository on "deblike_minion"
And I enable the repositories "tools_update_repo tools_pool_repo" on this "deblike_minion"

@skip_if_github_validation
Scenario: Install the OpenSCAP packages on the Debian-like minion
Expand Down Expand Up @@ -83,5 +82,4 @@ Feature: OpenSCAP audit of Debian-like Salt minion

@skip_if_github_validation
Scenario: Cleanup: remove all the necessary repositories for OpenSCAP on Debian-like minion
When I disable the repositories "tools_update_repo tools_pool_repo" on this "deblike_minion"
And I disable Debian-like "universe" repository on "deblike_minion"
13 changes: 2 additions & 11 deletions testsuite/features/secondary/min_monitoring.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 SUSE LLC
# Copyright (c) 2022-2025 SUSE LLC
# Licensed under the terms of the MIT license.
# This feature depends on:
# - features/secondary/srv_monitoring.feature : As this feature disable/re-enable monitoring capabilities
Expand All @@ -11,11 +11,6 @@ Feature: Monitor SUMA environment with Prometheus on a SLE Salt minion
As an authorized user
I want to enable Prometheus exporters

@skip_if_github_validation
Scenario: Pre-requisite: enable Prometheus exporters repository on the minion
When I enable the necessary repositories before installing Prometheus exporters on this "sle_minion"
And I refresh the metadata for "sle_minion"

Scenario: Log in as org admin user
Given I am authorized

Expand Down Expand Up @@ -56,7 +51,7 @@ Feature: Monitor SUMA environment with Prometheus on a SLE Salt minion
Then I should see a "Applying the highstate has been scheduled." text
And I wait until event "Apply highstate scheduled" is completed

@skip_if_github_validation
@skip_if_github_validation
Scenario: Wait for services
When I wait until "prometheus" service is active on "sle_minion"
And I wait until "node" exporter service is active on "sle_minion"
Expand All @@ -82,7 +77,3 @@ Feature: Monitor SUMA environment with Prometheus on a SLE Salt minion
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" is completed

@skip_if_github_validation
Scenario: Cleanup: disable Prometheus exporters repository
When I disable the necessary repositories before installing Prometheus exporters on this "sle_minion" without error control
16 changes: 4 additions & 12 deletions testsuite/features/secondary/min_rhlike_monitoring.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 SUSE LLC
# Copyright (c) 2022-2025 SUSE LLC
# Licensed under the terms of the MIT license.
# This feature depends on:
# - features/secondary/srv_monitoring.feature: as this feature disables/re-enables monitoring capabilities
Expand All @@ -12,10 +12,6 @@ Feature: Monitor SUMA environment with Prometheus on a Red Hat-like Salt minion
As an authorized user
I want to enable Prometheus exporters

@skip_if_github_validation
Scenario: Pre-requisite: enable Prometheus exporters repository on the Red Hat-like minion
When I enable the necessary repositories before installing Prometheus exporters on this "rhlike_minion"

Scenario: Log in as org admin user
Given I am authorized

Expand All @@ -39,14 +35,14 @@ Feature: Monitor SUMA environment with Prometheus on a Red Hat-like Salt minion
And I click on "Save"
Then I should see a "Formula saved" text

@skip_if_github_validation
@skip_if_github_validation
Scenario: Apply highstate for Prometheus exporters on the Red Hat-like minion
When I follow "States" in the content area
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" is completed

@skip_if_github_validation
@skip_if_github_validation
Scenario: Wait for service
When I wait until "node" exporter service is active on "rhlike_minion"
And I wait until "apache" exporter service is active on "rhlike_minion"
Expand All @@ -63,13 +59,9 @@ Feature: Monitor SUMA environment with Prometheus on a Red Hat-like Salt minion
And I click on "Save"
Then I wait until I see "Formula saved" text

@skip_if_github_validation
@skip_if_github_validation
Scenario: Cleanup: apply highstate after test monitoring on the Red Hat-like minion
When I follow "States" in the content area
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" is completed

@skip_if_github_validation
Scenario: Cleanup: disable Prometheus exporters repository on the Red Hat-like minion
When I disable the necessary repositories before installing Prometheus exporters on this "rhlike_minion" without error control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2024 SUSE LLC
# Copyright (c) 2017-2025 SUSE LLC
# Licensed under the terms of the MIT license.

@scope_openscap
Expand All @@ -15,7 +15,6 @@ Feature: OpenSCAP audit of Red Hat-like Salt minion
@skip_if_github_validation
Scenario: Enable repositories for openSCAP on the Red Hat-like minion
When I enable the repositories "Rocky-BaseOS Rocky-AppStream" on this "rhlike_minion"
And I enable the repositories "tools_update_repo tools_pool_repo" on this "rhlike_minion"
And I refresh the metadata for "rhlike_minion"

@skip_if_github_validation
Expand Down Expand Up @@ -82,7 +81,6 @@ Feature: OpenSCAP audit of Red Hat-like Salt minion
Scenario: Cleanup: remove the OpenSCAP packages from the Red Hat-like minion
When I remove OpenSCAP dependencies from "rhlike_minion"
And I disable repository "Rocky-BaseOS" on this "rhlike_minion"
And I disable the repositories "tools_update_repo tools_pool_repo" on this "rhlike_minion"

@skip_if_github_validation
Scenario: Cleanup: restore the base channel for the Red Hat-like minion
Expand Down
17 changes: 3 additions & 14 deletions testsuite/features/secondary/minssh_ansible_control_node.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 SUSE LLC
# Copyright (c) 2021-2025 SUSE LLC
# Licensed under the terms of the MIT license.

@skip_if_github_validation
Expand All @@ -13,15 +13,10 @@ Feature: Operate an Ansible control node in SSH minion
Scenario: Pre-requisite: Deploy test playbooks and inventory file
When I deploy testing playbooks and inventory files to "ssh_minion"

@susemanager
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_update_repo tools_pool_repo" on this "ssh_minion"
And I refresh the metadata for "ssh_minion"

# TODO: Check why tools_update_repo is not available on the openSUSE minion
@uyuni
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_pool_repo os_pool_repo" on this "ssh_minion"
When I enable repository "os_pool_repo" on this "ssh_minion"
And I refresh the metadata for "ssh_minion"

Scenario: Enable "Ansible control node" system type
Expand Down Expand Up @@ -92,14 +87,8 @@ Feature: Operate an Ansible control node in SSH minion
And I remove package "orion-dummy" from this "ssh_minion" without error control
And I remove "/tmp/file.txt" from "ssh_minion"

@susemanager
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "ssh_minion"
When I disable the repositories "tools_update_repo tools_pool_repo" on this "ssh_minion"
And I refresh the metadata for "ssh_minion"

@uyuni
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "ssh_minion"
When I disable the repositories "tools_pool_repo os_pool_repo" on this "ssh_minion"
When I disable repository "os_pool_repo" on this "ssh_minion"
And I refresh the metadata for "ssh_minion"
17 changes: 0 additions & 17 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1296,23 +1296,6 @@
end
end

When(/^I (enable|disable) the necessary repositories before installing Prometheus exporters on this "([^"]*)"((?: without error control)?)$/) do |action, host, error_control|
node = get_target(host)
os_version = node.os_version.gsub('-SP', '.')
os_family = node.os_family
# TODO: Check why tools_update_repo is not available on the openSUSE minion
repositories = os_family.match?(/^opensuse/) ? 'tools_pool_repo' : 'tools_pool_repo tools_update_repo'
if (os_family.match?(/^opensuse/) || os_family.match?(/^sles/)) && (product != 'Uyuni')
repositories.concat(' tools_additional_repo')
# Needed because in SLES15SP3 and openSUSE 15.3 and higher, firewalld will replace this package.
# But the tools_update_repo's priority doesn't allow to cope with the obsoletes option from firewalld.
if os_version.to_f >= 15.3
node.run('zypper addlock -r tools_additional_repo firewalld-prometheus-config')
end
end
step %(I #{action} the repositories "#{repositories}" on this "#{host}"#{error_control})
end

When(/^I apply "([^"]*)" local salt state on "([^"]*)"$/) do |state, host|
node = get_target(host)
salt_call = use_salt_bundle ? 'venv-salt-call' : 'salt-call'
Expand Down

0 comments on commit 25fbeae

Please sign in to comment.