@@ -61,13 +61,15 @@ declare -A CHECKS=(
61
61
[" param-env-variables" ]=" "
62
62
[" set-user" ]=" "
63
63
[" preserve-env" ]=" 1"
64
+ [" ssh-over-vsock" ]=" "
64
65
)
65
66
66
67
case " $NAME " in
67
68
" default" )
68
69
# CI failure:
69
70
# "[hostagent] failed to confirm whether /c/Users/runneradmin [remote] is successfully mounted"
70
71
[ " ${OS_HOST} " = " Msys" ] && CHECKS[" mount-home" ]=
72
+ [ " ${OS_HOST} " = " Darwin" ] && CHECKS[" ssh-over-vsock" ]=" 1"
71
73
;;
72
74
" alpine" * )
73
75
WARNING " Alpine does not support systemd"
@@ -346,14 +348,40 @@ if [[ -n ${CHECKS["preserve-env"]} ]]; then
346
348
" ${scriptdir} " /test-preserve-env.sh " $NAME "
347
349
fi
348
350
351
+ if [[ -n ${CHECKS["ssh-over-vsock"]} ]]; then
352
+ if [[ " $( limactl ls " ${NAME} " --yq .vmType) " == " vz" ]]; then
353
+ INFO " Testing SSH over vsock"
354
+ set -x
355
+ if ! LIMA_SSH_OVER_VSOCK=false limactl restart " ${NAME} " 2>&1 | grep -iq " skipping detection of SSH server on vsock port" ; then
356
+ set +x
357
+ diagnose " ${NAME} "
358
+ ERROR " LIMA_SSH_OVER_VSOCK=false did not disable vsock forwarder"
359
+ exit 1
360
+ fi
361
+ if ! LIMA_SSH_OVER_VSOCK=true limactl restart " ${NAME} " 2>&1 | grep -iq " started vsock forwarder" ; then
362
+ set +x
363
+ diagnose " ${NAME} "
364
+ ERROR " LIMA_SSH_OVER_VSOCK=true did not enable vsock forwarder"
365
+ exit 1
366
+ fi
367
+ if ! LIMA_SSH_OVER_VSOCK=" " limactl restart " ${NAME} " 2>&1 | grep -iq " started vsock forwarder" ; then
368
+ set +x
369
+ diagnose " ${NAME} "
370
+ ERROR " LIMA_SSH_OVER_VSOCK= did not enable vsock forwarder"
371
+ exit 1
372
+ fi
373
+ set +x
374
+ fi
375
+ fi
376
+
349
377
# Use GHCR to avoid hitting Docker Hub rate limit
350
378
nginx_image=" ghcr.io/stargz-containers/nginx:1.19-alpine-org"
351
379
alpine_image=" ghcr.io/containerd/alpine:3.14.0"
352
380
353
381
if [[ -n ${CHECKS["container-engine"]} ]]; then
354
382
sudo=" "
355
383
# Currently WSL2 machines only support privileged engine. This requirement might be lifted in the future.
356
- if [[ " $( limactl ls --json " ${NAME} " | jq -r .vmType) " == " wsl2" ]]; then
384
+ if [[ " $( limactl ls " ${NAME} " --yq .vmType) " == " wsl2" ]]; then
357
385
sudo=" sudo"
358
386
fi
359
387
INFO " Run a nginx container with port forwarding 127.0.0.1:8080"
@@ -433,7 +461,7 @@ if [[ -n ${CHECKS["port-forwards"]} ]]; then
433
461
sudo=" sudo"
434
462
fi
435
463
# Currently WSL2 machines only support privileged engine. This requirement might be lifted in the future.
436
- if [[ " $( limactl ls --json " ${NAME} " | jq -r .vmType) " == " wsl2" ]]; then
464
+ if [[ " $( limactl ls " ${NAME} " --yq .vmType) " == " wsl2" ]]; then
437
465
sudo=" sudo"
438
466
fi
439
467
limactl shell " $NAME " $sudo $CONTAINER_ENGINE info
@@ -625,7 +653,7 @@ if [[ -n ${CHECKS["clone"]} ]]; then
625
653
limactl start " $NAME "
626
654
fi
627
655
628
- if [[ $NAME == " fedora" && " $( limactl ls --json " $ NAME" | jq -r .vmType) " == " vz" ]]; then
656
+ if [[ $NAME == " fedora" && " $( limactl ls " ${ NAME} " --yq .vmType) " == " vz" ]]; then
629
657
" ${scriptdir} " /test-selinux.sh " $NAME "
630
658
fi
631
659
0 commit comments