From f3f906482d3300cf74cfe1cfe3f485fa40ee4ed2 Mon Sep 17 00:00:00 2001 From: Eric Bischoff Date: Wed, 5 Jun 2024 14:47:47 +0200 Subject: [PATCH] Choose correct profile --- .../secondary/srv_cobbler_distro.feature | 9 ++++++-- .../step_definitions/cobbler_steps.rb | 21 +++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/testsuite/features/secondary/srv_cobbler_distro.feature b/testsuite/features/secondary/srv_cobbler_distro.feature index b8218974a328..1594f3ec8115 100644 --- a/testsuite/features/secondary/srv_cobbler_distro.feature +++ b/testsuite/features/secondary/srv_cobbler_distro.feature @@ -167,8 +167,13 @@ Feature: Cobbler and distribution autoinstallation And I wait until file "/srv/tftpboot/pxelinux.0" exists on server Scenario: Trigger the creation of a cobbler system record - When I trigger cobbler system record on the "sle_minion" - And I wait until file "/srv/tftpboot/pxelinux.cfg/01-*" contains "inst.ks=" on server + When I clear the caches on the server + And I am on the Systems overview page of this "sle_minion" + And I follow "Provisioning" + And I click on profile "testprofile" + And I click on "Create PXE installation configuration" + Then I should see a "System record created" text + And I wait until file "/srv/tftpboot/pxelinux.cfg/01-*" contains "autoyast=" on server Scenario: Create a cobbler system record via API When I create a system record diff --git a/testsuite/features/step_definitions/cobbler_steps.rb b/testsuite/features/step_definitions/cobbler_steps.rb index 16f006c1bd11..7b9c7434d00f 100644 --- a/testsuite/features/step_definitions/cobbler_steps.rb +++ b/testsuite/features/step_definitions/cobbler_steps.rb @@ -62,19 +62,14 @@ end # cobbler reports -When(/^I trigger cobbler system record on the "([^"]*)"$/) do |host| - space = 'spacecmd -u admin -p admin' - get_target('server').run("#{space} clear_caches") - out, _code = get_target('server').run("#{space} system_details #{get_target(host).full_hostname}") - unless out.include? 'ssh-push-tunnel' - steps %( - Given I am authorized as "testing" with password "testing" - And I am on the Systems overview page of this "#{host}" - And I follow "Provisioning" - And I click on "Create PXE installation configuration" - Then I should see a "System record created" text - ) - end +When(/^I clear the caches on the server$/) do + node = get_target('server') + node.run('spacecmd -u admin -p admin clear_caches') +end + +When(/I click on profile "([^"]*)"$/) do |profile| + xpath_query = "//a[text()='#{profile}']/../../td[1]/input[@type='radio']" + find(:xpath, xpath_query).click end Then(/^the cobbler report should contain "([^"]*)" for "([^"]*)"$/) do |text, host|