5 echo "== Testing sysctl behavior against ${TARGET} =="
9 echo "${ORIG}" > "${TARGET}"
14 echo "${TEST_STR}" > "${TARGET}"
21 if [ "${seen}" != "${TEST_STR}" ]; then
27 trap 'set_orig; rm -f "${TEST_FILE}"' EXIT
31 echo -n "Writing test file ... "
32 echo "${TEST_STR}" > "${TEST_FILE}"
33 if ! verify
"${TEST_FILE}"; then
40 echo -n "Checking sysctl is not set to test value ... "
41 if verify
"${TARGET}"; then
48 echo -n "Writing sysctl from shell ... "
50 if ! verify
"${TARGET}"; then
57 echo -n "Resetting sysctl to original value ... "
59 if verify
"${TARGET}"; then
66 # Now that we've validated the sanity of "set_test" and "set_orig",
67 # we can use those functions to set starting states before running
68 # specific behavioral tests.
70 echo -n "Writing entire sysctl in single write ... "
72 dd if="${TEST_FILE}" of
="${TARGET}" bs
=4096 2>/dev
/null
73 if ! verify
"${TARGET}"; then
80 echo -n "Writing middle of sysctl after synchronized seek ... "
82 dd if="${TEST_FILE}" of
="${TARGET}" bs
=1 seek
=1 skip
=1 2>/dev
/null
83 if ! verify
"${TARGET}"; then
90 echo -n "Writing beyond end of sysctl ... "
92 dd if="${TEST_FILE}" of
="${TARGET}" bs
=20 seek
=2 2>/dev
/null
93 if verify
"${TARGET}"; then
100 echo -n "Writing sysctl with multiple long writes ... "
102 (perl
-e 'print "A" x 50;'; echo "${TEST_STR}") | \
103 dd of
="${TARGET}" bs
=50 2>/dev
/null
104 if verify
"${TARGET}"; then