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

Test container fake scc #9572

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/acceptance_tests_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
required: true
type: string
env:
UYUNI_PROJECT: uyuni-project
UYUNI_PROJECT: jordimassaguerpla
UYUNI_VERSION: master
NO_AUTH_REGISTRY: no_auth_registry
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion java/code/src/com/suse/utils/Opt.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* in this software or its documentation.
*/
package com.suse.utils;

// TEST

import com.redhat.rhn.domain.product.Tuple2;

Expand Down
8 changes: 7 additions & 1 deletion testsuite/features/support/remote_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ def initialize(host, port: 22)
@target = ENV.fetch(ENV_VAR_BY_HOST[@host], nil).to_s.strip
# Remove /etc/motd, or any output from run will contain the content of /etc/motd
ssh('rm -f /etc/motd && touch /etc/motd', host: @target) unless @host == 'localhost'
out, _err, _code = ssh('hostname', host: @target)
out, _err, _code = ssh('echo $HOSTNAME', host: @target)
@hostname = out.strip
puts "DEBUG JORDI: hostname: #{@hostname}"
raise LoadError, "We can't connect to #{@host} through SSH." if @hostname.empty?

$named_nodes[host] = @hostname
if @host == 'server'
_out, _err, code = ssh('which mgrctl', host: @target)
@has_mgrctl = code.zero?
puts "DEBUG JORDI; has mgrctl in #{@target}" if @has_mgrctl
puts "DEBUG JORDI; has NO mgrctl in #{@target}" unless @has_mgrctl
# Remove /etc/motd inside the container, or any output from run will contain the content of /etc/motd
run('rm -f /etc/motd && touch /etc/motd')
out, _code = run('sed -n \'s/^java.hostname *= *\(.\+\)$/\1/p\' /etc/rhn/rhn.conf')
Expand Down Expand Up @@ -99,6 +102,9 @@ def scp_download(remote_path, local_path, host: @full_hostname)
# @param verbose [Boolean] Whether to log the output of the command in case of success.
# @return [Array<String, String, Integer>] The output, error, and exit code.
def run(cmd, runs_in_container: true, separated_results: false, check_errors: true, timeout: DEFAULT_TIMEOUT, successcodes: [0], buffer_size: 65_536, verbose: false)
puts "DEBUG!!!!!"
puts "has mgrctl" if @has_mgrctl
puts "NO mgrctl" unless @has_mgrctl
cmd_prefixed = @has_mgrctl && runs_in_container ? "mgrctl exec -i '#{cmd.gsub('\'', '\'"\'"\'')}'" : cmd
run_local(cmd_prefixed, separated_results: separated_results, check_errors: check_errors, timeout: timeout, successcodes: successcodes, buffer_size: buffer_size, verbose: verbose)
end
Expand Down
4 changes: 4 additions & 0 deletions testsuite/podman_runner/08_manager_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set -xe

src_dir=$(cd $(dirname "$0")/../.. && pwd -P)

sudo -i podman exec server bash -c "rpm -e hostname"
# mgrctl should not be installed in this container
sudo -i podman exec server bash -c "rm /usr/bin/mgrctl"

sudo -i podman exec server bash -c "/testsuite/podman_runner/provide-db-schema.sh"
sudo -i podman exec -e CERT_O="test_org" -e CERT_OU="test_ou" -e CERT_CITY="test_city" -e CERT_STATE="test_state" -e CERT_COUNTRY="DE" -e CERT_EMAIL="[email protected]" -e CERT_CNAMES="server" -e CERT_PASS="spacewalk" -e UYUNI_FQDN="server" -e MANAGER_USER="admin" -e MANAGER_PASS="spacewalk" -e MANAGER_ADMIN_EMAIL="[email protected]" -e MANAGER_MAIL_FROM="[email protected]" -e MANAGER_ENABLE_TFTP="n" -e MANAGER_DB_NAME="manager" -e MANAGER_DB_HOST="localhost" -e MANAGER_DB_PORT="5432" -e MANAGER_DB_USER="manager" -e MANAGER_DB_PASS="manager" -e MANAGER_DB_PROTOCOL="TCP" -e REPORT_DB_NAME="reportdb" -e REPORT_DB_USER="pythia_susemanager" -e REPORT_DB_PASS="pythia_susemanager" -e EXTERNALDB_ADMIN_USER="" -e EXTERNALDB_ADMIN_PASS="" -e EXTERNALDB_PROVIDER="" -e ISS_PARENT="" -e ACTIVATE_SLP="" -e SCC_USER="" -e SCC_PASS="" server bash -c /usr/lib/susemanager/bin/mgr-setup
sudo -i podman exec server bash -c "/usr/bin/spacewalk-schema-upgrade -y"
Expand Down
Loading