Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mgrpxy tool before installing the containerized proxy. #9540

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Feature: Setup containerized proxy
Scenario: Wait until the proxy host appears
When I wait until onboarding is completed for "proxy"

Scenario: Upgrade mgrpxy tool
Then I upgrade "proxy" with the last "mgrpxy" version
maximenoel8 marked this conversation as resolved.
Show resolved Hide resolved
And I reboot the "proxy" minion through the web UI
maximenoel8 marked this conversation as resolved.
Show resolved Hide resolved

Scenario: Generate containerized proxy configuration
When I generate the configuration "/tmp/proxy_container_config.tar.gz" of containerized proxy on the server
And I copy the configuration "/tmp/proxy_container_config.tar.gz" of containerized proxy from the server to the proxy
Expand Down
12 changes: 12 additions & 0 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1769,3 +1769,15 @@
occurences = count.to_i
raise "The word #{word} occured #{occurences} times, which is more more than #{threshold} times in file #{path}" if occurences > threshold
end

Then(/^I upgrade "([^"]*)" with the last "([^"]*)" version$/) do |host, package|
system_name = get_system_name(host)
last_event_before_upgrade = get_last_event(host)
last_event = last_event_before_upgrade
trigger_upgrade(system_name, package)
repeat_until_timeout(timeout: DEFAULT_TIMEOUT, message: 'Waiting for the new event to be created') do
last_event = get_last_event(host)
break if last_event['id'] > last_event_before_upgrade['id'] && (last_event['summary'].include? 'Package Install/Upgrade')
end
wait_action_complete(last_event['id'])
end
17 changes: 17 additions & 0 deletions testsuite/features/support/commonlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -751,3 +751,20 @@ def api_unlock
file.flock(File::LOCK_UN)
end
end

# Function to get the highest event ID (latest event)
#
# @param host String The hostname of the system from requested
def get_last_event(host)
node = get_target(host)
system_id = get_system_id(node)
$api_test.system.get_event_history(system_id, 0, 1)[0]
end

# Function to trigger the upgrade command
#
# @param hostname String The hostname of the system from requested
# @param package String The package name where it will trigger an upgrade
def trigger_upgrade(hostname, package)
get_target('server').run("spacecmd -u admin -p admin system_upgradepackage #{hostname} #{package} -y", check_errors: true)
maximenoel8 marked this conversation as resolved.
Show resolved Hide resolved
end
Loading