tests: cram: wait for controller NBAPI device before continuing

Tests were previously using `ubus wait_for Device.WiFi` to check readiness
after restarting prplMesh. However, `Device.WiFi` belongs to pWHM, not
prplMesh, so this was not a reliable signal that the controller/agent had
finished initializing.

Changes:
- Replace `ubus wait_for Device.WiFi` with
  `ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1`
  in all affected tests.
- Add the same wait step to wifi/wifi-scheduler.t, which previously had
  no readiness check at all.

This ensures the tests only continue once the local agent is registered
in the controller’s Data Model, reducing races around the first
AccessPointCommit and stabilizing the setup sequence.

Modified tests:
- arcadyan-mozart/100-prplmesh.t
- mxl25641-hdk-6/110-prplmesh-dataelements.t
- prpl-haze/100-prplmesh.t
- turris-omnia/100-prplmesh.t
- urx851-b0-dk/110-prplmesh-dataelements.t
- wnc-freedom/110-prplmesh-dataelements.t
- wifi/wifi-scheduler.t (added readiness check)

Note:
- `Device.1` is assumed to be the local agent; this is sufficient for
  single-agent setups. For multi-agent scenarios, a more robust readiness
  check (e.g. DevicesNumberOfEntries + RadiosNumberOfEntries) should be
  considered in a follow-up.

PPM-3523.

Signed-off-by: Dmytro Puz <d.puz@inango-systems.com>
This commit is contained in:
Dmytro Puz 2025-09-25 18:07:08 +02:00 committed by Hela Saadani
parent 0dd2e55adf
commit e77207979d
7 changed files with 8 additions and 6 deletions

View File

@ -53,7 +53,7 @@ Restart prplmesh:
$ R logger -t cram "Restart prplmesh"
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
Start wireless:

View File

@ -34,7 +34,7 @@ Restart prplmesh:
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
First call of AccessPointCommit, controller should push empty config to agents:

View File

@ -53,7 +53,7 @@ Restart prplmesh:
$ R logger -t cram "Restart prplmesh"
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
Start wireless:

View File

@ -29,7 +29,7 @@ Restart prplmesh:
$ R logger -t cram "Restart prplmesh"
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
Start wireless:

View File

@ -34,7 +34,7 @@ Restart prplmesh:
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
First call of AccessPointCommit, controller should push empty config to agents:

View File

@ -62,6 +62,8 @@ Configure controller:
$ R "sed -i 's/use_dataelements_vap_configs=0/use_dataelements_vap_configs=1/g' /opt/prplmesh/config/beerocks_controller.conf"
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
Create prplMesh acces point and enable it:
$ R logger -t cram "first call of AccessPointCommit pushes empty config, global teardown"

View File

@ -34,7 +34,7 @@ Restart prplmesh:
$ R "( /etc/init.d/prplmesh gateway_mode ; sleep 2 ) > /tmp/prplmesh-gw-mode.log 2>&1 ; logger -t prplmesh-gateway-mode < /tmp/prplmesh-gw-mode.log"
$ R "ubus -t 60 wait_for Device.WiFi"
$ R "ubus -t 60 wait_for X_PRPLWARE-COM_WiFiController.Network.Device.1"
First call of AccessPointCommit, controller should push empty config to agents: