prplos/.gitlab/tests/cram/generic/acceleration-plan-components/150-deviceinfostats.t
Petr Štetiar e893e4d4f2 profiles: prpl_core.yml: feed_amx: amx-cli: bump stdin fix
Bump feed_amx to f44cd0908bf6 ("amx-cli: bump to PCF-2445 stdin fix")
so prpl_core uses the amx-cli PCF-2445 MR head.

This brings the reviewed runtime change series:
- 7c78345ad543 ("ci: enable support for Cobertura XML report generation")
- 93740e7127a4 ("include_priv: align private header guards")
- 6f245591b78e ("amx-cli: ignore stdin after positional command")

The amx-cli change makes positional amx-cli and ba-cli commands exit
after the requested command instead of reading inherited stdin. This
prevents cram-over-ssh scripts from having their remaining test input
consumed by ba-cli.

Add a generic cram regression test that verifies positional ba-cli
commands preserve inherited stdin and do not wait on an open stdin pipe,
while explicit automated stdin-script mode still reads stdin.

The cram expectations for existing ba-cli calls still modeled the old
interactive output shape: prompt/header text, command output, and a
trailing prompt or blank line from the inherited stdin session. After
the stdin fix, one-shot ba-cli commands emit only command output, so
those filters either drop real data or keep obsolete blank-line
expectations.  Adjust the affected tests to filter only prompts and
empty lines so they match the corrected one-shot contract.

One syslog cram check also reuses the TR-181 PatternMatch value as a
grep -E expression. That value is stored with syslog-ng/basic-regex
escaped grouping, so the prompt cleanup left grep -E comparing DHCP log
lines against \(o|tr181-|dnsmasq-\)?dhcp. Extract only the PatternMatch
assignment and translate escaped parentheses before using the value as an
ERE, otherwise valid DHCP log lines are reported as unexpected output.

References: PCF-2445, PCF-2495, PPM-4088
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
signed-off-by: Hela Saadani <hela.saadani_ext@softathome.com>
2026-06-01 10:41:21 +00:00

125 lines
4.3 KiB
Perl

Create R alias:
$ alias R="${CRAM_REMOTE_COMMAND:-}"
Check GetBusStats() function:
$ R "ba-cli 'DeviceInfo.GetBusStats()' | grep -Ev '^(>|$)'"
DeviceInfo.GetBusStats() returned
[
{
ubus:/var/run/ubus/ubus.sock = {
rx = {
operation = {
invoke = [0-9]+ (re)
}
},
tx = {
operation = {
add = [0-9]+, (re)
async_invoke = [0-9]+, (re)
del = [0-9]+, (re)
describe = [0-9]+, (re)
get = [0-9]+, (re)
get_filtered = [0-9]+, (re)
get_instances = [0-9]+, (re)
get_supported = [0-9]+, (re)
has = [0-9]+, (re)
invoke = [0-9]+, (re)
list = [0-9]+, (re)
set = [0-9]+, (re)
subscribe = [0-9]+, (re)
unsubscribe = [0-9]+, (re)
wait_for = [0-9]+ (re)
}
}
},
usp:/var/run/usp/broker_agent_path = {
rx = {
operation = {
add = [0-9]+, (re)
del = [0-9]+, (re)
get = [0-9]+, (re)
get_instances = [0-9]+, (re)
get_supported = [0-9]+, (re)
invoke = [0-9]+, (re)
notify = [0-9]+, (re)
set = [0-9]+ (re)
}
},
tx = {
operation = {
add = [0-9]+, (re)
async_invoke = [0-9]+, (re)
del = [0-9]+, (re)
describe = [0-9]+, (re)
get = [0-9]+, (re)
get_filtered = [0-9]+, (re)
get_instances = [0-9]+, (re)
get_supported = [0-9]+, (re)
has = [0-9]+, (re)
invoke = [0-9]+, (re)
list = [0-9]+, (re)
set = [0-9]+, (re)
subscribe = [0-9]+, (re)
unsubscribe = [0-9]+, (re)
wait_for = [0-9]+ (re)
}
}
},
usp:/var/run/usp/broker_controller_path = {
rx = {
operation = {
add = [0-9]+, (re)
del = [0-9]+, (re)
get = [0-9]+, (re)
get_instances = [0-9]+, (re)
get_supported = [0-9]+, (re)
invoke = [0-9]+, (re)
notify = [0-9]+, (re)
set = [0-9]+ (re)
}
},
tx = {
operation = {
add = [0-9]+, (re)
async_invoke = [0-9]+, (re)
del = [0-9]+, (re)
describe = [0-9]+, (re)
get = [0-9]+, (re)
get_filtered = [0-9]+, (re)
get_instances = [0-9]+, (re)
get_supported = [0-9]+, (re)
has = [0-9]+, (re)
invoke = [0-9]+, (re)
list = [0-9]+, (re)
set = [0-9]+, (re)
subscribe = [0-9]+, (re)
unsubscribe = [0-9]+, (re)
wait_for = [0-9]+ (re)
}
}
}
}
]
Check stats after doing an action:
$ init_cnt=$(R "ba-cli 'DeviceInfo.GetBusStats()' | grep -A 10 'ubus:/var/run/ubus/ubus.sock' | grep 'rx' -A 5 | grep 'invoke' | awk -F'= ' '{print \$2}'")
$ echo "$init_cnt"
[0-9]+ (re)
$ R "ubus-cli 'DeviceInfo._get()' | grep -v '>' | grep 'DeviceInfo._get()'"
DeviceInfo._get() returned
$ final_cnt=$(R "ba-cli 'DeviceInfo.GetBusStats()' | grep -A 10 'ubus:/var/run/ubus/ubus.sock' | grep 'rx' -A 5 | grep 'invoke' | awk -F'= ' '{print \$2}'")
$ echo "$final_cnt"
[0-9]+ (re)
$ if [ "$final_cnt" -gt "$init_cnt" ]; then
> echo "Test Successful"
> else
> echo "Test failed: final_cnt($final_cnt) is not greater then init_cnt($init_cnt)"
> fi
Test Successful