Skip to content

Commit

Permalink
Update test and add cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Gedon <dgedon@suse.de>
  • Loading branch information
nodeg committed Feb 22, 2023
1 parent 8280607 commit 7bccea2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
15 changes: 9 additions & 6 deletions testsuite/features/secondary/srv_cobbler_profile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# Depends on srv_cobbler_distro.feature where Cobbler profiles are copied
# over to the server

# TODO
# - proper cleanup

@scope_cobbler
Feature: Cobbler parent checks
Tests for occuring Cobbler issue (bsc#1207417)
Expand All @@ -28,9 +25,15 @@ Feature: Cobbler parent checks
And I create profile "parent_profile2" for distro "parent_distro2" as user "testing" with password "testing"

Scenario: Execute a Cobbler sync and modify second profile
# 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.
Given cobblerd is running
And I run Cobbler sync without error checking
And I set "parent_distro1" as value of attribute "distro" for profile "parent_profile2" as user "testing" with password "testing"
# 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.

Scenario: Cleanup: remove created distros and profiles
And I remove profile "parent_profile1" as user "testing" with password "testing"
And I remove profile "parent_profile2" as user "testing" with password "testing"
And I remove distro "parent_distro1" as user "testing" with password "testing"
And I remove distro "parent_distro2" as user "testing" with password "testing"
13 changes: 9 additions & 4 deletions testsuite/features/secondary/srv_cobbler_profile_ise.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Depends on srv_cobbler_distro.feature where Cobbler profiles are copied
# over to the server

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

@scope_cobbler
Feature: Cobbler editing profiles results in ISE
Tests for occuring Cobbler issue (bsc#1207532)
Expand All @@ -34,3 +30,12 @@ Feature: Cobbler editing profiles results in ISE
When I follow the left menu "Systems > Autoinstallation > Profiles"
Then I should see a "iseprofile" text
And I should see a "isedistro" text

Scenario: Change variables
# TODO: Use XML-RPC SUMA API setVariables
# XML-RPC should return an error here

Scenario: Cleanup: remove created distros and profiles
And I remove system "isesystem" as user "testing" with password "testing"
And I remove profile "iseprofile" as user "testing" with password "testing"
And I remove distro "isedistro" as user "testing" with password "testing"
12 changes: 12 additions & 0 deletions testsuite/features/step_definitions/cobbler_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
ct.system_remove(system)
end

When(/^I remove profile "([^"]*)" as user "([^"]*)" with password "([^"]*)"$/) do |system, user, pwd|
ct = ::CobblerTest.new
ct.login(user, pwd)
ct.profile_remove(system)
end

When(/^I remove distro "([^"]*)" as user "([^"]*)" with password "([^"]*)"$/) do |system, user, pwd|
ct = ::CobblerTest.new
ct.login(user, pwd)
ct.distro_remove(system)
end

When(/^I remove kickstart profiles and distros$/) do
host = $server.full_hostname
# -------------------------------
Expand Down

0 comments on commit 7bccea2

Please sign in to comment.