test: shell: Get the first ethernet device

In CI sometimes there are two, so this fails.
This commit is contained in:
James Shubin
2025-09-30 00:27:35 -04:00
parent debd4ee653
commit 26640df164

View File

@@ -11,7 +11,9 @@ function repeat() {
set -x
# run unification with a dummy password
$TIMEOUT "$MGMT" provisioner --only-unify --password $(repeat "#" 106) &
eth=$(for i in /sys/class/net/*; do d=${i##*/}; [[ "$d" != "lo" && $(<"$i/type") -eq 1 ]] && echo "$d" && break; done) # get the first ethernet device
$TIMEOUT "$MGMT" provisioner --interface $eth --only-unify --password $(repeat "#" 106) &
pid=$!
wait $pid # get exit status
e=$?