Lines Matching full:echo

66 	echo -n "Checking production write strict setting ... "
68 echo "FAIL, but skip in case of old kernel" >&2
72 echo "ok"
74 echo "FAIL, strict value is 0 but force to 1 to continue" >&2
75 echo "1" > ${WRITES_STRICT}
97 echo $msg must be run as root >&2
102 echo "$0: You need perl installed"
106 echo "$0: You need getconf installed"
110 echo "$0: You need diff installed"
119 echo "$0: module $TEST_DRIVER not found [SKIP]"
120 echo "You must set CONFIG_TEST_SYSCTL=m in your kernel" >&2
125 echo "$0: modprobe $TEST_DRIVER failed."
154 echo -n $VAL > $TARGET
161 echo "${ORIG}" > "${TARGET}"
168 echo "${TEST_STR}" > "${TARGET}"
199 echo "$TEST_STR" | diff -q -w -u - $1 > /dev/null
206 echo "Failed test, return value: $rc" >&2
217 echo ${old_strict} > ${WRITES_STRICT}
224 echo "== Testing sysctl behavior against ${TARGET} =="
228 echo -n "Writing test file ... "
229 echo "${TEST_STR}" > "${TEST_FILE}"
231 echo "FAIL" >&2
234 echo "ok"
237 echo -n "Checking sysctl is not set to test value ... "
239 echo "FAIL" >&2
242 echo "ok"
245 echo -n "Writing sysctl from shell ... "
248 echo "FAIL" >&2
251 echo "ok"
254 echo -n "Resetting sysctl to original value ... "
257 echo "FAIL" >&2
260 echo "ok"
267 echo -n "Writing entire sysctl in single write ... "
271 echo "FAIL" >&2
274 echo "ok"
277 echo -n "Writing middle of sysctl after synchronized seek ... "
281 echo "FAIL" >&2
284 echo "ok"
287 echo -n "Writing beyond end of sysctl ... "
291 echo "FAIL" >&2
294 echo "ok"
297 echo -n "Writing sysctl with multiple long writes ... "
299 (perl -e 'print "A" x 50;'; echo "${TEST_STR}") | \
302 echo "FAIL" >&2
305 echo "ok"
312 echo -n "Testing that $1 fails as expected..."
316 echo -n "$TEST_STR" > $TARGET 2> /dev/null
320 echo "FAIL" >&2
323 echo "ok"
365 echo -n "Checking ignoring spaces up to PAGE_SIZE works on write ..."
370 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
374 echo "FAIL" >&2
377 echo "ok"
381 echo -n "Checking passing PAGE_SIZE of spaces fails on write ..."
386 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
390 echo "FAIL" >&2
393 echo "ok"
401 echo -n "Testing INT_MAX works ..."
404 echo -n $TEST_STR > $TARGET
407 echo "FAIL" >&2
410 echo "ok"
414 echo -n "Testing INT_MAX + 1 will fail as expected..."
417 echo -n $TEST_STR > $TARGET 2> /dev/null
420 echo "FAIL" >&2
423 echo "ok"
427 echo -n "Testing negative values will work as expected..."
430 echo -n $TEST_STR > $TARGET 2> /dev/null
432 echo "FAIL" >&2
435 echo "ok"
443 echo -n "Testing array works as expected ... "
445 echo -n $TEST_STR > $TARGET
448 echo "FAIL" >&2
451 echo "ok"
455 echo -n "Testing skipping trailing array elements works ... "
457 # If we only echo in two digits the last two are left intact
459 echo -n $TEST_STR > $TARGET
460 # After we echo in, to help diff we need to set on TEST_STR what
465 echo "FAIL" >&2
468 echo "ok"
472 echo -n "Testing PAGE_SIZE limit on array works ... "
478 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
483 echo "FAIL" >&2
486 echo "ok"
490 echo -n "Testing exceeding PAGE_SIZE limit fails as expected ... "
495 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
500 echo "FAIL" >&2
503 echo "ok"
511 echo -n "Testing UINT_MAX works ..."
514 echo -n $TEST_STR > $TARGET
517 echo "FAIL" >&2
520 echo "ok"
524 echo -n "Testing UINT_MAX + 1 will fail as expected..."
527 echo -n $TEST_STR > $TARGET 2> /dev/null
530 echo "FAIL" >&2
533 echo "ok"
537 echo -n "Testing negative values will not work as expected ..."
540 echo -n $TEST_STR > $TARGET 2> /dev/null
543 echo "FAIL" >&2
546 echo "ok"
553 echo -n "Writing entire sysctl in short writes ... "
557 echo "FAIL" >&2
560 echo "ok"
563 echo -n "Writing middle of sysctl after unsynchronized seek ... "
567 echo "FAIL" >&2
570 echo "ok"
573 echo -n "Checking sysctl maxlen is at least $MAXLEN ... "
578 echo "FAIL" >&2
581 echo "ok"
584 echo -n "Checking sysctl keeps original string on overflow append ... "
589 echo "FAIL" >&2
592 echo "ok"
595 echo -n "Checking sysctl stays NULL terminated on write ... "
600 echo "FAIL" >&2
603 echo "ok"
606 echo -n "Checking sysctl stays NULL terminated on overwrite ... "
611 echo "FAIL" >&2
614 echo "ok"
626 echo "Target for test $TEST_ID: $TARGET not exist, skipping test ..."
660 echo -n "Checking bitmap handler... "
662 echo -n "$TEST_STR" > $TEST_FILE
666 echo "FAIL" >&2
672 echo "FAIL" >&2
675 echo "ok"
753 echo "Skipping test for $TARGET as it is not present ..."
758 echo "Boot param test only possible sysctl_test is built-in, not module:"
763 echo -n "Testing if $TARGET is set to 1 ..."
767 echo "ok"
770 echo "FAIL"
771 echo "Checking if /proc/cmdline contains setting of the expected parameter ..."
773 echo "/proc/cmdline does not exist, test inconclusive"
779 echo "Kernel param found but $TARGET is not 1, TEST FAILED"
784 echo "Skipping test, expected kernel parameter missing."
785echo "To perform this test, make sure kernel is booted with parameter: sysctl.debug.test_sysctl.bo…
793 echo "Skipping test for $TARGET as it is not present ..."
797 echo -n "Testing if $TARGET is matched in kernel"
801 echo "TEST FAILED"
806 echo "ok"
812 echo "Test ID list:"
813 echo
814 echo "TEST_ID x NUM_TEST"
815 echo "TEST_ID: Test ID"
816 echo "NUM_TESTS: Number of recommended times to run the test"
817 echo
818 echo "0001 x $(get_test_count 0001) - tests proc_dointvec_minmax()"
819 echo "0002 x $(get_test_count 0002) - tests proc_dostring()"
820 echo "0003 x $(get_test_count 0003) - tests proc_dointvec()"
821 echo "0004 x $(get_test_count 0004) - tests proc_douintvec()"
822 echo "0005 x $(get_test_count 0005) - tests proc_douintvec() array"
823 echo "0006 x $(get_test_count 0006) - tests proc_do_large_bitmap()"
824 echo "0007 x $(get_test_count 0007) - tests setting sysctl from kernel boot param"
825 echo "0008 x $(get_test_count 0008) - tests sysctl macro values match"
833 echo "Usage: $0 [ -t <4-number-digit> ] | [ -w <4-number-digit> ] |"
834 echo " [ -s <4-number-digit> ] | [ -c <4-number-digit> <test- count>"
835 echo " [ all ] [ -h | --help ] [ -l ]"
836 echo ""
837 echo "Valid tests: 0001-$MAX_TEST"
838 echo ""
839 echo " all Runs all tests (default)"
840 echo " -t Run test ID the number amount of times is recommended"
841 echo " -w Watch test ID run until it runs into an error"
842 echo " -c Run test ID once"
843 echo " -s Run test ID x test-count number of times"
844 echo " -l List all test ID list"
845 echo " -h|--help Help"
846 echo
847 echo "If an error every occurs execution will immediately terminate."
848 echo "If you are adding a new test try using -w <test-ID> first to"
849 echo "make sure the test passes a series of tests."
850 echo
851 echo Example uses:
852 echo
853 echo "$TEST_NAME.sh -- executes all tests"
854 echo "$TEST_NAME.sh -t 0002 -- Executes test ID 0002 number of times is recomended"
855 echo "$TEST_NAME.sh -w 0002 -- Watch test ID 0002 run until an error occurs"
856 echo "$TEST_NAME.sh -s 0002 -- Run test ID 0002 once"
857 echo "$TEST_NAME.sh -c 0002 3 -- Run test ID 0002 three times"
858 echo
874 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
875 echo ${TEST_DATA} | awk -F":" '{print $2}'
881 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
882 echo ${TEST_DATA} | awk -F":" '{print $3}'
888 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
889 echo ${TEST_DATA} | awk -F":" '{print $4}'
914 echo "Running test: $2 - run #$1"