Skip to content

Commit

Permalink
QE: Adding test that ensures that the correct installation and deleti…
Browse files Browse the repository at this point in the history
…on of packages

and patches can be done in a system groups and in a SSM
  • Loading branch information
Pablogoliva committed Feb 18, 2025
1 parent a9ec8e1 commit 0eb16e9
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 23 deletions.
128 changes: 105 additions & 23 deletions testsuite/features/secondary/allcli_system_group.feature
Original file line number Diff line number Diff line change
@@ -1,47 +1,127 @@
# Copyright (c) 2017-2024 SUSE LLC
# Copyright (c) 2017-2025 SUSE LLC
# Licensed under the terms of the MIT license.

@scope_visualization
Feature: Manage a group of systems

Scenario: Log in as org admin user
Given I am authorized
Given I am authorized for the "Admin" section
And I add "Fake-RPM-SUSE-Channel" channel
And I sync "Fake-RPM-SUSE-Channel" channel

Scenario: Pre-requisite: enable dummy packages to fake an installation
When I enable repository "test_repo_rpm_pool" on this "sle_minion"
And I refresh the metadata for "sle_minion"
And I install old package "andromeda-dummy-1.0" on this "sle_minion"
And I install old package "virgo-dummy-1.0" on this "sle_minion"

Scenario: Pre-requisite: ensure that errata are computed
When I follow the left menu "Admin > Task Schedules"
And I follow "errata-cache-default"
And I follow "errata-cache-bunch"
And I click on "Single Run Schedule"
Then I should see a "bunch was scheduled" text
And I wait until the table contains "FINISHED" or "SKIPPED" followed by "FINISHED" in its first rows

Scenario: Pre-requisite: ensure that fake channels were created
When I follow the left menu "Patches > Patch List > Relevant"
Then I should see an update in the list
When I wait until I see "andromeda-dummy" text, refreshing the page
Then I should see a "andromeda-dummy-6789" link
When I enter "virgo-dummy" as the filtered synopsis
And I click on the filter button
And I wait until I see "virgo-dummy" text
Then I should see a "virgo-dummy-3456" link

Scenario: Fail to create a group with only its name
When I follow the left menu "Systems > System Groups"
When I follow "Create Group"
And I follow "Create Group"
And I enter "new-systems-group" as "name"
And I click on "Create Group"
Then I should see a "Both name and description are required for System Groups." text

Scenario: Fail to create a group with only its description
When I follow the left menu "Systems > System Groups"
When I follow "Create Group"
And I follow "Create Group"
And I enter "My new group" as "description"
And I click on "Create Group"
Then I should see a "Both name and description are required for System Groups." text

Scenario: Create a group
When I follow the left menu "Systems > System Groups"
When I follow "Create Group"
And I follow "Create Group"
And I enter "new-systems-group" as "name"
And I enter "My new group" as "description"
And I click on "Create Group"
Then I should see a "System group new-systems-group created." text

Scenario: Add the SLE minion system to the group
When I follow the left menu "Systems > System Groups"
When I follow "new-systems-group"
And I follow "new-systems-group"
And I follow "Target Systems"
And I check the "sle_minion" client
And I click on "Add Systems"
Then I should see a "1 systems were added to new-systems-group server group." text

Scenario: Check that the SLE minion is part of the new group
Scenario: The SLE minion is part of the new group
Given I am on the Systems overview page of this "sle_minion"
When I follow "Groups" in the content area
Then I should see a "new-systems-group" text

Scenario: Apply a patch
When I follow the left menu "Systems > System Groups"
And I follow "new-systems-group"
And I follow first "Patches"
When I enter "virgo-dummy" as the filtered synopsis
And I click on the filter button
When I wait until I see "virgo-dummy-3456" text, refreshing the page
Then I should see a "virgo-dummy-3456" link
When I follow "virgo-dummy-3456"
And I follow first "Affected Systems"
And I check the "sle_minion" client
And I click on "Apply Patches"
And I click on "Confirm"
Then I should see a "Patch virgo-dummy-3456 has been scheduled for 1 system" text

Scenario: Apply a patch in the SSM
When I follow the left menu "Systems > System Set Manager > Overview"
And I follow first "Patches"
When I enter "virgo-dummy" as the filtered synopsis
And I click on the filter button
When I wait until I see "virgo-dummy-3456" text, refreshing the page
Then I should see a "virgo-dummy-3456" link
When I follow "virgo-dummy-3456"
And I follow first "Affected Systems"
And I check the "sle_minion" client
And I click on "Apply Patches"
And I click on "Confirm"
Then I should see a "Patch virgo-dummy-3456 has been scheduled for 1 system" text

