Using coreutils' pr, a nicer table is printed out with the
results.
Signed-off-by: Daniel Díaz <daniel.diaz(a)linaro.org>
---
tools/testing/selftests/intel_pstate/run.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index bde31a0..a40068b 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -92,18 +92,28 @@ done
[ $EVALUATE_ONLY -eq 0 ] && cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null
-echo "=============================================================================="
+echo "========================================================================"
echo "The marketing frequency of the cpu is $mkt_freq MHz"
echo "The maximum frequency of the cpu is $max_freq MHz"
echo "The minimum frequency of the cpu is $min_freq MHz"
# make a pretty table
-echo "Target Actual Difference MSR(0x199) max_perf_pct"
+echo "Target Actual Difference MSR(0x199) max_perf_pct" | tr " " "\n" > /tmp/result.tab
for freq in `seq $max_freq -100 $min_freq`
do
result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { print $1 } ')
msr=$(cat /tmp/result.${freq} | grep "msr" | awk ' { print $3 } ')
max_perf_pct=$(cat /tmp/result.${freq} | grep "max_perf_pct" | awk ' { print $2 } ' )
- echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))"
+ cat >> /tmp/result.tab << EOF
+$freq
+$result_freq
+$((result_freq - freq))
+$msr
+$((max_perf_pct * max_freq))
+EOF
done
+
+# print the table
+pr -aTt -5 < /tmp/result.tab
+
exit 0
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Round two cleans up a few misc script and build items, adds a shadow
variable test, and reduces the total livepatch kselftest runtime to ~45
seconds.
The tests run on top of Petr's v11 atomic replace feature and v2 of the
shadow variable enhancement patchsets:
[PATCH 0/8] livepatch: Atomic replace feature
https://lkml.kernel.org/r/20180323120028.31451-1-pmladek@suse.com
[PATCH v2 0/2] livepatch: Allocate and free shadow variables more safely
https://lkml.kernel.org/r/20180405122315.29065-1-pmladek@suse.com
Questions for v3:
- Should we split off the atomic replace and shadow variable update
tests so that the this patchset could be merged before the ones
listed above?
- I didn't remove any of the sample modules. If anyone thinks any of
them should go, let me know. They serve as nice, simple examples so
I thought they should all stay.
- Module naming convention: to make the test script easier to grep
module names and filenames, I broke with livepatch convention and
used underscores instead of dashes. I didn't think it worth the
regex foo to flip back and forth in the test script.
- More tests from Libor and Nicolai would be welcome!
-- Maybe we separate quicktests (like these) from longer tests if
needed?
Here's a sample output from a successful test run:
% time make -C tools/testing/selftests TARGETS=livepatch run_tests
make: Entering directory `/root/linux/tools/testing/selftests'
make[1]: Entering directory `/root/linux/tools/testing/selftests/livepatch'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/linux/tools/testing/selftests/livepatch'
make[1]: Entering directory `/root/linux/tools/testing/selftests/livepatch'
TAP version 13
selftests: test-livepatch.sh
========================================
TEST: basic function patching ... ok
TEST: multiple livepatches ... ok
TEST: atomic replace livepatch ... ok
ok 1..1 selftests: test-livepatch.sh [PASS]
selftests: test-callbacks.sh
========================================
TEST: target module before livepatch ... ok
TEST: module_coming notifier ... ok
TEST: module_going notifier ... ok
TEST: module_coming and module_going notifiers ... ok
TEST: target module not present ... ok
TEST: pre-patch callback -ENODEV ... ok
TEST: module_coming + pre-patch callback -ENODEV ... ok
TEST: multiple target modules ... ok
TEST: busy target module ... ok
TEST: multiple livepatches ... ok
TEST: atomic replace ... ok
ok 1..2 selftests: test-callbacks.sh [PASS]
selftests: test-shadow-vars.sh
========================================
TEST: basic shadow variable API ... ok
ok 1..3 selftests: test-shadow-vars.sh [PASS]
make[1]: Leaving directory `/root/linux/tools/testing/selftests/livepatch'
make: Leaving directory `/root/linux/tools/testing/selftests'
real 0m46.166s
user 0m0.436s
sys 0m1.244s
changes from v1:
- Only add $(CC_FLAGS_FTRACE) for target modules
- Remove between test delay
- Reduce RETRY_INTERVAL to .1 sec
- Reduce test_callback_mod's busymod_work_func delay from 60 to 10 sec
- s/PASS/ok and s/FAIL/not ok for test output
- Move test descriptions from Documentation/livepatch/callbacks.txt
into tools/testing/selftests/livepatch/test-callbacks.sh
- Add a shadow variable test script and module
- Add a short tools/testing/selftests/livepatch/README
- to += linux-kselftest(a)vger.kernel.org
- cc += Libor, Nicolai, Artem
change from rfc:
- SPDX-License-Identifiers
- Moved livepatch test modules into lib/livepatch
- Renamed livepatch.sh (filename suffix)
- Reduced between-test delay time
- Split off common functions.sh file
- Split into separate livepatch, callbacks, and shadow-vars scrips
- Gave the tests short descriptions instead of TEST1, TEST2, etc.
Joe Lawrence (1):
selftests/livepatch: introduce tests
Documentation/livepatch/callbacks.txt | 487 -----------------
lib/Kconfig.debug | 12 +
lib/Makefile | 2 +
lib/livepatch/Makefile | 15 +
lib/livepatch/test_klp_atomic_replace.c | 69 +++
lib/livepatch/test_klp_callbacks_busy.c | 43 ++
lib/livepatch/test_klp_callbacks_demo.c | 132 +++++
lib/livepatch/test_klp_callbacks_demo2.c | 104 ++++
lib/livepatch/test_klp_callbacks_mod.c | 24 +
lib/livepatch/test_klp_livepatch.c | 62 +++
lib/livepatch/test_klp_shadow_vars.c | 235 ++++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/livepatch/Makefile | 8 +
tools/testing/selftests/livepatch/config | 1 +
tools/testing/selftests/livepatch/functions.sh | 196 +++++++
.../testing/selftests/livepatch/test-callbacks.sh | 607 +++++++++++++++++++++
.../testing/selftests/livepatch/test-livepatch.sh | 173 ++++++
.../selftests/livepatch/test-shadow-vars.sh | 60 ++
18 files changed, 1744 insertions(+), 487 deletions(-)
create mode 100644 lib/livepatch/Makefile
create mode 100644 lib/livepatch/test_klp_atomic_replace.c
create mode 100644 lib/livepatch/test_klp_callbacks_busy.c
create mode 100644 lib/livepatch/test_klp_callbacks_demo.c
create mode 100644 lib/livepatch/test_klp_callbacks_demo2.c
create mode 100644 lib/livepatch/test_klp_callbacks_mod.c
create mode 100644 lib/livepatch/test_klp_livepatch.c
create mode 100644 lib/livepatch/test_klp_shadow_vars.c
create mode 100644 tools/testing/selftests/livepatch/Makefile
create mode 100644 tools/testing/selftests/livepatch/config
create mode 100644 tools/testing/selftests/livepatch/functions.sh
create mode 100755 tools/testing/selftests/livepatch/test-callbacks.sh
create mode 100755 tools/testing/selftests/livepatch/test-livepatch.sh
create mode 100755 tools/testing/selftests/livepatch/test-shadow-vars.sh
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
In commit ce290a19609d ("selftests: add devpts selftests"), the
filesystems directory was added to the top-level selftests Makefile.
That had the effect of causing the existing dnotify_test in the
filesystems directory to now be run as part of the default selftests
test-run. Unfortunately dnotify_test is actually an infinite loop.
Fix it by moving dnotify_test to TEST_GEN_PROGS_EXTENDED, which says
that it's a generated file (ie. built) but should not be run as part
of the default test suite run (it's an "extendend" test).
While we're here cleanup a few other things, devpts_pts should be in
TEST_GEN_PROGS to indicate that it's built, and with the above two
changes we no longer need a custom all or clean rule.
Fixes: ce290a19609d ("selftests: add devpts selftests")
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
---
tools/testing/selftests/filesystems/Makefile | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile
index 4e6d09fb166f..5c7d7001ad37 100644
--- a/tools/testing/selftests/filesystems/Makefile
+++ b/tools/testing/selftests/filesystems/Makefile
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-TEST_PROGS := dnotify_test devpts_pts
-all: $(TEST_PROGS)
-include ../lib.mk
+TEST_GEN_PROGS := devpts_pts
+TEST_GEN_PROGS_EXTENDED := dnotify_test
-clean:
- rm -fr $(TEST_PROGS)
+include ../lib.mk
--
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
tools/testing/selftests/bpf/.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 9cf83f895d98..5e1ab2f0eb79 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -12,3 +12,6 @@ test_tcpbpf_user
test_verifier_log
feature
test_libbpf_open
+test_sock
+test_sock_addr
+urandom_read
--
2.16.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Colin Ian King <colin.king(a)canonical.com>
Trivial fix to spelling mistakes in comment and message text
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
tools/testing/selftests/kvm/lib/sparsebit.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 7ca1bb40c498..e213d513dc61 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -1435,7 +1435,7 @@ vm_paddr_t vm_phy_page_alloc(struct kvm_vm *vm,
sparsebit_idx_t pg;
TEST_ASSERT((paddr_min % vm->page_size) == 0, "Min physical address "
- "not divisable by page size.\n"
+ "not divisible by page size.\n"
" paddr_min: 0x%lx page_size: 0x%x",
paddr_min, vm->page_size);
diff --git a/tools/testing/selftests/kvm/lib/sparsebit.c b/tools/testing/selftests/kvm/lib/sparsebit.c
index 0c5cf3e0cb6f..b132bc95d183 100644
--- a/tools/testing/selftests/kvm/lib/sparsebit.c
+++ b/tools/testing/selftests/kvm/lib/sparsebit.c
@@ -121,7 +121,7 @@
* avoided by moving the setting of the nodes mask bits into
* the previous nodes num_after setting.
*
- * + Node starting index is evenly divisable by the number of bits
+ * + Node starting index is evenly divisible by the number of bits
* within a nodes mask member.
*
* + Nodes never represent a range of bits that wrap around the
@@ -1741,7 +1741,7 @@ void sparsebit_validate_internal(struct sparsebit *s)
/* Validate node index is divisible by the mask size */
if (nodep->idx % MASK_BITS) {
- fprintf(stderr, "Node index not divisable by "
+ fprintf(stderr, "Node index not divisible by "
"mask size,\n"
" nodep: %p nodep->idx: 0x%lx "
"MASK_BITS: %lu\n",
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
gcc warns that 'heap_type' is not initialized if we don't come through
any of the two 'case' statesments before:
ionapp_export.c:91:2: warning: ‘heap_type’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the current code, we initialize the heap_type to -1 before the 'case'
statements. We also change the print_usage function to state that
heap_type and heap_size isn't optional, they are mandatory.
Fixes: 47a18c42d992 ("android/ion: userspace test utility for ion buffer sharing")
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
.../testing/selftests/android/ion/ionapp_export.c | 23 +++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/android/ion/ionapp_export.c b/tools/testing/selftests/android/ion/ionapp_export.c
index a944e72621a9..b42f803e9d2a 100644
--- a/tools/testing/selftests/android/ion/ionapp_export.c
+++ b/tools/testing/selftests/android/ion/ionapp_export.c
@@ -31,16 +31,24 @@
void print_usage(int argc, char *argv[])
{
- printf("Usage: %s [-h <help>] [-i <heap id>] [-s <size in bytes>]\n",
+ printf("Usage: %s [-h <help>] -i <heap id> -s <size in bytes>\n",
argv[0]);
}
+void heap_type_error_text(void)
+{
+ printf("heap_type must be specified\n");
+ printf(" need to specify -i <heap_type>\n");
+ printf(" supported heap types 0 or 1\n");
+}
+
int main(int argc, char *argv[])
{
int opt, ret, status, heapid;
int sockfd, client_fd, shared_fd;
unsigned char *map_buf;
- unsigned long map_len, heap_type, heap_size, flags;
+ unsigned long map_len, heap_size, flags;
+ long heap_type;
struct ion_buffer_info info;
struct socket_info skinfo;
@@ -50,6 +58,7 @@ int main(int argc, char *argv[])
}
heap_size = 0;
+ heap_type = -1;
flags = 0;
while ((opt = getopt(argc, argv, "hi:s:")) != -1) {
@@ -68,7 +77,8 @@ int main(int argc, char *argv[])
heap_type = ION_HEAP_TYPE_SYSTEM_CONTIG;
break;
default:
- printf("ERROR: heap type not supported\n");
+ heap_type_error_text();
+ print_usage(argc, argv);
exit(1);
}
break;
@@ -82,8 +92,15 @@ int main(int argc, char *argv[])
}
}
+ if (heap_type < 0) {
+ heap_type_error_text();
+ print_usage(argc, argv);
+ exit(1);
+ }
+
if (heap_size <= 0) {
printf("heap_size cannot be 0\n");
+ printf(" need to specify -s <heap_size>\n");
print_usage(argc, argv);
exit(1);
}
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Linus,
Please pull the following Kselftest update for 4.17-rc1
This Kselftest update for 4.17-rc1 consists of:
- Test build error fixes.
- Fixes to prevent intel_pstate from building on non-x86 systems.
- New test for ion with vgem driver.
- Change to print the test name to /dev/kmsg to add context to kernel
failures if any uncovered from running the test.
- Kselftest framework enhancements to add KSFT_TAP_LEVEL environment
variable to prevent nested TAP headers being printed in the Kselftest
output. Nested TAP13 headers could cause problems for some parsers.
This change suppresses the nested headers from test programs and test
shell scripts with changes to framework and Makefiles without changing
the tests.
Diff for the update is attached.
thanks,
-- Shuah
-----------------------------------------------------------------------------------
The following changes since commit 661e50bc853209e41a5c14a290ca4decc43cbfd1:
Linux 4.16-rc4 (2018-03-04 14:54:11 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.17-rc1
for you to fetch changes up to 6aa69043d9f3f4adc5b3817ccfcac1fddfe10ded:
selftests/intel_pstate: Fix build rule for x86 (2018-04-02 11:55:47 -0600)
----------------------------------------------------------------
linux-kselftest-4.17-rc1
This Kselftest update for 4.17-rc1 consists of:
- Test build error fixes.
- Fixes to prevent intel_pstate from building on non-x86 systems.
- New test for ion with vgem driver.
- Change to print the test name to /dev/kmsg to add context to kernel
failures if any uncovered from running the test.
- Kselftest framework enhancements to add KSFT_TAP_LEVEL environment
variable to prevent nested TAP headers being printed in the Kselftest
output. Nested TAP13 headers could cause problems for some parsers.
This change suppresses the nested headers from test programs and test
shell scripts with changes to framework and Makefiles without changing
the tests.
----------------------------------------------------------------
Anders Roxell (1):
selftests/android/ion: Makefile: fix build error
Daniel Díaz (1):
selftests/intel_pstate: Fix build rule for x86
Kees Cook (1):
selftests/seccomp: Allow get_metadata to XFAIL
Laura Abbott (2):
selftests: ion: Remove some prints
selftests: ion: Add simple test with the vgem driver
Michael Ellerman (1):
selftests: Print the test we're running to /dev/kmsg
Shuah Khan (4):
selftests: kselftest framework: add handling for TAP header level
selftests: lib.mk set KSFT_TAP_LEVEL to prevent nested TAP headers
selftests: Makefile set KSFT_TAP_LEVEL to prevent nested TAP headers
selftests: futex Makefile add top level TAP header echo to RUN_TESTS
tools/testing/selftests/Makefile | 11 +-
tools/testing/selftests/android/ion/.gitignore | 1 +
tools/testing/selftests/android/ion/Makefile | 5 +-
tools/testing/selftests/android/ion/config | 1 +
tools/testing/selftests/android/ion/ionmap_test.c | 136 ++++++++++++++++++++++
tools/testing/selftests/android/ion/ionutils.c | 6 -
tools/testing/selftests/futex/Makefile | 4 +
tools/testing/selftests/intel_pstate/Makefile | 5 +-
tools/testing/selftests/kselftest.h | 3 +-
tools/testing/selftests/kselftest_harness.h | 26 ++++-
tools/testing/selftests/lib.mk | 1 +
tools/testing/selftests/seccomp/seccomp_bpf.c | 15 ++-
12 files changed, 200 insertions(+), 14 deletions(-)
create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c
-----------------------------------------------------------------------------------
gcc warns about implicit declaration.
gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/
-I../../../../include/ -I../../../../usr/include/
memfd_test.c common.o -o memfd_test
memfd_test.c: In function ‘mfd_assert_get_seals’:
memfd_test.c:74:6: warning: implicit declaration of function ‘fcntl’
[-Wimplicit-function-declaration]
r = fcntl(fd, F_GET_SEALS);
^~~~~
memfd_test.c: In function ‘mfd_assert_open’:
memfd_test.c:197:6: warning: implicit declaration of function ‘open’
[-Wimplicit-function-declaration]
r = open(buf, flags, mode);
^~~~
memfd_test.c: In function ‘mfd_assert_write’:
memfd_test.c:328:6: warning: implicit declaration of function ‘fallocate’
[-Wimplicit-function-declaration]
r = fallocate(fd,
^~~~~~~~~
In the current code, we include the headers that the functions want
according to the man pages, and we add some defines that will be used if
they isn't found in glibc. The defines was added into the kernel source
in kernel >= 3.16 and glibc requires kernel header files >= 3.2.
Fixes: 4f5ce5e8d7e2 ("selftests: add memfd_create() + sealing tests")
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
tools/testing/selftests/memfd/memfd_test.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index 10baa1652fc2..0dbeb29c094c 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -6,7 +6,6 @@
#include <inttypes.h>
#include <limits.h>
#include <linux/falloc.h>
-#include <linux/fcntl.h>
#include <linux/memfd.h>
#include <sched.h>
#include <stdio.h>
@@ -14,13 +13,37 @@
#include <signal.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/wait.h>
+#include <fcntl.h>
#include <unistd.h>
#include "common.h"
+#ifndef F_LINUX_SPECIFIC_BASE
+# define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#ifndef F_ADD_SEALS
+# define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#endif
+#ifndef F_GET_SEALS
+# define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
+#endif
+#ifndef F_SEAL_SEAL
+# define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
+#endif
+#ifndef F_SEAL_SHRINK
+# define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
+#endif
+#ifndef F_SEAL_GROW
+# define F_SEAL_GROW 0x0004 /* prevent file from growing */
+#endif
+#ifndef F_SEAL_WRITE
+# define F_SEAL_WRITE 0x0008 /* prevent writes */
+#endif
+
#define MEMFD_STR "memfd:"
#define MEMFD_HUGE_STR "memfd-hugetlb:"
#define SHARED_FT_STR "(shared file-table)"
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Commit 65c79230576 tried to clear the custom firmware path on exit by
writing a single space to the firmware_class.path parameter. This
doesn't work because nothing strips this space from the value stored
and fw_get_filesystem_firmware() only ignores zero-length paths.
Instead, write a null byte.
Fixes: 0a8adf58475 ("test: add firmware_class loader test")
Fixes: 65c79230576 ("test_firmware: fix setting old custom fw path back on exit")
Signed-off-by: Ben Hutchings <ben.hutchings(a)codethink.co.uk>
---
tools/testing/selftests/firmware/fw_filesystem.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index f9508e1a4058..6b63b6bf2661 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -46,9 +46,11 @@ test_finish()
echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout
fi
if [ "$OLD_FWPATH" = "" ]; then
- OLD_FWPATH=" "
+ # A zero-length write won't work; write a null byte
+ printf '\000' >/sys/module/firmware_class/parameters/path
+ else
+ echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path
fi
- echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path
rm -f "$FW"
rmdir "$FWPATH"
}
--
2.16.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html