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

USHIFT-3784: Removed manage_vm_connections.sh and PUBLIC_IP #3775

Merged
merged 3 commits into from
Aug 19, 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
3 changes: 0 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ The test scenario tool uses several global settings that may be
configured before the tool is used in `./test/scenario_settings.sh`.
You can copy `./test/scenario_settings.sh.example` as a starting point.

`PUBLIC_IP` -- The public IP of the hypervisor, when accessing VMs
remotely through port-forwarded connections.

`SSH_PUBLIC_KEY` -- The name of the public key file to use for
providing password-less access to the VMs.

Expand Down
243 changes: 0 additions & 243 deletions test/bin/manage_vm_connections.sh

This file was deleted.

30 changes: 10 additions & 20 deletions test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ WEB_SERVER_URL="http://${VM_BRIDGE_IP}:${WEB_SERVER_PORT}"
BOOTC_REGISTRY_URL="${VM_BRIDGE_IP}:5000"
PULL_SECRET="${PULL_SECRET:-${HOME}/.pull-secret.json}"
PULL_SECRET_CONTENT="$(jq -c . "${PULL_SECRET}")"
PUBLIC_IP=${PUBLIC_IP:-""} # may be overridden in global settings file
VM_BOOT_TIMEOUT=1200 # Overall total boot times are around 15m
VM_GREENBOOT_TIMEOUT=1800 # Greenboot readiness may take up to 15-30m depending on the load
ENABLE_REGISTRY_MIRROR=${ENABLE_REGISTRY_MIRROR:-false}
Expand Down Expand Up @@ -281,7 +280,6 @@ prepare_kickstart() {
-e "s|REPLACE_PULL_SECRET|${PULL_SECRET_CONTENT}|g" \
-e "s|REPLACE_HOST_NAME|${vm_hostname}|g" \
-e "s|REPLACE_REDHAT_AUTHORIZED_KEYS|${REDHAT_AUTHORIZED_KEYS}|g" \
-e "s|REPLACE_PUBLIC_IP|${PUBLIC_IP}|g" \
-e "s|REPLACE_FIPS_ENABLED|${fips_enabled}|g" \
-e "s|REPLACE_ENABLE_MIRROR|${ENABLE_REGISTRY_MIRROR}|g" \
-e "s|REPLACE_MIRROR_HOSTNAME|${hostname}|g" \
Expand Down Expand Up @@ -636,20 +634,13 @@ launch_vm() {
# Record the IP of this VM so our caller can use it to configure
# port forwarding and the firewall.
set_vm_property "${vmname}" "ip" "${ip}"
# Record the _public_ IP of the VM so the test suite can use it to
# access the host. This is useful when the public IP is the
# hypervisor forwarding connections. If we have no PUBLIC_IP, use
# the VM IP and assume a local connection.
if [ -n "${PUBLIC_IP}" ]; then
set_vm_property "${vmname}" "public_ip" "${PUBLIC_IP}"
else
set_vm_property "${vmname}" "public_ip" "${ip}"
# Set the defaults for the various ports so that connections
# from the hypervisor to the VM work.
set_vm_property "${vmname}" "ssh_port" "22"
set_vm_property "${vmname}" "api_port" "6443"
set_vm_property "${vmname}" "lb_port" "5678"
fi

# Set the defaults for the various ports so that connections
# from the hypervisor to the VM work.
set_vm_property "${vmname}" "ssh_port" "22"
set_vm_property "${vmname}" "api_port" "6443"
set_vm_property "${vmname}" "lb_port" "5678"


if wait_for_ssh "${ip}"; then
record_junit "${vmname}" "ssh-access" "OK"
Expand Down Expand Up @@ -770,7 +761,7 @@ stress_testing() {
local -r condition="${3}"
local -r value="${4}"

local -r ssh_host="$(get_vm_property "${vmname}" public_ip)"
local -r ssh_host="$(get_vm_property "${vmname}" ip)"
local -r ssh_user=redhat
local -r ssh_port="$(get_vm_property "${vmname}" ssh_port)"
local -r ssh_pkey="${SSH_PRIVATE_KEY:-}"
Expand Down Expand Up @@ -827,7 +818,7 @@ run_tests() {

local variable_file
if [ "${test_is_online}" == "true" ]; then
for p in "ssh_port" "api_port" "lb_port" "public_ip" "ip"; do
for p in "ssh_port" "api_port" "lb_port" "ip"; do
f="$(vm_property_filename "${vmname}" "${p}")"
if [ ! -f "${f}" ]; then
error "Cannot read ${f}"
Expand All @@ -839,7 +830,6 @@ run_tests() {
local -r ssh_port=$(get_vm_property "${vmname}" "ssh_port")
local -r api_port=$(get_vm_property "${vmname}" "api_port")
local -r lb_port=$(get_vm_property "${vmname}" "lb_port")
local -r public_ip=$(get_vm_property "${vmname}" "public_ip")
local -r vm_ip=$(get_vm_property "${vmname}" "ip")

local variable_file="${SCENARIO_INFO_DIR}/${SCENARIO}/variables.yaml"
Expand All @@ -849,7 +839,7 @@ run_tests() {
VM_IP: ${vm_ip}
API_PORT: ${api_port}
LB_PORT: ${lb_port}
USHIFT_HOST: ${public_ip}
USHIFT_HOST: ${vm_ip}
USHIFT_USER: redhat
SSH_PRIV_KEY: "${SSH_PRIVATE_KEY:-}"
SSH_PORT: ${ssh_port}
Expand Down
3 changes: 0 additions & 3 deletions test/kickstart-templates/includes/post-microshift.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ else
MAIN_HOST_IP="$(hostname -I | awk '{print $1}')"
echo " - ${MAIN_HOST_IP}" >>/etc/microshift/config.yaml
fi
if [ -n "REPLACE_PUBLIC_IP" ]; then
echo " - REPLACE_PUBLIC_IP" >>/etc/microshift/config.yaml
fi
7 changes: 0 additions & 7 deletions test/scenario_settings.sh.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/bash

# Set the PUBLIC_IP to the IP address used to access the hypervisor.
# Enable this setting to connect to VMs via the specified IP using
# port-forwarded connections. Otherwise, IP addresses assigned by
# libvirt are used for accessing VMs.
# shellcheck disable=SC2034
#PUBLIC_IP=1.2.3.4

# Set SSH_PUBLIC_KEY to the filename of the ssh key to be used to
# access the VMs created.
# shellcheck disable=SC2034
Expand Down
4 changes: 2 additions & 2 deletions test/scenarios/periodics/el94-src@cncf-conformance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ TIMEOUT_TEST=7400
TIMEOUT_RESULTS=600

prepare_hosts() {
local -r primary_host_ip=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host1/public_ip")
local -r secondary_host_ip=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host2/public_ip")
local -r primary_host_ip=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host1/ip")
local -r secondary_host_ip=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host2/ip")
local -r primary_host_ssh_port=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host1/ssh_port")
local -r secondary_host_ssh_port=$(cat "${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host2/ssh_port")
local -r primary_host_name="$(full_vm_name host1)"
Expand Down