Scenario: Install a package
When I follow the left menu "Systems > System Set Manager > Overview"
And I follow "Packages"
And I follow "Install"
Then I should see a "Fake-RPM-SUSE-Channel" text
When I follow "Fake-RPM-SUSE-Channel"
Then I should see a "andromeda-dummy-2.0-1.1" text
And I enter "andromeda-dummy" as the filtered package name
And I click on the filter button
When I check "andromeda-dummy-2.0-1.1" in the list
And I click on "Install Selected Packages"
And I click on "Confirm"
Then I should see a "Package installations are being scheduled, it may take several minutes for this to complete." text

Scenario: Delete a package
When I follow the left menu "Systems > System Set Manager > Overview"
And I follow "Packages"
And I follow "Remove"
And I enter "virgo-dummy" as the filtered package name
And I click on the filter button
And I check "virgo-dummy-1.0-1.2" in the list
And I click on "Remove Selected Packages"
And I click on "Confirm"
Then I should see a "Package removals are being scheduled, it may take several minutes for this to complete." text

@rhlike_minion
Scenario: Add the Red Hat-like minion to the group in a different way
When I follow the left menu "Systems > System Groups"
Expand All @@ -55,22 +135,22 @@ Feature: Manage a group of systems

Scenario: Add the new group to SSM
When I follow the left menu "Systems > System Groups"
When I click on "Use in SSM" in row "new-systems-group"
And I click on "Use in SSM" in row "new-systems-group"
Then I should see a "Selected Systems List" text
And I should see "rhlike_minion" as link
And I should see "sle_minion" as link

#container already has locale formula installed
@skip_if_containerized_server
Scenario: Install the locale formula package on the server
When I manually install the "locale" formula on the server
@skip_if_containerized_server
# container already has locale formula installed
Scenario: Install the locale formula package on the server
When I manually install the "locale" formula on the server

Scenario: I synchronize all Salt dynamic modules on "sle_minion"
When I synchronize all Salt dynamic modules on "sle_minion"
Scenario: I synchronize all Salt dynamic modules on "sle_minion"
When I synchronize all Salt dynamic modules on "sle_minion"

Scenario: New formula page is rendered for the system group
When I follow the left menu "Systems > System Groups"
When I follow "new-systems-group"
And I follow "new-systems-group"
And I follow "Formulas"
Then I should see a "Choose formulas:" text
And I should see a "General System Configuration" text
Expand All @@ -89,13 +169,6 @@ Feature: Manage a group of systems
And I should see a "Action Details" text
And I wait until I see "2 systems successfully completed this action." text, refreshing the page

Scenario: Remove SLE client from new group
Given I am on the Systems overview page of this "rhlike_minion"
When I follow "Groups"
And I check "new-systems-group" in the list
And I click on "Leave Selected Groups"
Then I should see a "1 system groups removed." text

Scenario: Remove SLE minion from new group
Given I am on the Systems overview page of this "sle_minion"
When I follow "Groups"
Expand All @@ -105,7 +178,7 @@ Feature: Manage a group of systems

# Red Hat-like minion is intentionally not removed from group

@skip_if_containerized_server
@skip_if_containerized_server
Scenario: Cleanup: uninstall formula from the server
When I manually uninstall the "locale" formula from the server

Expand All @@ -117,3 +190,12 @@ Feature: Manage a group of systems
Then I should see a "System group" text
And I should see a "new-systems-group" text
And I should see a "deleted" text

Scenario: Cleanup: regenerate search index for later tests
When I clean the search index on the server

Scenario: Cleanup: remove dummy packages
When I disable repository "test_repo_rpm_pool" on this "sle_minion" without error control
And I refresh the metadata for "sle_minion"
And I remove package "andromeda-dummy" from this "sle_minion" without error control
And I remove package "virgo-dummy" from this "sle_minion" without error control
5 changes: 5 additions & 0 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@
get_target('server').run("echo -e \"admin\nadmin\n\" | mgr-sync add channel #{channel}", buffer_size: 1_000_000)
end

When(/^I sync "([^"]*)" channel$/) do |channel|
get_target('server').run("echo -e \"admin\nadmin\n\" | mgr-sync sync --with-children #{channel}", buffer_size: 1_000_000)
end


When(/^I use spacewalk-common-channel to add channel "([^"]*)" with arch "([^"]*)"$/) do |child_channel, arch|
command = "spacewalk-common-channels -u admin -p admin -a #{arch} #{child_channel}"
$command_output, _code = get_target('server').run(command)
Expand Down

0 comments on commit 0eb16e9

Please sign in to comment.