@@ -31,6 +31,10 @@ if [ -z $TEST_PATH ]; then
export TEST_PATH=.
fi
+if [ ! -v NDCTL_TEST_FAMILY ]; then
+ export NDCTL_TEST_FAMILY=INTEL
+fi
+
# NFIT_TEST_BUS[01]
#
NFIT_TEST_BUS0="nfit_test.0"
@@ -111,6 +115,9 @@ _cleanup()
$NDCTL disable-region -b $NFIT_TEST_BUS0 all
$NDCTL disable-region -b $NFIT_TEST_BUS1 all
modprobe -r nfit_test
+ if [ $NDCTL_TEST_FAMILY == "INTEL" ]; then
+ modprobe -r nfit
+ fi
}
_init()
@@ -130,8 +130,22 @@ void ndctl_test_module_remove(struct kmod_ctx **ctx, struct kmod_module **mod,
if (rc < 0 && rc != -ENOENT) {
fprintf(stderr, "couldn't remove module %s\n",
strerror(-rc));
+ kmod_unref(*ctx);
+ return;
}
+ rc = kmod_module_new_from_name(*ctx, "nfit", mod);
+ if (rc == 0) {
+ int state = kmod_module_get_initstate(*mod);
+
+ if (state > 0) {
+ rc = kmod_module_remove_module(*mod, 0);
+ if (rc < 0) {
+ fprintf(stderr, "couldn't remove module %s\n",
+ strerror(-rc));
+ }
+ }
+ }
kmod_unref(*ctx);
}
The nfit module which is needed for nfit_test is probed and is never unloaded. The future patches attempt to load the ndtest modules and continue the tests for PAPR family. Let there be clean state, so unload it. Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com> --- test/common | 7 +++++++ test/core.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+)