@@ -259,22 +259,27 @@ jobs:
259259
260260 ./awl.exe cli gateway client use --name awl-tester
261261 ./awl.exe cli gateway status
262- ROUTES_ON=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1 -ErrorAction SilentlyContinue | Measure-Object).Count')
263- NRPT_ON=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count')
262+ ROUTES_ON=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1 -ErrorAction SilentlyContinue | Measure-Object).Count' | tr -d '\r' )
263+ NRPT_ON=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count' | tr -d '\r' )
264264 powershell -NoProfile -Command 'Get-DnsClientNrptPolicy | Format-List Namespace,NameServers'
265- powershell -NoProfile -Command 'Get-NetRoute -DestinationPrefix ::/1,8000::/1 -ErrorAction SilentlyContinue | Format-List DestinationPrefix,InterfaceAlias' # v6 fence diagnostics
265+ # Route diagnostics incl. lifetimes/protocol: a route created without
266+ # InitializeIpForwardEntry shows zero lifetimes and is ignored by the
267+ # forwarding path while still being listed here.
268+ powershell -NoProfile -Command 'Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1,::/1,8000::/1 -ErrorAction SilentlyContinue | Format-List DestinationPrefix,InterfaceAlias,RouteMetric,Protocol,ValidLifetime,PreferredLifetime'
266269 # Tolerate a failed curl here so we always reach `client stop` below
267270 # (a broken tunnel must not leave the runner black-holed); the
268271 # `test -n "$IP_GW"` assertion after teardown turns it into a clean failure.
269272 IP_GW=$(curl4 || true); echo "egress IP (via gateway): $IP_GW"
270273
271274 ./awl.exe cli gateway client stop
272- ROUTES_OFF=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1 -ErrorAction SilentlyContinue | Measure-Object).Count')
273- NRPT_OFF=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count')
275+ ROUTES_OFF=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1 -ErrorAction SilentlyContinue | Measure-Object).Count' | tr -d '\r' )
276+ NRPT_OFF=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count' | tr -d '\r' )
274277 IP_REVERTED=$(curl4); echo "egress IP (reverted): $IP_REVERTED"
275278
276279 # Assertions run with the gateway already disabled, so a failure here
277- # can't leave the runner's egress black-holed.
280+ # can't leave the runner's egress black-holed. Values are echoed
281+ # first so a failed assertion is attributable from the log alone.
282+ echo "ROUTES_ON=$ROUTES_ON NRPT_ON=$NRPT_ON ROUTES_OFF=$ROUTES_OFF NRPT_OFF=$NRPT_OFF"
278283 test "$ROUTES_ON" -eq 2 # /1 pair installed while gateway is on
279284 test "$NRPT_ON" -ge 1 # full-capture NRPT rule while gateway is on
280285 test -n "$IP_GW" # traffic really flowed through the exit node
@@ -293,12 +298,14 @@ jobs:
293298 # awl is gone. Route absence can't distinguish a clean teardown from a
294299 # crash here — the /1 routes are bound to the Wintun LUID and die with
295300 # the adapter either way — so this only re-verifies crash semantics.
296- DANGLING=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1,::/1,8000::/1 -ErrorAction SilentlyContinue | Measure-Object).Count')
301+ DANGLING=$(powershell -NoProfile -Command '(Get-NetRoute -DestinationPrefix 0.0.0.0/1,128.0.0.0/1,::/1,8000::/1 -ErrorAction SilentlyContinue | Measure-Object).Count' | tr -d '\r')
302+ echo "DANGLING=$DANGLING"
297303 test "$DANGLING" -eq 0
298304 # The NRPT catch-all rule CAN distinguish them: it lives in the
299305 # registry and survives a killed process, but the graceful shutdown
300306 # path removes it — its absence proves the shutdown teardown ran
301307 # (the Windows analogue of the interface-independent fwmark ip rule
302308 # asserted on Linux).
303- NRPT_SHUTDOWN=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count')
309+ NRPT_SHUTDOWN=$(powershell -NoProfile -Command '(Get-DnsClientNrptPolicy | Where-Object { $_.Namespace -eq "." } | Measure-Object).Count' | tr -d '\r')
310+ echo "NRPT_SHUTDOWN=$NRPT_SHUTDOWN"
304311 test "$NRPT_SHUTDOWN" -eq 0
0 commit comments