Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0fb2f43
fix(containerlab): Ready the VLAN acceptance harness for the lab
privateip Nov 30, 2026
fa333b5
fix(containerlab): Retry etcd timeouts in the VLAN acceptance harness
privateip Nov 30, 2026
0ded57d
fix(containerlab): Fix captures, reverts and checks the lab run found
privateip Nov 30, 2026
0d2efd5
fix(containerlab): Move both address families home on revert
privateip Nov 30, 2026
8af415e
fix(containerlab): Restore each member's checksum offload on revert
privateip Nov 30, 2026
84ef9db
fix(containerlab): Check V18 and V19 as the contract states
privateip Dec 1, 2026
731a7af
docs(vlan-transport): Scope the lab pass and settle V13 and NAT overlap
privateip Dec 1, 2026
d3db6d3
fix(containerlab): Keep kubectl output and errors apart in kube_retry
privateip Dec 1, 2026
bacbb65
fix(containerlab): Move BGP routes with a side's addresses
privateip Dec 1, 2026
1f23958
fix(containerlab): Keep the Kind nodes' captures and count them right
privateip Dec 1, 2026
a767111
fix(containerlab): Judge V11, V13, V17 and V19 by the amended contract
privateip Dec 1, 2026
d8f3bdb
docs(archive): Record the VLAN transport smoke pass
privateip Dec 1, 2026
454bee9
fix(containerlab): Wait for Cilium to admit V15's VLAN before pinging
privateip Dec 1, 2026
23e8dda
docs(vlan-transport): Accept tagged-side XDP cost and record C4 rerun
privateip Dec 1, 2026
7316283
fix(containerlab): Tell a failed Cilium read from no V15 VLAN drops
privateip Dec 1, 2026
accb502
docs(archive): Clarify the C4 rerun counts and the V15 check
privateip Dec 1, 2026
71f17c4
docs(vlan-transport): Name the baseline for the tagged-side XDP cost
privateip Dec 1, 2026
45058fb
fix(containerlab): Mark what V15 found when it reads Cilium's drops
privateip Dec 1, 2026
9cf3719
docs(archive): Record the final VLAN transport C4 retest
privateip Dec 1, 2026
c7afed7
test(edgeattach): Name the address family test strings
privateip Dec 1, 2026
a3fc053
fix(containerlab): Bound the interrupt probe stop wait
privateip Dec 1, 2026
90543cf
docs(archive): State the VLAN transport run dates
privateip Dec 1, 2026
d3ba67d
fix(containerlab): Stop interrupt probes at their source after grace
privateip Dec 1, 2026
7d80922
docs(archive): Cite the retested tree and both nodes' VLAN drops
privateip Dec 1, 2026
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
5 changes: 3 additions & 2 deletions deploy/containerlab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ its addresses. The script works for any Kind node of the topology.
The [VLAN transport contract](../../docs/designs/vlan-transport/contract.md) needs each side of an edge node to run tagged (802.1Q) or untagged. The topology above builds untagged bonds only. `scripts/vlan-transport.sh` re-plumbs sjc at run time, without changing a manifest. It changes the public side (sjc-worker2 `bond0` to tr2 `bond1`) and the fabric side (sjc-worker2 `bond1` to sjc-worker `bond0`).

