1 if (( $UID == 0 )); then
2 echo "test-tests: the test suite should not be run as root" >&2
56 touch /tmp/test.setgid
57 chgrp ${GROUPS[0]} /tmp/test.setgid
58 chmod ug+x /tmp/test.setgid
59 chmod g+s /tmp/test.setgid
60 echo 't -g /tmp/test.setgid'
62 rm -f /tmp/test.setgid
78 if (( $UID != 0 )); then
79 touch /tmp/test.noread
80 chmod a-r /tmp/test.noread
81 echo 't -r /tmp/test.noread'
83 rm -f /tmp/test.noread
85 echo 't -r /tmp/test.noread'
110 touch /tmp/test.setuid
111 chmod u+x /tmp/test.setuid # some systems require this to turn on setuid bit
112 chmod u+s /tmp/test.setuid
113 echo 't -u /tmp/test.setuid'
114 t -u /tmp/test.setuid
115 rm -f /tmp/test.setuid
120 if (( $UID != 0 )); then
121 touch /tmp/test.nowrite
122 chmod a-w /tmp/test.nowrite
123 echo 't -w /tmp/test.nowrite'
124 t -w /tmp/test.nowrite
125 rm -f /tmp/test.nowrite
127 echo 't -w /tmp/test.nowrite'
131 echo 't -w /dev/null'
138 chmod u+x /tmp/test.exec
139 echo 't -x /tmp/test.exec'
143 touch /tmp/test.noexec
144 chmod u-x /tmp/test.noexec
145 echo 't -x /tmp/test.noexec'
146 t -x /tmp/test.noexec
147 rm -f /tmp/test.noexec
159 touch /tmp/test.owner
160 echo 't -O /tmp/test.owner'
162 rm -f /tmp/test.owner
164 echo 't "hello" = "hello"'
166 echo 't "hello" = "goodbye"'
167 t "hello" = "goodbye"
169 echo 't "hello" == "hello"'
171 echo 't "hello" == "goodbye"'
172 t "hello" == "goodbye"
174 echo 't "hello" != "hello"'
176 echo 't "hello" != "goodbye"'
177 t "hello" != "goodbye"
179 echo 't "hello" < "goodbye"'
180 t "hello" \< "goodbye"
181 echo 't "hello" > "goodbye"'
182 t "hello" \> "goodbye"
184 echo 't ! "hello" > "goodbye"'
185 t "! hello" \> "goodbye"
219 echo 't 700 -le 1000 -a -n "1" -a "20" = "20"'
220 t 700 -le 1000 -a -n "1" -a "20" = "20"
221 echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)'
222 t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)
228 echo 't /tmp/abc -nt /tmp/def'
229 t /tmp/abc -nt /tmp/def
230 echo 't /tmp/abc -ot /tmp/def'
231 t /tmp/abc -ot /tmp/def
232 echo 't /tmp/def -nt /tmp/abc'
233 t /tmp/def -nt /tmp/abc
234 echo 't /tmp/def -ot /tmp/abc'
235 t /tmp/def -ot /tmp/abc
237 echo 't /tmp/abc -ef /tmp/def'
238 t /tmp/abc -ef /tmp/def
240 echo 't /tmp/abc -ef /tmp/ghi'
241 t /tmp/abc -ef /tmp/ghi
243 rm /tmp/abc /tmp/def /tmp/ghi
245 echo 't -r /dev/fd/0'
247 echo 't -w /dev/fd/1'
249 echo 't -w /dev/fd/2'
262 echo 't -n abcd -o aaa'
264 echo 't -n abcd -o -z aaa'
267 echo 't -n abcd -a aaa'
269 echo 't -n abcd -a -z aaa'
273 echo 't -o allexport'
275 echo 't ! -o allexport'
329 touch /tmp/test.group
330 chgrp ${GROUPS[0]} /tmp/test.group
331 echo 't -G /tmp/test.group'
336 /*) SHNAME=${THIS_SH} ;;
337 *) SHNAME=${PWD}/${THIS_SH} ;;
340 if ln -s ${SHNAME} /tmp/test.symlink 2>/dev/null; then
341 chgrp ${GROUPS[0]} /tmp/test.symlink
342 echo 't -h /tmp/test.symlink'
343 t -h /tmp/test.symlink
344 # some systems don't let you remove this
345 rm -f /tmp/test.symlink 2>/dev/null
347 echo 't -h /tmp/test.symlink'
351 # arithmetic constant errors
374 # badly formed expressions
384 # too many arguments -- argument expected is also reasonable
385 t 4 -eq 4 -a 2 -ne 5 -a 4 -ne