diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:35:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:35:10 -0400 |
commit | 57d326169e878a1a37b2bccd1cf81f6809ee67b9 (patch) | |
tree | 86ed74ae4dc2beaebce1c67b8459f1873b777d3a /tools/testing/selftests/sysctl/run_stringtests | |
parent | 7b215de3d0abbc4f6daf2efd19e8809af0564490 (diff) | |
parent | 0244756edc4b98c129e92c7061d9f383708cf786 (diff) |
Merge branch 'akpm' (patches from Andrew Morton) into next
Merge more updates from Andrew Morton:
- Most of the rest of MM.
This includes "mark remap_file_pages syscall as deprecated" but the
actual "replace remap_file_pages syscall with emulation" is held
back. I guess we'll need to work out when to pull the trigger on
that one.
- various minor cleanups to obscure filesystems
- the drivers/rtc queue
- hfsplus updates
- ufs, hpfs, fatfs, affs, reiserfs
- Documentation/
- signals
- procfs
- cpu hotplug
- lib/idr.c
- rapidio
- sysctl
- ipc updates
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (171 commits)
ufs: sb mutex merge + mutex_destroy
powerpc: update comments for generic idle conversion
cris: update comments for generic idle conversion
idle: remove cpu_idle() forward declarations
nbd: zero from and len fields in NBD_CMD_DISCONNECT.
mm: convert some level-less printks to pr_*
MAINTAINERS: adi-buildroot-devel is moderated
MAINTAINERS: add linux-api for review of API/ABI changes
mm/kmemleak-test.c: use pr_fmt for logging
fs/dlm/debug_fs.c: replace seq_printf by seq_puts
fs/dlm/lockspace.c: convert simple_str to kstr
fs/dlm/config.c: convert simple_str to kstr
mm: mark remap_file_pages() syscall as deprecated
mm: memcontrol: remove unnecessary memcg argument from soft limit functions
mm: memcontrol: clean up memcg zoneinfo lookup
mm/memblock.c: call kmemleak directly from memblock_(alloc|free)
mm/mempool.c: update the kmemleak stack trace for mempool allocations
lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations
mm: introduce kmemleak_update_trace()
mm/kmemleak.c: use %u to print ->checksum
...
Diffstat (limited to 'tools/testing/selftests/sysctl/run_stringtests')
-rw-r--r-- | tools/testing/selftests/sysctl/run_stringtests | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tools/testing/selftests/sysctl/run_stringtests b/tools/testing/selftests/sysctl/run_stringtests new file mode 100644 index 000000000000..90a9293d520c --- /dev/null +++ b/tools/testing/selftests/sysctl/run_stringtests | |||
@@ -0,0 +1,77 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | SYSCTL="/proc/sys" | ||
4 | TARGET="${SYSCTL}/kernel/domainname" | ||
5 | ORIG=$(cat "${TARGET}") | ||
6 | TEST_STR="Testing sysctl" | ||
7 | |||
8 | . ./common_tests | ||
9 | |||
10 | # Only string sysctls support seeking/appending. | ||
11 | MAXLEN=65 | ||
12 | |||
13 | echo -n "Writing entire sysctl in short writes ... " | ||
14 | set_orig | ||
15 | dd if="${TEST_FILE}" of="${TARGET}" bs=1 2>/dev/null | ||
16 | if ! verify "${TARGET}"; then | ||
17 | echo "FAIL" >&2 | ||
18 | rc=1 | ||
19 | else | ||
20 | echo "ok" | ||
21 | fi | ||
22 | |||
23 | echo -n "Writing middle of sysctl after unsynchronized seek ... " | ||
24 | set_test | ||
25 | dd if="${TEST_FILE}" of="${TARGET}" bs=1 seek=1 2>/dev/null | ||
26 | if verify "${TARGET}"; then | ||
27 | echo "FAIL" >&2 | ||
28 | rc=1 | ||
29 | else | ||
30 | echo "ok" | ||
31 | fi | ||
32 | |||
33 | echo -n "Checking sysctl maxlen is at least $MAXLEN ... " | ||
34 | set_orig | ||
35 | perl -e 'print "A" x ('"${MAXLEN}"'-2), "B";' | \ | ||
36 | dd of="${TARGET}" bs="${MAXLEN}" 2>/dev/null | ||
37 | if ! grep -q B "${TARGET}"; then | ||
38 | echo "FAIL" >&2 | ||
39 | rc=1 | ||
40 | else | ||
41 | echo "ok" | ||
42 | fi | ||
43 | |||
44 | echo -n "Checking sysctl keeps original string on overflow append ... " | ||
45 | set_orig | ||
46 | perl -e 'print "A" x ('"${MAXLEN}"'-1), "B";' | \ | ||
47 | dd of="${TARGET}" bs=$(( MAXLEN - 1 )) 2>/dev/null | ||
48 | if grep -q B "${TARGET}"; then | ||
49 | echo "FAIL" >&2 | ||
50 | rc=1 | ||
51 | else | ||
52 | echo "ok" | ||
53 | fi | ||
54 | |||
55 | echo -n "Checking sysctl stays NULL terminated on write ... " | ||
56 | set_orig | ||
57 | perl -e 'print "A" x ('"${MAXLEN}"'-1), "B";' | \ | ||
58 | dd of="${TARGET}" bs="${MAXLEN}" 2>/dev/null | ||
59 | if grep -q B "${TARGET}"; then | ||
60 | echo "FAIL" >&2 | ||
61 | rc=1 | ||
62 | else | ||
63 | echo "ok" | ||
64 | fi | ||
65 | |||
66 | echo -n "Checking sysctl stays NULL terminated on overwrite ... " | ||
67 | set_orig | ||
68 | perl -e 'print "A" x ('"${MAXLEN}"'-1), "BB";' | \ | ||
69 | dd of="${TARGET}" bs=$(( $MAXLEN + 1 )) 2>/dev/null | ||
70 | if grep -q B "${TARGET}"; then | ||
71 | echo "FAIL" >&2 | ||
72 | rc=1 | ||
73 | else | ||
74 | echo "ok" | ||
75 | fi | ||
76 | |||
77 | exit $rc | ||