- `resources/vlan-transport/cells.env` defines cells C1 to C6 of the [acceptance matrix](../../docs/designs/vlan-transport/acceptance.md), plus C1AB and C4AB on active-backup bonds. `PUB_VID` and `FAB_VID` override a cell's IDs, `PUB_PARENT` and `FAB_PARENT` its parent per side (`bond`, `nic` or `shared`), and `BOND_MODE` its bond mode. A later `apply` changes only the side whose ID or parent differs.
- C5 needs one parent that reaches both tr2 and sjc-worker, which point-to-point links cannot give. `scripts/vlan-transport-switch.sh` adds a bridge node, `clab-gvpc-vtsw`, with four new veths. The edge's new bond `bondsw` trunks both VLANs to the bridge, which passes the public VLAN to tr2 and the fabric VLAN to sjc-worker. `apply C5` builds it and `revert` removes it. Creating the veths needs passwordless `sudo` for `containerlab tools veth create`, as `restart-node.sh` does.
- C5 needs one parent that reaches both tr2 and sjc-worker, which point-to-point links cannot give. `scripts/vlan-transport-switch.sh` adds a bridge node, `clab-gvpc-vtsw`, on the transit routers' image, with four new veths. The edge's new bond `bondsw` trunks both VLANs to the bridge, which passes the public VLAN to tr2 and the fabric VLAN to sjc-worker. `apply C5` builds it and `revert` removes it. Creating the veths needs passwordless `sudo` for `containerlab tools veth create`, as `restart-node.sh` does.
- `apply` creates the VLAN netdevices on both ends of each tagged side and moves the link's addresses onto them: with `ip` on the Kind nodes and in vtysh's running configuration on tr2. It then points `galactic-gateway`, `galactic-nat` and `galactic-cni` at the new interfaces with `kubectl set env`. `SELECT=logical` names the VLAN netdevice, as the contract requires. `SELECT=parent` names the parent instead.
- sjc's single `galactic-cni` DaemonSet needs a different interface on each node once a side is tagged. By default `apply` gives sjc-worker2 its own copy, `galactic-cni-vt-edge`, and excludes that node from the original. `CNI_SELECT=by-node` instead sets `GALACTIC_CNI_EBPF_INTERFACES_BY_NODE` on the one DaemonSet, which needs a `galactic-cni` that reads it ([#1539](https://github.com/datum-cloud/galactic/pull/1539), for [#1404](https://github.com/datum-cloud/galactic/issues/1404)).
- `apply` saves the deployed settings on sjc-worker2 in `/galactic/vlan-transport.state`. `revert` uses it to restore C1. `offload on|off` toggles VLAN offloads on every transport member. `csum on|off` toggles their transmit checksum offload: a veth sender with it on hands a natively redirected frame on with a partial checksum, which the far end counts as a checksum error.
Expand Down Expand Up @@ -728,7 +728,8 @@ task report:vlan-transport OUT=/tmp/vt # re-render the rep
- `CELL` takes cell names, or `all`: C1 to C6, C4ALT (C4 with the IDs in `ALT_PUB_VID` and `ALT_FAB_VID`, default 1234 and 3456), C1AB and C4AB. Untagged cells run first, since each tagged cell's throughput, latency and recovery are compared with C1 (C1AB for C4AB) in the same XDP mode and offload state.
- `ROWS` takes row IDs, ranges such as `V01-V08`, or `all`. `XM` checks every XDP hook's mode, `NAA` reproduces the `verify:nat-active-active` finding from #1401 once, and `POST` runs sjc's untagged checks after the final revert.
- `XDP_MODES` (default `native generic`), `OFFLOADS` (default `on off`), `SELECT`, `CSUM` (default `off`) and `CNI_SELECT` set the run's configuration. `BASELINE` names a pre-change run's output for V20.
- V17 to V28 test configuration and lifecycle, so they run once per cell and XDP mode, in the first offload state.
- V10 and V17 to V28 run once per cell and XDP mode, in the first offload state: they test configuration and lifecycle, or run on dfw-worker3, which the offload toggle leaves alone. V18's invalid configurations run in C1 and C4 only (`V18_CELLS`).
- Recovery probes start 10 s before each event and stop 10 s after it returns. The Kind nodes have no `ping`, so probes from them run the netshoot image `galactic-debug` builds on, in the node's network namespace.

`OUT` holds `report.md` (pinned revisions, configuration, expected against observed for every check, skips, captures and counters, commands), `results.tsv`, and a directory per cell, mode and offload state with each step's output and captures. A check is PASS, FAIL, SKIP (did not run, with the reason), BASELINE (an untagged measurement), N/A (excluded by the contract for that cell) or PLANNED (dry run). A skip is never a pass: the task exits 1 when a check failed and 3 when none failed but some were skipped. An interrupted live run still reverts sjc to C1, restores the XDP mode and writes the report.

Expand Down
47 changes: 45 additions & 2 deletions deploy/containerlab/scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ apply_xdp_mode() {
-o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep -E '^galactic-(nat|gateway-.+)$')
for ds in "${daemonsets[@]}"; do
if [ -z "${mode}" ] || [ "${mode}" = auto ]; then
docker exec "${node}" kubectl -n galactic-system set env "daemonset/${ds}" -c 'galactic-*' GALACTIC_XDP_MODE-
kube_retry docker exec "${node}" kubectl -n galactic-system set env "daemonset/${ds}" -c 'galactic-*' GALACTIC_XDP_MODE-
else
docker exec "${node}" kubectl -n galactic-system set env "daemonset/${ds}" -c 'galactic-*' \
kube_retry docker exec "${node}" kubectl -n galactic-system set env "daemonset/${ds}" -c 'galactic-*' \
"GALACTIC_XDP_MODE=${mode}"
fi
done
Expand Down Expand Up @@ -191,5 +191,48 @@ pick_port() {
[ -n "${PORTS_USED[${p}]:-}" ] || break
done
PORTS_USED[${p}]=1
# shellcheck disable=SC2034 # read by the scripts that source this file
PORT_PICKED=${p}
}

