Skip to content

Commit

Permalink
Revert update_ca method for the controller
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
  • Loading branch information
nodeg committed Oct 20, 2023
1 parent 1971369 commit 1a5336a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@
end

# Update the server CA certificate since it changed, otherwise all API and browser uses will fail
update_ca('controller')
update_controller_ca

# Reset the API client to take the new CA into account
reset_api_client
Expand Down
19 changes: 5 additions & 14 deletions testsuite/features/support/commonlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,12 @@ def file_inject(node, local_file, remote_file)
end

# This function updates the server certificate on the controller node
def update_ca(node)
def update_controller_ca
server_ip = get_target('server').public_ip
server_name = get_target('server').full_hostname

case node
when 'proxy'
command = "wget http://#{server_ip}/pub/RHN-ORG-TRUSTED-SSL-CERT -O /etc/pki/trust/anchors/RHN-ORG-TRUSTED-SSL-CERT; " \
'update-ca-certificates;'
get_target('proxy').run('rm /etc/pki/trust/anchors/RHN-ORG-TRUSTED-SSL-CERT', verbose: true)
get_target('proxy').run(command, verbose: true)
else
# controller
puts `rm /etc/pki/trust/anchors/*;
wget http://#{server_ip}/pub/RHN-ORG-TRUSTED-SSL-CERT -O /etc/pki/trust/anchors/#{server_name}.cert &&
update-ca-certificates &&
certutil -d sql:/root/.pki/nssdb -A -t TC -n "susemanager" -i /etc/pki/trust/anchors/#{server_name}.cert`
end
puts `rm /etc/pki/trust/anchors/*;
wget http://#{server_ip}/pub/RHN-ORG-TRUSTED-SSL-CERT -O /etc/pki/trust/anchors/#{server_name}.cert &&
update-ca-certificates &&
certutil -d sql:/root/.pki/nssdb -A -t TC -n "susemanager" -i /etc/pki/trust/anchors/#{server_name}.cert`
end

0 comments on commit 1a5336a

Please sign in to comment.