Skip to content

Commit

Permalink
Slit feature up in UI an XML-RPC tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Gedon <dominik@gedon.org>
  • Loading branch information
nodeg committed Feb 23, 2023
1 parent c537ded commit b98c905
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 11 deletions.
54 changes: 44 additions & 10 deletions testsuite/features/secondary/srv_cobbler_profile_ise.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,61 @@ Feature: Cobbler editing profiles results in ISE
Scenario: Copy cobbler profiles on the server
When I copy autoinstall mocked files on server

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 distribution via the UI
When I follow the left menu "Systems > Autoinstallation > Distributions"
And I follow "Create Distribution"
When I enter "isedistro_ui" as "label"
And I enter "/var/autoinstall/Fedora_12_i386/" as "basepath"
And I select "Fedora" from "installtype"
And I click on "Create Autoinstallable Distribution"
Then I should see a "Autoinstallable Distributions" text
And I should see a "isedistro_ui" link

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 profile via the UI
When I follow the left menu "Systems > Autoinstallation > Profiles"
And I follow "Create Kickstart Profile"
When I enter "iseprofile_ui" as "kickstartLabel"
And I click on "Next"
And I click on "Next"
And I enter "linux" as "rootPassword"
And I enter "linux" as "rootPasswordConfirm"
And I click on "Finish"
Then I should see a "Autoinstallation: iseprofile_ui" text
And I should see a "Autoinstallation Details" link

# 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
Scenario: Check Cobbler created distro and profile via the UI
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
Scenario: Change profile variables using the UI
# TODO:

Scenario: Create a Cobbler distribution via the XML-RPC API
# TODO:

Scenario: Create a Cobbler profile via the XML-RPC API
# TODO:

Scenario: Create a Cobbler system via the XML-RPC API
# TODO:
And I create a system record

Scenario: Change profile variables using the XML-RPC API
# XML-RPC should return an error here
And I set the following variables for the kickstart profile "fedora_kickstart_profile"
| inst.repo | http://127.0.0.1 |
Expand Down
2 changes: 1 addition & 1 deletion testsuite/features/step_definitions/api_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def wait_action_complete(actionid, timeout: DEFAULT_TIMEOUT)
assert($output.select { |p| p['name'] == profile_name }.count == 1)
end

When(/^I set the following variables for the kickstart profile "([^"]*)"$/) do |profile, values|
When(/^I set the following variables for the kickstart profile "([^"]*)" via XML-RPC$/) do |profile, values|
# this works only with a 2 column table where the key is in the left column
variables = values.rows_hash
_command = $api_test.kickstart.profile.set_variables(profile, variables)
Expand Down
28 changes: 28 additions & 0 deletions testsuite/features/support/namespaces/kickstart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@ def initialize(api_test)
@test = api_test
end

##
# Create a new kickstart profile using the default download URL for the kickstartable tree and kickstart host
# specified.
# * @param profileLabel Label for the new kickstart profile.
# * @param virtualizationType Virtualization type, or none.
# * @param kickstartableTreeLabel Label of a kickstartable tree.
# * @param kickstartHost Kickstart hostname (of a server or proxy) used to
# * construct the default download URL for the new kickstart profile.
# * @param rootPassword Root password.
# * @param updateType Set the automatic ks tree update strategy
# * for the profile. Valid choices are "none" or "all".
# Args:
# profile: The name of the kickstart profile
# variables: A list of variables to set
def create_profile(profile, variables)
@test.call('kickstart.profile.createProfile', sessionKey: @test.token, ksLabel: profile, variables: variables)
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

##
# Associates list of kickstart variables with the specified kickstart profile
#
Expand Down

0 comments on commit b98c905

Please sign in to comment.