Lines Matching full:echo
65 echo -n "Checking production write strict setting ... "
67 echo "FAIL, but skip in case of old kernel" >&2
71 echo "ok"
73 echo "FAIL, strict value is 0 but force to 1 to continue" >&2
74 echo "1" > ${WRITES_STRICT}
96 echo $msg must be run as root >&2
101 echo "$0: You need perl installed"
105 echo "$0: You need getconf installed"
109 echo "$0: You need diff installed"
118 echo "$0: module $TEST_DRIVER not found [SKIP]"
119 echo "You must set CONFIG_TEST_SYSCTL=m in your kernel" >&2
124 echo "$0: modprobe $TEST_DRIVER failed."
153 echo -n $VAL > $TARGET
160 echo "${ORIG}" > "${TARGET}"
167 echo "${TEST_STR}" > "${TARGET}"
198 echo "$TEST_STR" | diff -q -w -u - $1 > /dev/null
205 echo "Failed test, return value: $rc" >&2
216 echo ${old_strict} > ${WRITES_STRICT}
223 echo "== Testing sysctl behavior against ${TARGET} =="
227 echo -n "Writing test file ... "
228 echo "${TEST_STR}" > "${TEST_FILE}"
230 echo "FAIL" >&2
233 echo "ok"
236 echo -n "Checking sysctl is not set to test value ... "
238 echo "FAIL" >&2
241 echo "ok"
244 echo -n "Writing sysctl from shell ... "
247 echo "FAIL" >&2
250 echo "ok"
253 echo -n "Resetting sysctl to original value ... "
256 echo "FAIL" >&2
259 echo "ok"
266 echo -n "Writing entire sysctl in single write ... "
270 echo "FAIL" >&2
273 echo "ok"
276 echo -n "Writing middle of sysctl after synchronized seek ... "
280 echo "FAIL" >&2
283 echo "ok"
286 echo -n "Writing beyond end of sysctl ... "
290 echo "FAIL" >&2
293 echo "ok"
296 echo -n "Writing sysctl with multiple long writes ... "
298 (perl -e 'print "A" x 50;'; echo "${TEST_STR}") | \
301 echo "FAIL" >&2
304 echo "ok"
311 echo -n "Testing that $1 fails as expected..."
315 echo -n "$TEST_STR" > $TARGET 2> /dev/null
319 echo "FAIL" >&2
322 echo "ok"
364 echo -n "Checking ignoring spaces up to PAGE_SIZE works on write ..."
369 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
373 echo "FAIL" >&2
376 echo "ok"
380 echo -n "Checking passing PAGE_SIZE of spaces fails on write ..."
385 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
389 echo "FAIL" >&2
392 echo "ok"
400 echo -n "Testing INT_MAX works ..."
403 echo -n $TEST_STR > $TARGET
406 echo "FAIL" >&2
409 echo "ok"
413 echo -n "Testing INT_MAX + 1 will fail as expected..."
416 echo -n $TEST_STR > $TARGET 2> /dev/null
419 echo "FAIL" >&2
422 echo "ok"
426 echo -n "Testing negative values will work as expected..."
429 echo -n $TEST_STR > $TARGET 2> /dev/null
431 echo "FAIL" >&2
434 echo "ok"
442 echo -n "Testing array works as expected ... "
444 echo -n $TEST_STR > $TARGET
447 echo "FAIL" >&2
450 echo "ok"
454 echo -n "Testing skipping trailing array elements works ... "
456 # If we only echo in two digits the last two are left intact
458 echo -n $TEST_STR > $TARGET
459 # After we echo in, to help diff we need to set on TEST_STR what
464 echo "FAIL" >&2
467 echo "ok"
471 echo -n "Testing PAGE_SIZE limit on array works ... "
477 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
482 echo "FAIL" >&2
485 echo "ok"
489 echo -n "Testing exceeding PAGE_SIZE limit fails as expected ... "
494 (perl -e 'print " " x '$LIMIT';'; echo "${TEST_STR}") | \
499 echo "FAIL" >&2
502 echo "ok"
510 echo -n "Testing UINT_MAX works ..."
513 echo -n $TEST_STR > $TARGET
516 echo "FAIL" >&2
519 echo "ok"
523 echo -n "Testing UINT_MAX + 1 will fail as expected..."
526 echo -n $TEST_STR > $TARGET 2> /dev/null
529 echo "FAIL" >&2
532 echo "ok"
536 echo -n "Testing negative values will not work as expected ..."
539 echo -n $TEST_STR > $TARGET 2> /dev/null
542 echo "FAIL" >&2
545 echo "ok"
552 echo -n "Writing entire sysctl in short writes ... "
556 echo "FAIL" >&2
559 echo "ok"
562 echo -n "Writing middle of sysctl after unsynchronized seek ... "
566 echo "FAIL" >&2
569 echo "ok"
572 echo -n "Checking sysctl maxlen is at least $MAXLEN ... "
577 echo "FAIL" >&2
580 echo "ok"
583 echo -n "Checking sysctl keeps original string on overflow append ... "
588 echo "FAIL" >&2
591 echo "ok"
594 echo -n "Checking sysctl stays NULL terminated on write ... "
599 echo "FAIL" >&2
602 echo "ok"
605 echo -n "Checking sysctl stays NULL terminated on overwrite ... "
610 echo "FAIL" >&2
613 echo "ok"
625 echo "Target for test $TEST_ID: $TARGET not exist, skipping test ..."
659 echo -n "Checking bitmap handler... "
661 echo -n "$TEST_STR" > $TEST_FILE
665 echo "FAIL" >&2
671 echo "FAIL" >&2
674 echo "ok"
752 echo "Skipping test for $TARGET as it is not present ..."
757 echo "Boot param test only possible sysctl_test is built-in, not module:"
762 echo -n "Testing if $TARGET is set to 1 ..."
766 echo "ok"
769 echo "FAIL"
770 echo "Checking if /proc/cmdline contains setting of the expected parameter ..."
772 echo "/proc/cmdline does not exist, test inconclusive"
778 echo "Kernel param found but $TARGET is not 1, TEST FAILED"
783 echo "Skipping test, expected kernel parameter missing."
784 …echo "To perform this test, make sure kernel is booted with parameter: sysctl.debug.test_sysctl.bo…
790 echo "Test ID list:"
791 echo
792 echo "TEST_ID x NUM_TEST"
793 echo "TEST_ID: Test ID"
794 echo "NUM_TESTS: Number of recommended times to run the test"
795 echo
796 echo "0001 x $(get_test_count 0001) - tests proc_dointvec_minmax()"
797 echo "0002 x $(get_test_count 0002) - tests proc_dostring()"
798 echo "0003 x $(get_test_count 0003) - tests proc_dointvec()"
799 echo "0004 x $(get_test_count 0004) - tests proc_douintvec()"
800 echo "0005 x $(get_test_count 0005) - tests proc_douintvec() array"
801 echo "0006 x $(get_test_count 0006) - tests proc_do_large_bitmap()"
802 echo "0007 x $(get_test_count 0007) - tests setting sysctl from kernel boot param"
810 echo "Usage: $0 [ -t <4-number-digit> ] | [ -w <4-number-digit> ] |"
811 echo " [ -s <4-number-digit> ] | [ -c <4-number-digit> <test- count>"
812 echo " [ all ] [ -h | --help ] [ -l ]"
813 echo ""
814 echo "Valid tests: 0001-$MAX_TEST"
815 echo ""
816 echo " all Runs all tests (default)"
817 echo " -t Run test ID the number amount of times is recommended"
818 echo " -w Watch test ID run until it runs into an error"
819 echo " -c Run test ID once"
820 echo " -s Run test ID x test-count number of times"
821 echo " -l List all test ID list"
822 echo " -h|--help Help"
823 echo
824 echo "If an error every occurs execution will immediately terminate."
825 echo "If you are adding a new test try using -w <test-ID> first to"
826 echo "make sure the test passes a series of tests."
827 echo
828 echo Example uses:
829 echo
830 echo "$TEST_NAME.sh -- executes all tests"
831 echo "$TEST_NAME.sh -t 0002 -- Executes test ID 0002 number of times is recomended"
832 echo "$TEST_NAME.sh -w 0002 -- Watch test ID 0002 run until an error occurs"
833 echo "$TEST_NAME.sh -s 0002 -- Run test ID 0002 once"
834 echo "$TEST_NAME.sh -c 0002 3 -- Run test ID 0002 three times"
835 echo
851 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
852 echo ${TEST_DATA} | awk -F":" '{print $2}'
858 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
859 echo ${TEST_DATA} | awk -F":" '{print $3}'
865 TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}')
866 echo ${TEST_DATA} | awk -F":" '{print $4}'
891 echo "Running test: $2 - run #$1"