Skip to content

Commit 5eecac7

Browse files
committed
Explictly disable IPv4 in anaconda for IPv6 single stack scenarios
1 parent 09334e3 commit 5eecac7

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

test/bin/scenario.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,23 @@ EOF
240240
# first on the host. This usually matches an image
241241
# blueprint name.
242242
# fips_enabled -- Enable FIPS mode (true or false).
243+
# ipv6_only -- Only use IPv6 single stack configuration by explicitly
244+
# disabling IPv4 (true or false)
243245
prepare_kickstart() {
244246
local vmname="$1"
245247
local template="$2"
246248
local boot_commit_ref="$3"
247249
local fips_enabled=${4:-false}
250+
local ipv6_only=${5:-false}
248251

249252
local -r full_vmname="$(full_vm_name "${vmname}")"
250253
local -r output_dir="${SCENARIO_INFO_DIR}/${SCENARIO}/vms/${vmname}"
251254
local -r vm_hostname="${full_vmname/./-}"
252255
local -r hostname=$(hostname)
256+
local ipv6_opt=""
257+
if ${ipv6_only} ; then
258+
ipv6_opt="--noipv4 --ipv6 auto"
259+
fi
253260

254261
validate_vm_hostname "${vm_hostname}"
255262

@@ -287,6 +294,7 @@ prepare_kickstart() {
287294
-e "s|REPLACE_BOOT_COMMIT_REF|${boot_commit_ref}|g" \
288295
-e "s|REPLACE_PULL_SECRET|${PULL_SECRET_CONTENT}|g" \
289296
-e "s|REPLACE_HOST_NAME|${vm_hostname}|g" \
297+
-e "s|REPLACE_IPV6_ONLY|${ipv6_opt}|g" \
290298
-e "s|REPLACE_REDHAT_AUTHORIZED_KEYS|${REDHAT_AUTHORIZED_KEYS}|g" \
291299
-e "s|REPLACE_FIPS_ENABLED|${fips_enabled}|g" \
292300
-e "s|REPLACE_MIRROR_HOSTNAME|${hostname}|g" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Configure network to use DHCP and activate on boot
2-
network --bootproto=dhcp --device=link --activate --onboot=on --hostname=REPLACE_HOST_NAME
2+
network --bootproto=dhcp --device=link --activate --onboot=on --hostname=REPLACE_HOST_NAME REPLACE_IPV6_ONLY

test/scenarios-bootc/presubmits/[email protected]

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}"
1515
MIRROR_REGISTRY_URL="$(hostname):${MIRROR_REGISTRY_PORT}"
1616

1717
scenario_create_vms() {
18-
prepare_kickstart host1 kickstart-bootc.ks.template rhel95-bootc-source
18+
# Enable IPv6 single stack in kickstart
19+
prepare_kickstart host1 kickstart-bootc.ks.template rhel95-bootc-source false true
1920
launch_vm --boot_blueprint rhel95-bootc --network "${VM_IPV6_NETWORK}"
2021
}
2122

test/scenarios/presubmits/[email protected]

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}"
1111
MIRROR_REGISTRY_URL="${VM_BRIDGE_IP}:${MIRROR_REGISTRY_PORT}"
1212

1313
scenario_create_vms() {
14-
prepare_kickstart host1 kickstart.ks.template rhel-9.4-microshift-source
14+
# Enable IPv6 single stack in kickstart
15+
prepare_kickstart host1 kickstart.ks.template rhel-9.4-microshift-source false true
1516
launch_vm --network "${VM_IPV6_NETWORK}"
1617
}
1718

0 commit comments

Comments
 (0)