Skip to content

Commit d40d540

Browse files
committed
remove WSL_INTEROP check
1 parent 80ff7d2 commit d40d540

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

tests/docker/test.sh

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ original_gateway=$(printf '%s\n' "$original_route" | awk 'NR == 1 { print $3 }')
143143
original_nat=$(iptables -t nat -S)
144144
[ -n "$original_route" ] || fail "container has no default route"
145145

146-
common_env="WSL_INTEROP=1 WSL2_GATEWAY_IP=$original_gateway WSL2_TAP_NAME=eth0"
146+
common_env="WSL2_GATEWAY_IP=$original_gateway WSL2_TAP_NAME=eth0"
147147
common_env="$common_env WSL2_RESOLVCONF=/etc/resolv.conf"
148148
mock_env="$common_env VMEXEC_PATH=/tests/mock-vm MOCK_LOG_DIR=$log_dir"
149149

150150
echo "case: default startup and SIGTERM cleanup"
151151
rm -f "$log_dir/vm.log"
152152
# shellcheck disable=SC2086
153-
start_background "$log_dir/default.log" env WSL_INTEROP=1 wsl-vpnkit
153+
start_background "$log_dir/default.log" env wsl-vpnkit
154154
wait_for "wsltap was not created" interface_exists wsltap
155155
wait_for "wsl-vm did not start" process_exists wsl-vm
156156
wait_for "wsl-gvproxy.exe did not start" process_exists wsl-gvproxy.exe
@@ -423,25 +423,18 @@ grep -q -- "is not executable due to WSL interop" "$log_dir/non-executable-gvpro
423423
assert_clean
424424

425425
echo "case: invalid environment fails before setup"
426-
if env $mock_env WSL_INTEROP=1 PREEXISTING=2 wsl-vpnkit \
426+
if env $mock_env PREEXISTING=2 wsl-vpnkit \
427427
>"$log_dir/invalid-preexisting.log" 2>&1; then
428428
fail "invalid PREEXISTING was accepted"
429429
fi
430430
grep -q -- "PREEXISTING must be 0 or 1" "$log_dir/invalid-preexisting.log" ||
431431
fail "invalid PREEXISTING error was not shown"
432432
assert_clean
433-
if env $mock_env WSL_INTEROP= wsl-vpnkit >"$log_dir/missing-interop.log" 2>&1; then
434-
fail "missing WSL_INTEROP was accepted"
435-
fi
436-
grep -q -- "WSL interop not available" "$log_dir/missing-interop.log" ||
437-
fail "missing WSL_INTEROP error was not shown"
438-
assert_clean
439-
440-
echo "case: failing gvproxy is rejected after execution attempt"
433+
echo "case: gvproxy execution failure is reported"
441434
failing_gvproxy="$log_dir/failing-gvproxy"
442435
printf '%s\n' '#!/bin/sh' 'exit 1' >"$failing_gvproxy"
443436
chmod 755 "$failing_gvproxy"
444-
if env $common_env VMEXEC_PATH=/usr/local/bin/wsl-vm \
437+
if env $mock_env \
445438
GVPROXY_PATH="$failing_gvproxy" wsl-vpnkit >"$log_dir/failing-gvproxy.log" 2>&1; then
446439
fail "failing gvproxy was accepted"
447440
fi
@@ -452,7 +445,7 @@ assert_clean
452445
echo "case: default route auto-detection"
453446
# shellcheck disable=SC2086
454447
start_background "$log_dir/autodetect.log" env $mock_env \
455-
WSL_INTEROP=1 WSL2_GATEWAY_IP= WSL2_TAP_NAME= WSL2_RESOLVCONF= \
448+
WSL2_GATEWAY_IP= WSL2_TAP_NAME= WSL2_RESOLVCONF= \
456449
wsl-vpnkit
457450
wait_for "wsltap was not created" interface_exists wsltap
458451
grep -q -- "WSL2_TAP_NAME=eth0" "$log_dir/autodetect.log" ||
@@ -479,7 +472,7 @@ EOF
479472
chmod 755 "$autodetect_path/ip"
480473
# shellcheck disable=SC2086
481474
start_background "$log_dir/autodetect-resolv.log" env $mock_env \
482-
PATH="$autodetect_path:$PATH" WSL_INTEROP=1 WSL2_GATEWAY_IP= \
475+
PATH="$autodetect_path:$PATH" WSL2_GATEWAY_IP= \
483476
WSL2_TAP_NAME= WSL2_RESOLVCONF="$resolvconf_autodetect" \
484477
wsl-vpnkit
485478
wait_for "wsltap was not created" interface_exists wsltap
@@ -495,7 +488,7 @@ cp /usr/local/bin/wsl-vm "$space_dir/temp vm"
495488
cp /usr/local/bin/wsl-gvproxy.exe "$space_dir/temp gvproxy"
496489
# shellcheck disable=SC2086
497490
start_background "$log_dir/space-paths.log" env \
498-
WSL_INTEROP=1 WSL2_GATEWAY_IP=$original_gateway WSL2_TAP_NAME=eth0 \
491+
WSL2_GATEWAY_IP=$original_gateway WSL2_TAP_NAME=eth0 \
499492
WSL2_RESOLVCONF=/etc/resolv.conf \
500493
VMEXEC_PATH="$space_dir/temp vm" \
501494
GVPROXY_PATH="$space_dir/temp gvproxy" \

wsl-vpnkit

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,6 @@ grep -q "automatically generated by WSL" "$WSL2_RESOLVCONF" >/dev/null
316316
if [ $? -eq 1 ]; then
317317
echo "resolv.conf has been modified without setting generateResolvConf"
318318
fi
319-
if [ ! -n "$WSL_INTEROP" ]; then
320-
echo "WSL interop not available"
321-
exit 1
322-
fi
323319
if ! "$GVPROXY_PATH" -help 2>/dev/null; then
324320
echo "$GVPROXY_PATH is not executable due to WSL interop settings or Windows permissions"
325321
exit 1

0 commit comments

Comments
 (0)