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 touch /tmp/test.socket
165 echo 't -S /tmp/test.socket'
166 t -S /tmp/test.socket # false
167 rm -f /tmp/test.socket
169 touch /tmp/test.newer
170 echo 't -N /tmp/test.newer'
172 rm -f /tmp/test.newer
174 echo 't "hello" = "hello"'
176 echo 't "hello" = "goodbye"'
177 t "hello" = "goodbye"
179 echo 't "hello" == "hello"'
181 echo 't "hello" == "goodbye"'
182 t "hello" == "goodbye"
184 echo 't "hello" != "hello"'
186 echo 't "hello" != "goodbye"'
187 t "hello" != "goodbye"
189 echo 't "hello" < "goodbye"'
190 t "hello" \< "goodbye"
191 echo 't "hello" > "goodbye"'
192 t "hello" \> "goodbye"
194 echo 't ! "hello" > "goodbye"'
195 t "! hello" \> "goodbye"
229 echo 't 700 -le 1000 -a -n "1" -a "20" = "20"'
230 t 700 -le 1000 -a -n "1" -a "20" = "20"
231 echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)'
232 t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)
238 echo 't /tmp/abc -nt /tmp/def'
239 t /tmp/abc -nt /tmp/def
240 echo 't /tmp/abc -ot /tmp/def'
241 t /tmp/abc -ot /tmp/def
242 echo 't /tmp/def -nt /tmp/abc'
243 t /tmp/def -nt /tmp/abc
244 echo 't /tmp/def -ot /tmp/abc'
245 t /tmp/def -ot /tmp/abc
247 echo 't /tmp/abc -ef /tmp/def'
248 t /tmp/abc -ef /tmp/def
250 echo 't /tmp/abc -ef /tmp/ghi'
251 t /tmp/abc -ef /tmp/ghi
253 rm /tmp/abc /tmp/def /tmp/ghi
255 echo 't -r /dev/fd/0'
257 echo 't -w /dev/fd/1'
259 echo 't -w /dev/fd/2'
262 echo 't -r /dev/stdin'
264 echo 't -w /dev/stdout'
266 echo 't -w /dev/stderr'
279 echo 't -n abcd -o aaa'
281 echo 't -n abcd -o -z aaa'
284 echo 't -n abcd -a aaa'
286 echo 't -n abcd -a -z aaa'
290 echo 't -o allexport'
292 echo 't ! -o allexport'
346 touch /tmp/test.group
347 chgrp ${GROUPS[0]} /tmp/test.group
348 echo 't -G /tmp/test.group'
353 /*) SHNAME=${THIS_SH} ;;
354 *) SHNAME=${PWD}/${THIS_SH} ;;
357 if ln -s ${SHNAME} /tmp/test.symlink 2>/dev/null; then
358 chgrp ${GROUPS[0]} /tmp/test.symlink 2>/dev/null
359 echo 't -h /tmp/test.symlink'
360 t -h /tmp/test.symlink
361 # some systems don't let you remove this
362 rm -f /tmp/test.symlink 2>/dev/null
364 echo 't -h /tmp/test.symlink'
368 # arithmetic constant errors
391 # badly formed expressions
401 # too many arguments -- argument expected is also reasonable
402 t 4 -eq 4 -a 2 -ne 5 -a 4 -ne
411 # non-numeric arguments to `test -t' should return failure -- fix in 2.05
420 echo 't -t /dev/tty4'
422 echo 't -t /dev/tty4444444...'
423 t -t /dev/tty4444444...