Skip to content

Commit c41880f

Browse files
committed
CI: test portfwd issue (w3m -dump hangs)
Test for issue 3685 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 9641e25 commit c41880f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ jobs:
264264
# QEMU: required by Lima itself
265265
# bash: required by test-templates.sh (OS version of bash is too old)
266266
# coreutils: required by test-templates.sh for the "timeout" command
267-
run: brew install qemu bash coreutils
267+
# w3m : required by test-templates.sh for port forwarding tests
268+
run: brew install qemu bash coreutils w3m
268269
- name: "Adjust LIMACTL_CREATE_ARGS"
269270
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --vm-type=qemu" >>$GITHUB_ENV
270271
- name: "Inject `no_timer_check` to kernel cmdline"
@@ -331,7 +332,7 @@ jobs:
331332
- name: Install test dependencies
332333
run: |
333334
sudo apt-get update
334-
sudo apt-get install -y --no-install-recommends ovmf qemu-system-x86 qemu-utils
335+
sudo apt-get install -y --no-install-recommends ovmf qemu-system-x86 qemu-utils w3m
335336
sudo modprobe kvm
336337
# `sudo usermod -aG kvm $(whoami)` does not take an effect on GHA
337338
sudo chown $(whoami) /dev/kvm
@@ -430,7 +431,7 @@ jobs:
430431
with:
431432
template: templates/default.yaml
432433
- name: Install test dependencies
433-
run: brew install qemu bash coreutils
434+
run: brew install qemu bash coreutils w3m
434435
- name: Install socket_vmnet
435436
env:
436437
SOCKET_VMNET_VERSION: v1.2.0
@@ -525,7 +526,7 @@ jobs:
525526
with:
526527
template: templates/${{ matrix.template }}
527528
- name: Install test dependencies
528-
run: brew install bash coreutils
529+
run: brew install bash coreutils w3m
529530
- name: Uninstall qemu
530531
run: brew uninstall --ignore-dependencies --force qemu
531532
- name: Test

hack/test-templates.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@ if [[ -n ${CHECKS["port-forwards"]} ]]; then
381381
limactl shell "$NAME" $sudo $CONTAINER_ENGINE rm -f nginx
382382
fi
383383
fi
384+
if [[ ${NAME} != "alpine"* ]] && command -v w3m >/dev/null; then
385+
INFO "Testing https://github.com/lima-vm/lima/issues/3685 ([gRPC portfwd] client connection is not closed immediately when server closed the connection)"
386+
# Skip the test on Alpine, as systemd-run is missing
387+
limactl shell "$NAME" systemd-run --user python3 -m http.server 3685
388+
# curl is not enough to reproduce https://github.com/lima-vm/lima/issues/3685
389+
# `w3m -dump` exits with status code 0 even on "Can't load" error.
390+
timeout 30s bash -euxc "until w3m -dump http://localhost:3685 | grep -v \"w3m: Can't load\"; do sleep 3; done"
391+
fi
384392
fi
385393
set +x
386394
fi

0 commit comments

Comments
 (0)