mkdir -p $basemodpath-tests/fs
mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
mv $basemodpath/fs/obd_test.ko $basemodpath-tests/fs/obd_test.ko
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
-mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
+mv $basemodpath/fs/kinode.ko $basemodpath-tests/fs/kinode.ko
%endif
%endif
if (strlen(fname) < 1) {
pr_err(PREFIX " invalid file name '%s'\n", run_id, fname);
- goto out;
+ return -EINVAL;
}
rc = stat_file(&stbuf1);
if (rc) {
pr_err(PREFIX " direct stat failed: %d\n", run_id, rc);
- goto out;
+ return -EINVAL;
}
/* Run the same from a kthread. */
thr = kthread_run(stat_thread, &stbuf2, "kinode_%u", run_id);
if (IS_ERR(thr)) {
pr_err(PREFIX " Cannot create kthread\n", run_id);
- goto out;
+ return -EINVAL;
}
/* Wait for the thread to start, then wait for it to
rc = kthread_stop(thr);
if (rc) {
pr_err(PREFIX " indirect stat failed: %d\n", run_id, rc);
- goto out;
+ return -EINVAL;
}
if (stbuf1.ino != stbuf2.ino)
pr_err(PREFIX " inode numbers are identical: %llu\n",
run_id, stbuf1.ino);
-out:
- /* Don't load. */
- return -EINVAL;
+ return 0;
}
static void __exit kinode_exit(void)
# failure on fio io_uring I/O engine.
always_except LU-17289 906
fi
-elif [ -r /etc/os-release ]; then
- if grep -qi ubuntu /etc/os-release; then
- ubuntu_version=$(version_code $(sed -n -e 's/"//g' \
- -e 's/^VERSION=//p' \
- /etc/os-release |
- awk '{ print $1 }'))
-
- if [[ $ubuntu_version -gt $(version_code 16.0.0) ]]; then
- always_except LU-10366 410
- fi
- fi
fi
build_test_filter
{
[[ $CLIENT_VERSION -lt $(version_code 2.9.59) ]] &&
skip "Need client version at least 2.9.59"
- [ -f $LUSTRE/tests/kernel/kinode.ko ] ||
- skip "Need MODULES build"
# Create a file, and stat it from the kernel
local testfile=$DIR/$tfile
local run_id=$RANDOM
local my_ino=$(stat --format "%i" $testfile)
- # Try to insert the module. This will always fail as the
- # module is designed to not be inserted.
- insmod $LUSTRE/tests/kernel/kinode.ko run_id=$run_id fname=$testfile \
- &> /dev/null
+ # Try to insert the module.
+ load_module kunit/kinode run_id=$run_id fname=$testfile ||
+ error "load_module failed"
# Anything but success is a test failure
dmesg | grep -q \
"lustre_kinode_$run_id: inode numbers are identical: $my_ino" ||
error "no inode match"
+
+ # Remove the test module
+ rmmod -v kinode ||
+ error "rmmod failed (may trigger a failure in a later test)"
}
run_test 410 "Test inode number returned from kernel thread"