Skip to content

Commit

Permalink
Update kickstart namespace
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 23, 2023
1 parent 7bccea2 commit b35d4c0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions testsuite/features/secondary/srv_cobbler_profile_ise.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Feature: Cobbler editing profiles results in ISE
Scenario: Change variables
# TODO: Use XML-RPC SUMA API setVariables
# XML-RPC should return an error here
And I set variable for kickstart profile "fedora_kickstart_profile"
| inst.repo | http://127.0.0.1 |
| self_update | http://127.0.0.1 |

Scenario: Cleanup: remove created distros and profiles
And I remove system "isesystem" as user "testing" with password "testing"
Expand Down
5 changes: 5 additions & 0 deletions testsuite/features/step_definitions/api_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,8 @@ def wait_action_complete(actionid, timeout: DEFAULT_TIMEOUT)
Then(/^"([^"]*)" should be present in the result$/) do |profile_name|
assert($output.select { |p| p['name'] == profile_name }.count == 1)
end

When(/^I set variable for kickstart profile "([^"]*)"$/) do |profile, values|
variable = values.hashes
_command = $api_test.kickstart.profile.set_variables(profile, variable)
end
24 changes: 24 additions & 0 deletions testsuite/features/support/namespaces/kickstart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,33 @@ class NamespaceKickstart
def initialize(api_test)
@test = api_test
@tree = NamespaceKickstartTree.new(api_test)
@profile = NamespaceKickstartProfile.new(api_test)
end

attr_reader :tree
attr_reader :profile
end

# Kickstart.profile namespace
class NamespaceKickstartProfile
##
# It initializes the function.
#
# Args:
# api_test: This is the test object that is passed to the initialize method.
def initialize(api_test)
@test = api_test
end

##
# Associates list of kickstart variables with the specified kickstart profile
#
# Args:
# profile: The name of the kickstart profile
# variables: A list of variables to set
def set_variables(profile, variables)
@test.call('kickstart.profile.setVariables', sessionKey: @test.token, ksLabel: profile, variables: variables)
end
end

# "kickstart.tree" namespace
Expand Down

0 comments on commit b35d4c0

Please sign in to comment.