-
Notifications
You must be signed in to change notification settings - Fork 769
Open
Labels
Milestone
Description
The log strings change day by day; the test scripts shouldn't expect the log strings to be greppable.
Instead they should use limactl ls --json or limactl watch --json (to be designed and implemented) to obtain proper JSON objects
Lines 335 to 367 in 68be6f2
| if [[ -n ${CHECKS["ssh-over-vsock"]} ]]; then | |
| if [[ "$(limactl ls "${NAME}" --yq .vmType)" == "vz" ]]; then | |
| INFO "Testing SSH over vsock" | |
| set -x | |
| INFO "Testing .ssh.overVsock=true configuration" | |
| limactl stop "${NAME}" | |
| # Detection of the SSH server on VSOCK may fail; however, a failing log indicates that controlling detection via the environment variable works as expected. | |
| if ! limactl start --set '.ssh.overVsock=true' "${NAME}" 2>&1 | grep -i -E "(started vsock forwarder|Failed to detect SSH server on vsock)"; then | |
| set +x | |
| diagnose "${NAME}" | |
| ERROR ".ssh.overVsock=true did not enable vsock forwarder" | |
| exit 1 | |
| fi | |
| INFO 'Testing .ssh.overVsock=null configuration' | |
| limactl stop "${NAME}" | |
| # Detection of the SSH server on VSOCK may fail; however, a failing log indicates that controlling detection via the environment variable works as expected. | |
| if ! limactl start --set '.ssh.overVsock=null' "${NAME}" 2>&1 | grep -i -E "(started vsock forwarder|Failed to detect SSH server on vsock)"; then | |
| set +x | |
| diagnose "${NAME}" | |
| ERROR ".ssh.overVsock=null did not enable vsock forwarder" | |
| exit 1 | |
| fi | |
| INFO "Testing .ssh.overVsock=false configuration" | |
| limactl stop "${NAME}" | |
| if ! limactl start --set '.ssh.overVsock=false' "${NAME}" 2>&1 | grep -i "skipping detection of SSH server on vsock port"; then | |
| set +x | |
| diagnose "${NAME}" | |
| ERROR ".ssh.overVsock=false did not disable vsock forwarder" | |
| exit 1 | |
| fi | |
| set +x | |
| fi | |
| fi |
lima/hack/test-port-forwarding.pl
Lines 148 to 153 in 68be6f2
| if ($test{mode} eq "ignore") { | |
| $test{log_msg} = "Not forwarding TCP $remote"; | |
| } | |
| else { | |
| $test{log_msg} = "Forwarding TCP from $remote to $local"; | |
| } |
lima/hack/test-port-forwarding.pl
Lines 226 to 230 in 68be6f2
| while (<$log>) { | |
| $seen{$1}++ if /(Forwarding TCP from .*? to ((\d.*?|\[.*?\]):\d+|\/[^"]+))/; | |
| $seen{$1}++ if /(Not forwarding TCP .*?:\d+)/; | |
| $failed_to_listen_tcp{$2}=$1 if /(failed to listen tcp: listen tcp (.*?:\d+):[^"]+)/; | |
| } |
(Probably more)