ci: 100-captiveportal.t: fix intermittent failure by checking State instead of Status
Problem: CRAM test for the CaptivePortal module was failing on OpenWrt 24.10. Cause: Cram test expected HTTP 307 Temporary Redirect, but occasionally received 200 OK due to a timing issue while openNDS was starting to intercept traffic. Solution: Added a 1-second delay and updated the test to verify CaptivePortal.State instead of CaptivePortal.Status, ensuring validation occurs only after openNDS is actively intercepting traffic. References: PCF-1943 Signed-off-by: Girdhari Yadav <girdhari.yadav_ext@softathome.com>
This commit is contained in:
parent
de1f8d40a9
commit
f8fee02c87
@ -7,6 +7,7 @@ Enable Captive Portal (not activated by default):
|
||||
$ R "ba-cli 'CaptivePortal.Enable=1'" >/dev/null
|
||||
$ R "ba-cli 'CaptivePortal.Status?' | sed -n '2p'"
|
||||
CaptivePortal.Status="Enabled"
|
||||
$ sleep 1
|
||||
|
||||
Disable WAN using IP datamodel and check that Captive Portal starts intercepting:
|
||||
|
||||
@ -20,8 +21,8 @@ Get a DHCP lease from the router (openNDS requires clients to be registered):
|
||||
Wait for status change:
|
||||
|
||||
$ sleep 15
|
||||
$ R "ba-cli -lj 'ubus-protected;CaptivePortal.Status?'" 2>&1 | grep -v "^>" | sed -n "4p"
|
||||
[{"CaptivePortal.":{"Status":"Enabled"}}]
|
||||
$ R "ba-cli -lj 'ubus-protected;CaptivePortal.State?'" 2>&1 | grep -v "^>" | sed -n "4p"
|
||||
[{"CaptivePortal.":{"State":"Running"}}]
|
||||
|
||||
Check openNDS http interface has been opened on br-lan:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user