Lines Matching full:echo
60 echo -n "Checking production write strict setting ... "
62 echo "FAIL, but skip in case of old kernel" >&2
66 echo "ok"
68 echo "FAIL, strict value is 0 but force to 1 to continue" >&2
69 echo "1" > ${WRITES_STRICT}
91 echo $msg must be run as root >&2
96 echo "$0: You need perl installed"
100 echo "$0: You need getconf installed"
104 echo "$0: You need diff installed"
113 echo "$0: module $TEST_DRIVER not found [SKIP]"
114 echo "You must set CONFIG_TEST_SYSCTL=m in your kernel" >&2
119 echo "$0: modprobe $TEST_DRIVER failed."
148 echo -n $VAL > $TARGET
155 echo "${ORIG}" > "${TARGET}"
162 echo "${TEST_STR}" > "${TARGET}"
193 echo "$TEST_STR" | diff -q -w -u - $1 > /dev/null
200 echo "Failed test, return value: $rc" >&2
211 echo ${old_strict} > ${WRITES_STRICT}
218 echo "== Testing sysctl behavior against ${TARGET} =="
222 echo -n "Writing test file ... "
223 echo "${TEST_STR}" > "${TEST_FILE}"
225 echo "FAIL" >&2
228 echo "ok"
231 echo -n "Checking sysctl is not set to test value ... "
233 echo "FAIL" >&2
236 echo "ok"
239 echo -n "Writing sysctl from shell ... "
242 echo "FAIL" >&2
245 echo "ok"
248 echo -n "Resetting sysctl to original value ... "
251 echo "FAIL" >&2
254 echo "ok"
261 echo -n "Writing entire sysctl in single write ... "
265 echo "FAIL" >&2
268 echo "ok"
271 echo -n "Writing middle of sysctl after synchronized seek ... "
275 echo "FAIL" >&2
278 echo "ok"
281 echo -n "Writing beyond end of sysctl ... "
285 echo "FAIL" >&2
288 echo "ok"
291 echo -n "Writing sysctl with multiple long writes ... "
293 (perl -e 'print "A" x 50;'; echo "${TEST_STR}") | \
296 echo "FAIL" >&2
299 echo "ok"
306 echo -n "Testing that $1 fails as expected..."
310 echo -n "$TEST_STR" > $TARGET 2> /dev/null
314 echo "FAIL" >&2
317 echo "ok"
359 echo -n "Checking ignoring spaces up to PAGE_SIZE works on write ..."
364 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
368 echo "FAIL" >&2
371 echo "ok"
375 echo -n "Checking passing PAGE_SIZE of spaces fails on write ..."
380 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
384 echo "FAIL" >&2
387 echo "ok"
395 echo -n "Testing INT_MAX works ..."
398 echo -n $TEST_STR > $TARGET
401 echo "FAIL" >&2
404 echo "ok"
408 echo -n "Testing INT_MAX + 1 will fail as expected..."
411 echo -n $TEST_STR > $TARGET 2> /dev/null
414 echo "FAIL" >&2
417 echo "ok"
421 echo -n "Testing negative values will work as expected..."
424 echo -n $TEST_STR > $TARGET 2> /dev/null
426 echo "FAIL" >&2
429 echo "ok"
437 echo -n "Testing array works as expected ... "
439 echo -n $TEST_STR > $TARGET
442 echo "FAIL" >&2
445 echo "ok"
449 echo -n "Testing skipping trailing array elements works ... "
451 # If we only echo in two digits the last two are left intact
453 echo -n $TEST_STR > $TARGET
454 # After we echo in, to help diff we need to set on TEST_STR what
459 echo "FAIL" >&2
462 echo "ok"
466 echo -n "Testing PAGE_SIZE limit on array works ... "
472 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
477 echo "FAIL" >&2
480 echo "ok"
484 echo -n "Testing exceeding PAGE_SIZE limit fails as expected ... "
489 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
494 echo "FAIL" >&2
497 echo "ok"
505 echo -n "Testing UINT_MAX works ..."
508 echo -n $TEST_STR > $TARGET
511 echo "FAIL" >&2
514 echo "ok"
518 echo -n "Testing UINT_MAX + 1 will fail as expected..."
521 echo -n $TEST_STR > $TARGET 2> /dev/null
524 echo "FAIL" >&2
527 echo "ok"
531 echo -n "Testing negative values will not work as expected ..."
534 echo -n $TEST_STR > $TARGET 2> /dev/null
537 echo "FAIL" >&2
540 echo "ok"
547 echo -n "Writing entire sysctl in short writes ... "
551 echo "FAIL" >&2
554 echo "ok"
557 echo -n "Writing middle of sysctl after unsynchronized seek ... "
561 echo "FAIL" >&2
564 echo "ok"
567 echo -n "Checking sysctl maxlen is at least $MAXLEN ... "
572 echo "FAIL" >&2
575 echo "ok"
578 echo -n "Checking sysctl keeps original string on overflow append ... "
583 echo "FAIL" >&2
586 echo "ok"
589 echo -n "Checking sysctl stays NULL terminated on write ... "
594 echo "FAIL" >&2
597 echo "ok"
600 echo -n "Checking sysctl stays NULL terminated on overwrite ... "
605 echo "FAIL" >&2
608 echo "ok"
653 echo -n "Checking bitmap handler... "
655 echo -n "$TEST_STR" > $TEST_FILE
659 echo "FAIL" >&2
665 echo "FAIL" >&2
668 echo "ok"
746 echo "Skipping test for $TARGET as it is not present ..."
751 echo "Boot param test only possible sysctl_test is built-in, not module:"
756 echo -n "Testing if $TARGET is set to 1 ..."
760 echo "ok"
763 echo "FAIL"
764 echo "Checking if /proc/cmdline contains setting of the expected parameter ..."
766 echo "/proc/cmdline does not exist, test inconclusive"
772 echo "Kernel param found but $TARGET is not 1, TEST FAILED"
777 echo "Skipping test, expected kernel parameter missing."
778 …echo "To perform this test, make sure kernel is booted with parameter: sysctl.debug.test_sysctl.bo…
786 echo "Skipping test for $TARGET as it is not present ..."
790 echo -n "Testing if $TARGET is matched in kernel"
794 echo "TEST FAILED"
799 echo "ok"
806 echo -n "Testing if $TARGET unregistered correctly ..."
808 echo "TEST FAILED"
813 echo "ok"
820 echo -n "Testing that $TARGET was not created ..."
822 echo "TEST FAILED"
827 echo "ok"
833 echo "Test ID list:"
834 echo
835 echo "TEST_ID x NUM_TEST"
836 echo "TEST_ID: Test ID"
837 echo "NUM_TESTS: Number of recommended times to run the test"
838 echo
839 echo "0001 x $(get_test_count 0001) - tests proc_dointvec_minmax()"
840 echo "0002 x $(get_test_count 0002) - tests proc_dostring()"
841 echo "0003 x $(get_test_count 0003) - tests proc_dointvec()"
842 echo "0004 x $(get_test_count 0004) - tests proc_douintvec()"
843 echo "0005 x $(get_test_count 0005) - tests proc_douintvec() array"
844 echo "0006 x $(get_test_count 0006) - tests proc_do_large_bitmap()"
845 echo "0007 x $(get_test_count 0007) - tests setting sysctl from kernel boot param"
846 echo "0008 x $(get_test_count 0008) - tests sysctl macro values match"
847 echo "0009 x $(get_test_count 0009) - tests sysct unregister"
848 echo "0010 x $(get_test_count 0010) - tests sysct mount point"
856 echo "Usage: $0 [ -t <4-number-digit> ] | [ -w <4-number-digit> ] |"
857 echo " [ -s <4-number-digit> ] | [ -c <4-number-digit> <test- count>"
858 echo " [ all ] [ -h | --help ] [ -l ]"
859 echo ""
860 echo "Valid tests: 0001-$MAX_TEST"
861 echo ""
862 echo " all Runs all tests (default)"
863 echo " -t Run test ID the number amount of times is recommended"
864 echo " -w Watch test ID run until it runs into an error"
865 echo " -c Run test ID once"
866 echo " -s Run test ID x test-count number of times"
867 echo " -l List all test ID list"
868 echo " -h|--help Help"
869 echo
870 echo "If an error every occurs execution will immediately terminate."
871 echo "If you are adding a new test try using -w <test-ID> first to"
872 echo "make sure the test passes a series of tests."
873 echo
874 echo Example uses:
875 echo
876 echo "$TEST_NAME.sh -- executes all tests"
877 echo "$TEST_NAME.sh -t 0002 -- Executes test ID 0002 number of times is recomended"
878 echo "$TEST_NAME.sh -w 0002 -- Watch test ID 0002 run until an error occurs"
879 echo "$TEST_NAME.sh -s 0002 -- Run test ID 0002 once"
880 echo "$TEST_NAME.sh -c 0002 3 -- Run test ID 0002 three times"
881 echo
895 echo $1 | sed 's/^0*//'
902 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$awk_field'}')
903 echo ${TEST_DATA} | awk -F":" '{print $2}'
910 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$awk_field'}')
911 echo ${TEST_DATA} | awk -F":" '{print $3}'
918 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$awk_field'}')
919 echo ${TEST_DATA} | awk -F":" '{print $4}'
926 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$awk_field'}')
927 echo ${TEST_DATA} | awk -F":" '{print $5}'
937 echo "Target for test $TEST_ID: $TEST_TARGET not exist, skipping test ..."
964 echo "Running test: $2 - run #$1"