# PROBE_IMAGE: the netshoot release galactic-debug builds on. The Kind node
# image has no ping, so node_ping runs one from it in the node's network
# namespace.
PROBE_IMAGE=${PROBE_IMAGE:-nicolaka/netshoot:v0.16@sha256:b09d9b21381f47a79b3cbcb30da25266dc17186ea00ae65e99fdc51396f48e70}

# node_ping NODE [NAME] -- PING_ARGS...: ping from NODE's network namespace.
# Transit routers (clab-*) have busybox ping; Kind nodes borrow PROBE_IMAGE's,
# in a container named NAME when given, so a caller can stop it with
# `docker kill -s INT NAME`.
node_ping() {
local node="$1" name=""
shift
if [ "$1" != -- ]; then name="$1"; shift; fi
shift
case "${node}" in
clab-*) docker exec "${node}" ping "$@" ;;
*) docker run --rm ${name:+--name "${name}"} --network "container:${node}" "${PROBE_IMAGE}" ping "$@" ;;
esac
}

# kube_retry CMD...: run a kubectl command, retrying up to five times in all
# while it fails with "etcdserver: request timed out", which a loaded host
# produces during rollouts. Any other failure returns at once. Its stdout
# and stderr pass through unchanged and apart, from the last attempt.
kube_retry() {
local i rc out err
out=$(mktemp) err=$(mktemp)
for i in 1 2 3 4 5; do
"$@" >"${out}" 2>"${err}"
rc=$?
if [ "${rc}" -eq 0 ] || ! grep -q 'etcdserver: request timed out' "${err}"; then
break
fi
echo "kube_retry: etcd timed out (attempt ${i} of 5): $*" >&2
sleep 5
done
cat "${out}"
cat "${err}" >&2
rm -f "${out}" "${err}"
return "${rc}"
}
44 changes: 38 additions & 6 deletions deploy/containerlab/scripts/verify-vlan-transport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
# --rows all (default) is XM NAA V01-V28 POST. XM checks the XDP
# attach mode, NAA reproduces the verify:nat-active-active
# finding once, POST runs sjc's untagged checks after revert.
# V17 to V28 run once per cell and XDP mode, in the first
# offload state: they test configuration and lifecycle.
# V10 and V17 to V28 run once per cell and XDP mode, in the
# first offload state: they test configuration and lifecycle,
# or run on dfw-worker3, which the offload toggle leaves alone.
# V18 runs in the cells in V18_CELLS (default "C1 C4").
# --xdp-modes host XDP modes, set with `task lab:xdp-mode` (generic,
# native or auto); default "native generic".
# --offloads VLAN receive and transmit offload states; default "on off".
Expand All @@ -28,7 +30,14 @@
# --cni-select how galactic-cni gets per-node interfaces (vlan-transport.sh
# CNI_SELECT); by-node needs GALACTIC_CNI_EBPF_INTERFACES_BY_NODE.
# --baseline a pre-change run's output directory, for V20.
# BASE_TOP (environment) an earlier run's output directory holding the
# untagged baselines, so a rerun of a tagged cell's V09 or
# V21 to V28 compares against them.
# --out output directory; default /tmp/vlan-transport-<UTC time>.
# ADMIT_WAIT (environment) seconds V15 waits for Cilium to admit its
# third VLAN before measuring; default 60.
# --skip-cell CELL=REASON, repeatable: record every row of CELL as SKIP
# with REASON instead of running it, for a missing prerequisite.
#
# --dry-run prints every step and writes the report skeleton without touching
# the lab: no docker, kubectl or task call runs. Everything else needs the
Expand Down Expand Up @@ -56,6 +65,7 @@ ALT_FAB_VID=${ALT_FAB_VID:-3456}

