/illumos-gate/usr/src/contrib/ast/src/cmd/ksh93/tests/ |
H A D | restricted.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 49 cd $tmp || err_exit "cd $tmp failed" 52 rksh -c '[[ -o restricted ]]' || err_exit 'restricted option not set' 54 check_restricted /bin/echo || err_exit '/bin/echo not resticted' 55 check_restricted ./echo || err_exit './echo not resticted' 57 check_restricted 'PATH=/bin' || err_exit 'PATH asignment not resticted' 59 check_restricted 'ENV=/bin' || err_exit 'ENV asignment not resticted' 60 check_restricted 'print > file' || err_exit '> file not restricted' [all …]
|
H A D | heredoc.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 40 then err_exit "'hello world' here doc not working" 77 then err_exit "leading tabs stripped with <<!" 94 then err_exit "here doc inside command sub not working" 101 then err_exit '${x:+${x}} not working in here document' 110 ' 2> /dev/null || err_exit '100 empty here docs fails' 141 else err_exit '<<< syntax not supported' 147 then err_exit 'comments not preserved in here-documents' 177 then err_exit 'here document descritor was closed' [all …]
|
H A D | subshell.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 87 [[ ${x.foo.qqq} ]] && err_exit 'x.foo.qqq should be unset' 89 [[ ${x.foo} == good ]] || err_exit 'x.foo should be good' 96 [[ ${l+foo} != foo ]] || err_exit 'l should be unset' 220 [[ $r == ok ]] || err_exit "shell hangs on $TEST_test" 451 (( (SECONDS-t1) > 4 )) && err_exit 'sleep& in subshell hanging' 469 err_exit "'$cmd' failed -- expected $EXP, got $GOT" 491 then err_exit 'process timed out with hung comsub' [all …]
|
H A D | signal.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 34 cd $tmp || err_exit "cd $tmp failed" 40 then err_exit "'kill -l $s' failed" 42 then err_exit "'kill -l $n' failed" 46 then err_exit "'kill -l $t' failed" 63 (( $? == 0)) || err_exit "SIGPIPE with wrong error code $?" 71 else err_exit "pipe with --pipefail PIPE trap hangs" 81 done) == 01got_child23 ]] || err_exit 'SIGCHLD not working' [all …]
|
H A D | arith.sh | 20 function err_exit function 38 then err_exit 2+2!=4 41 then err_exit x+y!=z 44 then err_exit $x+$y!=$z 47 then err_exit "(x|y)!=z" 50 then err_exit "y>=z" 53 then err_exit "y+3!=z+2" 59 then err_exit "133%10!=3" 61 then err_exit 2.5!=2.5 67 then err_exit "d++!=0" [all …]
|
H A D | timetype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 50 [[ $t == "$d" ]] || err_exit "printf %T != Time_t -- expected '$d', got '$t'" 51 (( t == s )) || err_exit "numeric Time_t failed -- expected '$s', got '$t'" 53 [[ $t == $s ]] || err_exit "t._='%#' failed -- expected '$s', got '$t'" 58 [[ ${tt[0]} == *+00:00 ]] || err_exit "tt[0] failed -- expected 00:00, got '${tt[0]##*+}'" 59 [[ ${tt[1]} == *+00:00 ]] || err_exit "tt[1] failed -- expected 00:00, got '${tt[1]##*+}'" 60 [[ ${tt[2]} == *+00:00 ]] || err_exit "tt[2] failed -- expected 00:00, got '${tt[2]##*+}'" 61 [[ ${tt[3]} == *+14:00 ]] || err_exit "tt[3] failed -- expected 14:00, got '${tt[3]##*+}'" 67 (( (tt[2] - tt[1]) == 24*3600 )) || err_exit "tomorrow-today='$((tt[2] - tt[1]))' != 1 day" [all …]
|
H A D | enum.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 37 [[ $x == orange ]] || err_exit '$x should be orange' 38 ( x=violet) 2> /dev/null && err_exit 'x=violet should fail' 41 (( x[2] == 1 )) || err_exit '((x[2]!=1))' 42 [[ $((x[2])) == 1 ]] || err_exit '$((x[2]))!=1' 43 [[ $x == orange ]] || err_exit '$x is no longer orange' 46 [[ ${y[foo]} == yellow ]] || err_exit '${y[foo]} != yellow' 47 (( y[foo] == 4 )) || err_exit '(( y[foo] != 4))' 52 [[ ${z[1]} == xyz ]] || err_exit '${z[1]} should be xyz' [all …]
|
H A D | namespace.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 77 (( r == 9 )) || err_exit 'global variable r not set in namespace' 79 [[ ${z[qqq]} == abc ]] || err_exit 'local array element not correct' 81 [[ ${bar.y} == 2 ]] || err_exit 'local variable bar.y not found' 82 [[ ${bar.t} == '' ]] || err_exit 'global bar.t should not be visible' 93 [[ $(runxrun) == 'xfun local bar' ]] || err_exit 'local function on FPATH failed' 94 [[ $(runrun $foo) == 'local prog bar' ]] || err_exit 'local binary on PATH failed' 101 [[ $(xfun) == 'xfun global abc' ]] || err_exit 'global function on FPATH failed' [all …]
|
H A D | coprocess.sh | 21 function err_exit function 27 alias err_exit='err_exit $LINENO' alias 32 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 60 [[ $line == hello ]] || err_exit "$cat coprocessing fails" 90 then err_exit "$cat coprocess $1 does not match $2" 96 *) err_exit "$cat coprocess unknown message +|$REPLY|+" ;; 146 err_exit "$cat coprocess cleanup not working correctly" 148 err_exit "subshell $cat coprocess lingers in parent" 187 ) && err_exit "$cat coprocess with subshell would hang" 247 read <&p || err_exit "first read from $cat coprocess failed" [all …]
|
H A D | append.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 34 then err_exit 'abc+def != abcdef' 39 then err_exit '3+4!=7' 44 then err_exit 'index array append fails' 50 then err_exit 'index array append to scalar fails' 56 then err_exit 'associative array append fails' 59 then err_exit 'number of elements of associative array append fails' 64 then err_exit 'compound append fails' 73 then err_exit 'array append to non array variable fails' [all …]
|
H A D | locale.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 33 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 100 [[ $u == $x ]] || err_exit LC_ALL=$locale multibyte %04x printf format failed 200 err_exit "join test script failed -- exit code $?" 226 then err_exit '${#x} not working with multibyte locales' 243 err_exit "'$tst' failed -- exit status $?" 255 [[ $got == $exp ]] || err_exit "'$tst' failed -- expected '$exp', got '$got'" 292 [[ $x == hello ]] || err_exit 'assignment of message strings not working' 317 [[ $x == 'a<2b|>c ' ]] || err_exit 'typeset -L10 should end in three spaces' [all …]
|
H A D | tilde.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' alias 52 then err_exit '~' not $HOME 56 then err_exit x=~ not $HOME 60 then err_exit x=x:~ not x:$HOME 63 then err_exit '~' not $PWD 67 then err_exit x=~+ not $PWD 70 then err_exit '~' not $PWD 74 then err_exit x=~- not $OLDPWD 79 then [[ ~$u -ef $h ]] || err_exit "~$u not $h" [all …]
|
H A D | vartree2.sh | 27 function err_exit function 34 alias err_exit='err_exit $LINENO' alias 279 err_exit "compound trees 'mytree_global1' and 'mytree_local1' not identical" 283 err_exit "compound trees 'mytree_global1' and 'mytree_global2' not identical" 287 err_exit "compound trees 'mytree_local1' and 'mytree_local2' not identical" 293 err_exit "try 1: variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found" 295 err_exit "try 2: variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found" 301 ) && err_exit "global: parent node removed (array element), child still exists" 305 ) && err_exit "local: parent node removed (array element), child still exists" 311 ) && err_exit "global: parent node removed (array variable), child still exists" [all …]
|
H A D | sigchld.sh | 20 function err_exit function 27 alias err_exit='err_exit $LINENO' alias 58 ') || err_exit "test loop failed" 117 [[ $got == good ]] || err_exit 'SIGCLD handler effects read behavior' 130 then err_exit "CHLD trap failed -- expected 4 args, got $#" 132 then err_exit "CHLD trap failed -- exit code $4" 134 then err_exit "child pid mismatch -- got '$1' != '$2'" 136 then err_exit "child status mismatch -- expected '9', got '$3'" 146 (( d==2000 )) || err_exit "trap '' CHLD causes side effects d=$d" 152 [[ $x == *Done* ]] || err_exit 'SIGCHLD blocked after notfound' [all …]
|
/illumos-gate/usr/src/cmd/ast/libshell/common/tests/ |
H A D | sun_solaris_command_substitution.sh | 31 function err_exit function 37 alias err_exit='err_exit $LINENO' alias 108 err_exit "${currtst.name}: child (pid=${childpid}) still busy, filesize=${testfilesize}." 209 [[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}" 213 [[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}" 217 [[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}" 221 [[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}" 225 [[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}" 235 [[ "${testout}" == "hi" ]] || err_exit "test004: Expected 'hi', got '${testout}'" 278 err_exit "${currtst.name}: child (pid=${childpid}) still busy." [all …]
|
H A D | sun_solaris_cr_6753538_subshell_leaks_umask.sh | 43 function err_exit function 49 alias err_exit='err_exit $LINENO' alias 60 [[ "$x" == "0022" ]] || err_exit "expected umask 0022, got $x" 63 [[ "$x" == "0020" ]] || err_exit "expected umask 0020, got $x" 66 [[ "$x" == "0000" ]] || err_exit "expected umask 0000, got $x" 73 [[ "$x" == "0022" ]] || err_exit "expected umask 0022, got $x" 76 [[ "$x" == "0020" ]] || err_exit "expected umas k 0020, got $x" 79 [[ "$x" == "0000" ]] || err_exit "expected umask 0000, got $x" 88 [[ "$x" == "$y" ]] || err_exit "$x != $y" 92 [[ "$x" == "$y" ]] || err_exit "$x != $y" [all …]
|
H A D | sun_solaris_cr_6766246_pattern_matching_bug.sh | 73 function err_exit function 79 alias err_exit='err_exit $LINENO' alias 103 pat="foo-bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 105 pat="foo/bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 106 pat="foo_bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 108 pat="foobar-" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 110 pat="foobar/" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 111 pat="foobar_" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 113 pat="-foobar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 115 pat="/foobar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." [all …]
|
H A D | sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh | 49 function err_exit function 55 alias err_exit='err_exit $LINENO' alias 72 mkdir -p "${testdir}" || err_exit "Cannot create test dirctory" 92 err_exit "Child still active after 5 seconds (hang ?)" 105 [[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; } 126 err_exit "Child still active after 5 seconds (hang ?)" 139 [[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; } 159 err_exit "Child still active after 5 seconds (hang ?)" 172 [[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; } 193 err_exit "Child still active after 5 seconds (hang ?)" [all …]
|
H A D | sun_solaris_compound_nameref.sh | 29 function err_exit function 35 alias err_exit='err_exit $LINENO' alias 48 function err_exit 54 alias err_exit='err_exit \$LINENO' 105 ) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?" 130 ) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?" 131 [[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}" 158 ) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?" 159 [[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}" 182 [[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}" [all …]
|
H A D | sun_solaris_cr_6807179_shellpattern_uses_getpwnam.sh | 49 function err_exit function 55 alias err_exit='err_exit $LINENO' alias 68 truss -u :: -o "${tmpfile}" ${SHELL} -c '[[ ${hello} == ~(Elr)wo.*ld ]] ; true' || err_exit "truss … 69 [[ "$( < "${tmpfile}")" != *getpwnam* ]] || err_exit "truss log reports the use of getpwnam() for p… 70 rm "${tmpfile}" || err_exit "rm ${tmpfile} failed." 74 truss -u :: -o "${tmpfile}" ${SHELL} -c '[[ ${hello} == ~(Si)wo*ld ]] ; true' || err_exit "truss re… 75 [[ "$( < "${tmpfile}")" != *getpwnam* ]] || err_exit "truss log reports the use of getpwnam() for p… 76 rm "${tmpfile}" || err_exit "rm ${tmpfile} failed." 82 truss -u :: -o "${tmpfile}" ${SHELL} -c '[[ ${hello} == ~root/ ]] ; true' || err_exit "truss return… 83 [[ "$( < "${tmpfile}" )" == *getpwnam* ]] || err_exit "truss log reports the use of getpwnam() for … [all …]
|
H A D | sun_solaris_cr_6805795_negative_zero.sh | 62 function err_exit function 68 alias err_exit='err_exit $LINENO' alias 81 ) || err_exit "test failed." 99 ) || err_exit "test failed." 100 [[ "${str}" == "-0" ]] || err_exit "Expected c == -0, got ${str}" 112 ) || err_exit "test failed." 128 ) || err_exit "test failed." 129 [[ "${str}" == "1" ]] || err_exit "Expected c == 1, got ${str}" 146 ) || err_exit "test failed." 164 ) || err_exit "test failed." [all …]
|
H A D | sun_solaris_vartree002.sh | 34 function err_exit function 40 alias err_exit='err_exit $LINENO' alias 289 err_exit "Compound trees 'mytree_global1' and 'mytree_local1' not identical" 294 err_exit "Compound trees 'mytree_global1' and 'mytree_global2' not identical" 299 err_exit "Compound trees 'mytree_local1' and 'mytree_local2' not identical" 306 err_exit "Try 1: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found." 308 err_exit "Try 2: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found." 315 ) || err_exit "Global: Parent node removed (array element), child still exists" 320 ) || err_exit "Local: Parent node removed (array element), child still exists" 327 ) || err_exit "Global: Parent node removed (array variable), child still exists" [all …]
|
H A D | sun_solaris_builtin_poll.sh | 32 function err_exit function 38 alias err_exit='err_exit $LINENO' alias 45 builtin -f libshell.so.1 poll || err_exit "poll builtin not found." 55 cat /dev/zero | { redirect 5<&0 ; poll -e d1.res -t 5. d1.u ; } || err_exit "poll returned non-zero… 56 [[ "${d1.u[x].revents}" == "POLLIN" ]] || err_exit "d1.u[x].revents contains '${d1.u[x].revents}', … 57 [[ "${d1.u[y].revents}" == "POLLIN" ]] || err_exit "d1.u[y].revents contains '${d1.u[y].revents}', … 58 [[ "${d1.res[*]}" == "x y" ]] || err_exit "d1.res contains '${d1.res[*]}', not 'x y'" 64 { poll -e d1.res -t 5. d1.u ; } 5</dev/null 5>/dev/null || err_exit "poll returned non-zero exit co… 65 [[ "${d1.u[x].revents}" == "POLLIN" ]] || err_exit "d1.u[x].revents contains '${d1.u[x]… 66 [[ "${d1.u[y].revents}" == "POLLIN" ]] || err_exit "d1.u[y].revents contains '${d1.u[y]… [all …]
|
H A D | sun_solaris_cr_6722134_background_CHLD_trap.sh | 43 function err_exit function 49 alias err_exit='err_exit $LINENO' alias 78 ' 2>&1 )" || err_exit "test loop failed." 80 [[ "$s" == ~(Er)$'14\nloop finished\ndone' ]] || err_exit "Expected '14\nloop finished\ndone' at th… 81 [[ "$s" == ~(El)$'0\n1\n2' ]] || err_exit "Expected '0\n1\n2' as at the beginning of the output, go… 84 (( count=$(fgrep "got_child" <<< "$s" | wc -l) )) || err_exit "counting failed." 85 (( count == 2 )) || err_exit "Expected count==2, got count==${count}." 112 ' 2>&1 )" || err_exit "test loop failed." 115 [[ "$s" == ~(El)$'0\n1\n2' ]] || err_exit "Expected '0\n1\n2' as at the beginning of the output, go… 117 (( count=$(fgrep "got_child" <<< "$s" | wc -l) )) || err_exit "counting failed." [all …]
|
/illumos-gate/usr/src/cmd/tail/tests/ |
H A D | sun_solaris_tail.sh | 49 function err_exit function 55 alias err_exit='err_exit $LINENO' alias 140 builtin mktemp || err_exit "mktemp builtin not found" 141 builtin rm || err_exit "rm builtin not found" 151 cd "${tmpdir}" || { err_exit "cd ${tmpdir} failed." ; exit $((Errors)) ; } 356 err_exit "test_tail_fifo_1: # tail hung (not expected)" 360 wait || err_exit "tail child returned non-zero exit code=$?" 400 wait || err_exit "tail child returned non-zero exit code=$?" 449 err_exit "${title}: tail pid=${tailchild} hung." 493 err_exit "${title}: tail pid=${tailchild} hung." [all …]
|