Skip to content
Contents
GuidesOpenWrt

Run a TAP test on OpenWrt when perlbase-test has no prove command

After installing perlbase-test, distinguish a shell “command not found” error from a running prove script complaining about App/Prove.pm. Check the executable in the first case and the module search path of that Perl interpreter in the second.

After installing perlbase-test, distinguish a shell “command not found” error from a running prove script complaining about App/Prove.pm. Check the executable in the first case and the module search path of that Perl interpreter in the second.

Check the executable and package on the router running the test

command -v prove || echo no-prove
apk list --installed perlbase-test
apk info -L perlbase-test
perl -MTest::Harness -e 'print "Test::Harness loaded\n"'

On an earlier 25.12.3 x86/64 system, the prove script ran but could not load App/Prove.pm. On our isolated 25.12.6 x86/64 guest with 5.40.0-r6 installed, the module loaded but no prove executable was on the path. If you do have the script, check its interpreter line, the directories in the reported @INC and where that script came from.

Run a test with a known result

work=$(mktemp -d) || exit 1
cd "$work" || exit 1
printf '%s\n' 'print "1..1\nok 1 - sandbox\n";' > sample.t
perl -MTest::Harness -e 'runtests(@ARGV)' sample.t

The x86/64 guest has no prove executable, but Test::Harness returns Result: PASS

One file, one test and PASS verify this sample through Test::Harness. A pipeline that uses prove plugins, parallel options or its state cache still needs its original suite tested on a build host that provides the command. If the module itself fails to load, check the first missing module against the installed package contents. The sample stays in the temporary directory.

When OpenWrt cannot install a package

Explore hardware

Comments