Skip to content

Commit

Permalink
QE: Add Cobbler profile tests
Browse files Browse the repository at this point in the history
This will add Cobbler profile tests, specifially for testing 2 common
L3s.

See SUSE/spacewalk#20409

Signed-off-by: Dominik Gedon <dgedon@suse.de>
  • Loading branch information
nodeg committed Feb 20, 2023
1 parent c0f5abe commit 0c85371
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 5 deletions.
4 changes: 2 additions & 2 deletions testsuite/features/secondary/proxy_cobbler_pxeboot.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Feature: PXE boot a terminal with Cobbler
And I follow "Autoinstallation File"
Then I should see a "SLE-15-SP4-TFTP" text

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
Expand Down
39 changes: 39 additions & 0 deletions testsuite/features/secondary/srv_cobbler_profile.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2023 SUSE LLC.
# Licensed under the terms of the MIT license.

# TODO
# Switch the second Profile over to the first Distro
# Now during the cobbler sync there should be a ValueError in the Cobbler Log with the following error message:
# [<task id>] <date stamp> - INFO | Exception value: Child with the name "<child name>" of parent object "<parent name>" did not exist!


# To detect the second bsc correctly one needs to account that the task ID is the identical one as the one you started.
# To be able to not destroy the whole sumaform deployment, it would be cool if this test has a very thorough cleanup in SUMA AND Cobbler.

@scope_cobbler
Feature: Cobbler parent checks
Tests for occuring Cobbler issue (bsc#1207417)

Scenario: Log in as testing user
Given I am authorized as "testing" with password "testing"

Scenario: Create Cobbler distributions via the API
Given cobblerd is running
And I create distro "parent_distro1" as user "testing" with password "testing"
And I create distro "parent_distro2" as user "testing" with password "testing"

Scenario: Create a Cobbler profile via the API
Given cobblerd is running
And distro "parent_distro1" exists
And distro "parent_distro2" exists
And I create profile "parent_profile1" for distro "parent_distro1" as user "testing" with password "testing"
And I create profile "parent_profile2" for distro "parent_distro2" as user "testing" with password "testing"

Scenario: Create a Cobbler system via the API
Given cobblerd is running
And profile "iseprofile" exists
When I create system "isesystem" for profile "iseprofile" as user "testing" with password "testing"

Scenario: Execute a Cobbler sync
Given cobblerd is running
And I run Cobbler sync without error checking
31 changes: 31 additions & 0 deletions testsuite/features/secondary/srv_cobbler_profile_ise.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2023 SUSE LLC.
# Licensed under the terms of the MIT license.

# TODO
# Use XML-RPC SUMA API setVariables; XML-RPC should return an error here

@scope_cobbler
Feature: Cobbler editing profiles results in ISE
Tests for occuring Cobbler issue (bsc#1207532)

Scenario: Log in as testing user
Given I am authorized as "testing" with password "testing"

Scenario: Create a Cobbler distribution via the API
Given cobblerd is running
When I create distro "isedistro" as user "testing" with password "testing"

Scenario: Create a Cobbler profile via the API
Given cobblerd is running
And distro "isedistro" exists
When I create profile "iseprofile" for distro "isedistro" as user "testing" with password "testing"

Scenario: Create a Cobbler system via the API
Given cobblerd is running
And profile "iseprofile" exists
When I create system "isesystem" for profile "iseprofile" as user "testing" with password "testing"

Scenario: Check Cobbler created distro and profile
When I follow the left menu "Systems > Autoinstallation > Profiles"
Then I should see a "iseprofile" text
And I should see a "isedistro" text
10 changes: 7 additions & 3 deletions testsuite/features/step_definitions/cobbler_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@
raise 'File injection failed' unless return_codes.all?(&:zero?)
end

When(/^I synchronize the tftp configuration on the proxy with the server$/) do
out, _code = $server.run('cobbler sync')
raise 'cobbler sync failed' if out.include? 'Push failed'
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
2 changes: 2 additions & 0 deletions testsuite/run_sets/secondary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@
- 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
- features/secondary/srv_cobbler_profile.feature
## Secondary features END ##

0 comments on commit 0c85371

Please sign in to comment.