|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Sourced from scenario.sh and uses functions defined there. |
| 4 | + |
| 5 | +# Redefine network-related settings to use the dedicated IPv6 network bridge |
| 6 | +# shellcheck disable=SC2034 # used elsewhere |
| 7 | +VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_IPV6_NETWORK}")" |
| 8 | +# shellcheck disable=SC2034 # used elsewhere |
| 9 | +WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}" |
| 10 | + |
| 11 | +start_image="rhel100-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" |
| 12 | + |
| 13 | +scenario_create_vms() { |
| 14 | + # Enable IPv6 single stack in kickstart |
| 15 | + if ! does_image_exist "${start_image}"; then |
| 16 | + echo "Image '${start_image}' not found - skipping test" |
| 17 | + return 0 |
| 18 | + fi |
| 19 | + |
| 20 | + # Using `hostname` here instead of a raw ip because skopeo only allows either |
| 21 | + # ipv4 or fqdn's, but not ipv6. Since the registry is hosted on the ipv6 |
| 22 | + # network gateway in the host, we need to use a combination of the hostname |
| 23 | + # plus /etc/hosts resolution (which is taken care of by kickstart). |
| 24 | + # Save the original value and temporarily override for prepare_kickstart |
| 25 | + local original_mirror_registry_url="${MIRROR_REGISTRY_URL}" |
| 26 | + MIRROR_REGISTRY_URL="$(hostname):${MIRROR_REGISTRY_PORT}/microshift" |
| 27 | + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" false true |
| 28 | + MIRROR_REGISTRY_URL="${original_mirror_registry_url}" |
| 29 | + launch_vm --boot_blueprint rhel100-bootc --network "${VM_IPV6_NETWORK}" |
| 30 | +} |
| 31 | + |
| 32 | +scenario_remove_vms() { |
| 33 | + if ! does_image_exist "${start_image}"; then |
| 34 | + echo "Image '${start_image}' not found - skipping test" |
| 35 | + return 0 |
| 36 | + fi |
| 37 | + |
| 38 | + remove_vm host1 |
| 39 | +} |
| 40 | + |
| 41 | +scenario_run_tests() { |
| 42 | + if ! does_image_exist "${start_image}"; then |
| 43 | + echo "Image '${start_image}' not found - skipping test" |
| 44 | + return 0 |
| 45 | + fi |
| 46 | + |
| 47 | + run_tests host1 suites/ipv6/singlestack.robot |
| 48 | +} |
0 commit comments