DRY_RUN=0 CELLS=all ROWS=all XMODES="native generic" OFFLOADS="on off" SELECT=logical CSUM=off
CNI_SELECT=${CNI_SELECT:-copy} PRE_CHANGE="" TOP=""
declare -A SKIP_CELL=()
while [ "$#" -gt 0 ]; do
case "$1" in
--dry-run) DRY_RUN=1 ;;
Expand All @@ -68,7 +78,8 @@ while [ "$#" -gt 0 ]; do
--cni-select) CNI_SELECT="$2"; shift ;;
--baseline) PRE_CHANGE="$2"; shift ;;
--out) TOP="$2"; shift ;;
-h | --help) sed -n '2,46p' "$0"; exit 0 ;;
--skip-cell) SKIP_CELL[${2%%=*}]="${2#*=}"; shift ;;
-h | --help) sed -n '2,48p' "$0"; exit 0 ;;
*) echo "verify-vlan-transport: unknown argument $1" >&2; exit 2 ;;
esac
shift
Expand All @@ -80,6 +91,9 @@ die() { echo "verify-vlan-transport: $*" >&2; exit 2; }
case "${SELECT}" in logical | parent) ;; *) die "--select must be logical or parent" ;; esac
case "${CSUM}" in on | off) ;; *) die "--csum must be on or off" ;; esac
case "${CNI_SELECT}" in copy | by-node) ;; *) die "--cni-select must be copy or by-node" ;; esac
# Every apply, including the ones rows and recovery events make, selects
# galactic-cni's interfaces the same way.
export CNI_SELECT
for m in ${XMODES}; do case "${m}" in native | generic | auto) ;; *) die "unknown XDP mode ${m}" ;; esac; done
for o in ${OFFLOADS}; do case "${o}" in on | off) ;; *) die "unknown offload state ${o}" ;; esac; done

Expand Down Expand Up @@ -119,6 +133,8 @@ RESULTS="${TOP}/results.tsv"
printf 'run\tcell\txdp\toffload\trow\tcase\tstatus\texpected\tobserved\tevidence\tcommands\n' >"${RESULTS}"
exec > >(tee -a "${TOP}/$([ "${DRY_RUN}" = 1 ] && echo plan || echo run).log") 2>&1

# shellcheck source=lib.sh
source "${SCRIPT_DIR}/lib.sh"
# shellcheck source=vlan-transport-rows.sh
source "${SCRIPT_DIR}/vlan-transport-rows.sh"

