ndctl, tests: firmware-update.sh post-test cleanup
PATCH 1/1 ndctl, tests: firmware-update.sh post-test cleanup
When firmware-update.sh is run multiple times by itself, all runs but the first fail with this:
+ ../ndctl/ndctl update-firmware -d nmem1 -f update-fw.img
Error: START FIRMWARE UPDATE failed: 0x9
Error: Another firmware upload in progress or finished.
Fix this by having the test properly clean up and disable all the nfit_test regions and unloading the nfit_test module, as we do in test/pmem-errors.sh et al.
--- test/firmware-update.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
test/firmware-update.sh +9 -2
@@ -6,6 +6,7 @@ [ -f "./ndctl/ndctl" ] && [ -x "./ndctl/ndctl" ] && ndctl="./ndctl/ndctl" [ -z "$ndctl" ] && echo "Couldn't find an ndctl binary" && exit 1 bus="nfit_test.0" +bus1="nfit_test.1" json2var="s/[{}\",]//g; s/:/=/g" rc=77 dev=""
@@ -41,6 +42,13 @@ reset() fi } +cleanup() +{ + $ndctl disable-region -b "$bus" all + $ndctl disable-region -b "$bus1" all + modprobe -r nfit_test +} + detect() { dev=$($ndctl list -b "$bus" -D | jq .[0].dev | tr -d '"')
@@ -59,6 +67,5 @@ rc=1 reset detect do_tests -reset +cleanup exit 0 -
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 11 lines · Ross Zwisler
When
firmware-update.shis run multiple times by itself, all runs but the first fail with this:+ ../ndctl/ndctl update-firmware -d nmem1 -f update-fw.img
Error: START FIRMWARE UPDATE failed:0x9Error: Another firmware upload in progress or finished.
Fix this by having the test properly clean up and disable all the
nfit_testregions and unloading thenfit_testmodule, as we do intest/pmem-errors.shet al.
Looks good to me:
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm