diff --git a/testsuite/features/secondary/srv_cobbler_profile_ise.feature b/testsuite/features/secondary/srv_cobbler_profile_ise.feature index a3ea0c74317d..4d89579e8979 100644 --- a/testsuite/features/secondary/srv_cobbler_profile_ise.feature +++ b/testsuite/features/secondary/srv_cobbler_profile_ise.feature @@ -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" diff --git a/testsuite/features/step_definitions/api_common.rb b/testsuite/features/step_definitions/api_common.rb index 381b26a34cd7..71338c4e6e93 100644 --- a/testsuite/features/step_definitions/api_common.rb +++ b/testsuite/features/step_definitions/api_common.rb @@ -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 diff --git a/testsuite/features/support/namespaces/kickstart.rb b/testsuite/features/support/namespaces/kickstart.rb index 5488c8594466..f12f9a77c867 100644 --- a/testsuite/features/support/namespaces/kickstart.rb +++ b/testsuite/features/support/namespaces/kickstart.rb @@ -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