Expand All @@ -141,9 +157,12 @@ meta csum "${CSUM}"
meta cni_select "${CNI_SELECT}"
meta alt_ids "${ALT_PUB_VID}/${ALT_FAB_VID}"
meta third_vid "${THIRD_VID}"
meta admit_wait "${ADMIT_WAIT:-60}"
meta lab "${LAB}"
meta pre_change "${PRE_CHANGE:-none}"
meta host_kernel "$(uname -r)"
meta uptime_deploy "${DEPLOY_UPTIME:-not recorded}"
meta uptime_start "$(uptime)"
if [ "${DRY_RUN}" = 1 ]; then
meta images "not collected (dry run)"
else
Expand Down Expand Up @@ -203,12 +222,15 @@ run_rows() {
any_wanted V11 V12 V13 && row_V11
row_wanted V15 && row_V15
row_wanted V09 && row_V09
row_wanted V10 && row_V10
row_wanted V14 && row_V14
row_wanted V16 && row_V16
[ "${first}" = 1 ] || return 0
# V10 runs on dfw-worker3, which the sjc offload toggle does not touch.
row_wanted V10 && row_V10
row_wanted V17 && row_V17
row_wanted V18 && row_V18
# V18's invalid configurations do not depend on the cell: C1 and C4 cover
# an untagged and a tagged parent (V18_CELLS).
row_wanted V18 && [[ " ${V18_CELLS:-C1 C4} " == *" ${CELL} "* ]] && row_V18
row_wanted V19 && row_V19
row_wanted V20 && row_V20
any_wanted V21 V22 V23 V24 V25 V26 V27 V28 && row_V21
Expand Down Expand Up @@ -259,7 +281,16 @@ for XMODE in ${XMODES}; do
OUT="${TOP}/${CELL}-${XMODE}"
mkdir -p "${OUT}"
RUN_ID="${CELL}-${XMODE}"
if [ -n "${SKIP_CELL[${CELL}]:-}" ]; then
OFFLOAD=-
for r in ${WANT}; do
[ "${r}" = NAA ] || [ "${r}" = POST ] || [ "${r}" = XM ] || skip "${r}" "" "${SKIP_CELL[${CELL}]}"
done
continue
fi
row_start APPLY "apply ${CELL}"
echo " host load at ${CELL} start: $(uptime)"
[ "${DRY_RUN}" = 1 ] || uptime >"${OUT}/uptime.txt"
if ! x env LAB="${LAB}" "${VT_ENV[@]}" CNI_SELECT="${CNI_SELECT}" EXTRA_VIDS="${THIRD_VID}" "${VT}" apply "${BASE_CELL}" "${SELECT}"; then
record APPLY "" FAIL "vlan-transport.sh apply ${BASE_CELL} failed; no row ran in this cell"
continue
Expand All @@ -268,9 +299,10 @@ for XMODE in ${XMODES}; do
for OFFLOAD in ${OFFLOADS}; do
RUN_ID="${CELL}-${XMODE}-offload-${OFFLOAD}"
OUT="${TOP}/${RUN_ID}"
BASE_DIR="${TOP}/${BASE_REF}-${XMODE}-offload-${OFFLOAD}"
BASE_DIR="${BASE_TOP:-${TOP}}/${BASE_REF}-${XMODE}-offload-${OFFLOAD}"
mkdir -p "${OUT}"
echo "== ${RUN_ID}"
[ "${DRY_RUN}" = 1 ] || uptime >"${OUT}/uptime.txt"
row_start SETUP "offloads and snapshot"
if ! x env LAB="${LAB}" "${VT}" offload "${OFFLOAD}" || ! x env LAB="${LAB}" "${VT}" csum "${CSUM}"; then
record SETUP "" FAIL "setting VLAN offload ${OFFLOAD} or checksum offload ${CSUM} failed; no row ran in this state"
Expand Down
2 changes: 2 additions & 0 deletions deploy/containerlab/scripts/vlan-transport-baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ result() { echo "RESULT ${CELL}/${SELECT} $1: $2" | tee -a "${OUT}/results.txt";

# metrics, metric_delta and the counter snapshots are shared with
# verify-vlan-transport.sh, which runs these rows as part of the full matrix.
# shellcheck source=lib.sh
source "${SCRIPT_DIR}/lib.sh"
# shellcheck source=vlan-transport-rows.sh
source "${SCRIPT_DIR}/vlan-transport-rows.sh"

Expand Down
67 changes: 53 additions & 14 deletions deploy/containerlab/scripts/vlan-transport-interrupt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
# tenant sjc's ns20 pod pings the off-fabric host through sjc's NAT shard,
# crossing both sides
#
# Each probe's interruption is its longest run of missing replies times
# 20 ms. Results go to OUT/interrupt.tsv as "name probe replies sent gap_ms
# event", where name is the event's position and spelling (01-restart_all),
# and the old netdevice check to OUT/<name>.stale.
# Probes start DELAY seconds (default 10) before the event and stop SETTLE
# seconds (default 10) after it returns. Each probe's interruption is its
# longest run of missing replies times 20 ms, leaving out the last five
# probes, still in flight when the probe stopped. Results go to
# OUT/interrupt.tsv as "name probe replies sent gap_ms event", where name is
# the event's position and spelling (01-restart_all), and the old netdevice
# check to OUT/<name>.stale.
#
# Events:
# restart:COMPONENT roll galactic-nat, galactic-gateway (the edge's own
Expand Down Expand Up @@ -51,12 +54,14 @@ TARGET=2001:db8:1:40::2
PUB_ADDR=2001:db8:1:21::2
FAB_ADDR=2001:db8:1:20::1
INTERVAL=0.02
COUNT=${PROBE_COUNT:-9000} # 180 s at 20 ms, enough for an apply or revert to finish
COUNT=${PROBE_COUNT:-30000} # at most 600 s at 20 ms; probes stop SETTLE s after the event
DELAY=${EVENT_DELAY:-10}
SETTLE=${EVENT_SETTLE:-10}
STOP_GRACE=${PROBE_STOP_GRACE:-15}
MEMBER_HOLD=${MEMBER_HOLD:-10}
mkdir -p "${OUT}"

kc() { docker exec "${CP}" kubectl -n "${NS}" "$@"; }
kc() { kube_retry docker exec "${CP}" kubectl -n "${NS}" "$@"; }
field() { docker exec "${EDGE}" sh -c "grep '^$1=' /galactic/vlan-transport.state 2>/dev/null | cut -d= -f2-"; }

# side_dev SIDE prints the edge's logical interface on SIDE now.
Expand Down Expand Up @@ -182,12 +187,18 @@ stale() {
}

gap() { # FILE PROBE NAME EVENT
python3 -I - "$1" "${COUNT}" "$2" "$3" "$4" <<'EOF'
python3 -I - "$1" "$2" "$3" "$4" <<'EOF'
import re, sys
path, count, probe, name, event = sys.argv[1], int(sys.argv[2]), sys.argv[3], sys.argv[4], sys.argv[5]
seen = set(int(m.group(1)) for m in re.finditer(r"icmp_seq=(\d+)", open(path).read()))
path, probe, name, event = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]
text = open(path).read()
seqs = [int(m.group(1)) for m in re.finditer(r"(?:icmp_)?seq=(\d+)", text)]
seen = set(seqs)
m = re.search(r"(\d+) packets transmitted", text)
count = int(m.group(1)) if m else (max(seqs) if seqs else 0)
# busybox ping counts from 0, iputils from 1.
first = 0 if 0 in seen else 1
gap = run = 0
for s in range(1, count + 1):
for s in range(first, first + max(count - 5, 0)):
run = 0 if s in seen else run + 1
gap = max(gap, run)
print("%s\t%s\t%d\t%d\t%d\t%s" % (name, probe, len(seen), count, gap * 20, event))
Expand All @@ -200,9 +211,10 @@ probe() {
local name="$1" event="$2" pod before
pod=$(pod_name "${CP}" ns20)
local -a pids=()
docker exec "${TR}" ping -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${PUB_ADDR}" >"${OUT}/${name}.public.ping" 2>&1 &
node_ping "${TR}" -- -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${PUB_ADDR}" >"${OUT}/${name}.public.ping" 2>&1 &
pids+=($!)
docker exec "${COMPUTE}" ping -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${FAB_ADDR}" >"${OUT}/${name}.fabric.ping" 2>&1 &
docker rm -f vt-probe-fabric >/dev/null 2>&1
node_ping "${COMPUTE}" vt-probe-fabric -- -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${FAB_ADDR}" >"${OUT}/${name}.fabric.ping" 2>&1 &
pids+=($!)
docker exec "${CP}" kubectl -n ns20 exec "${pod}" -- \
ping -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${TARGET}" >"${OUT}/${name}.tenant.ping" 2>&1 &
Expand All @@ -211,8 +223,35 @@ probe() {
before=$(links_now)
echo "event ${name} at $(date -u +%T.%N | cut -c1-12): ${event}"
run_event "${event}" >"${OUT}/${name}.event" 2>&1
echo "event ${name} exit $?" >>"${OUT}/${name}.event"
wait "${pids[@]}"
echo "event ${name} exit $? at $(date -u +%T.%N | cut -c1-12)" >>"${OUT}/${name}.event"
sleep "${SETTLE}"
docker exec "${TR}" pkill -INT -f "ping -6 -n -i ${INTERVAL} -c ${COUNT}" || true
docker kill -s INT vt-probe-fabric >/dev/null 2>&1 || true
docker exec "${CP}" kubectl -n ns20 exec "${pod}" -- pkill -INT -f "ping -6 -n -i ${INTERVAL}" || true
# An image without pkill leaves the probes running to their count, so give
# them a short grace, then stop each ping where it runs: the fabric
# probe's container, and by pidof on tr2 and in the tenant pod. Each
# background job is a subshell running a docker client, so end the client
# with its subshell rather than orphan it.
local deadline=$((SECONDS + STOP_GRACE)) pid alive=0
for pid in "${pids[@]}"; do
while kill -0 "${pid}" 2>/dev/null && [ "${SECONDS}" -lt "${deadline}" ]; do
sleep 0.5
done
kill -0 "${pid}" 2>/dev/null && alive=1
done
if [ "${alive}" = 1 ]; then
echo "probe ${name}: a probe outlived its stop; ending it at its source"
docker rm -f vt-probe-fabric >/dev/null 2>&1 || true
docker exec "${TR}" sh -c 'kill -INT $(pidof ping) 2>/dev/null' || true
docker exec "${CP}" kubectl -n ns20 exec "${pod}" -- sh -c 'kill -INT $(pidof ping) 2>/dev/null' || true
sleep 2
for pid in "${pids[@]}"; do
pkill -P "${pid}" 2>/dev/null || true
kill "${pid}" 2>/dev/null || true
done
fi
wait "${pids[@]}" || true
local p
for p in public fabric tenant; do
gap "${OUT}/${name}.${p}.ping" "${p}" "${name}" "${event}" | tee -a "${OUT}/interrupt.tsv"
Expand Down
Loading
Loading