/illumos-gate/usr/src/lib/libshell/common/tests/ |
H A D | sun_solaris_cr_6855875_typeset_hexfloat_has_too_few_digits.sh | 83 function err_exit function 89 alias err_exit='err_exit $LINENO' 126 (( y == y_restored1 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored1)" 127 (( y == y_restored2 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored2)" 128 (( y == y_restored3 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored3)" 134 (( y == y_restored1 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored1)" 135 (( y == y_restored2 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored2)" 136 (( y == y_restored3 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored3)"
|
H A D | sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.sh | 66 function err_exit function 72 alias err_exit='err_exit $LINENO' 84 tmpdir="$(mktemp -t -d "test_sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.XXXXXXXX")" || err_exit "Cannot create temporary directory" 86 cd "${tmpdir}" || { err_exit "cd ${tmpdir} failed." ; exit $((Errors)) ; } 98 /usr/bin/shcomp "script1.sh" "script1" || err_exit "shcomp failed with error=$?" 100 [[ -x "./script1" ]] || err_exit "Script script1 not executable" 101 out="$(/usr/bin/bash -c './script1 a b "c d"' 2>&1 )" || err_exit "Compiled script failed to execute, error=$?" 102 [[ "${out}" == $'hello\nargs=a\nargs=b\nargs=c d' ]] || err_exit "Expected xxx, got $(printf "%q\n" "$out")" 107 rmdir "${tmpdir}" || err_exit "Canno [all...] |
H A D | sun_solaris_cr_6881017_background_process_in_subshell_hangs_caller.sh | 56 function err_exit function 62 alias err_exit='err_exit $LINENO' 78 (( tdiff < (10.-2.) )) || err_exit "test run needed ${tdiff} seconds to complete (instead of < 8.)"
|
H A D | sun_solaris_cr_xxxxxxxx_template.sh | 36 function err_exit function 42 alias err_exit='err_exit $LINENO' 54 tmpdir="$(mktemp -t -d "test_<description>.XXXXXXXX")" || err_exit "Cannot create temporary directory" 56 cd "${tmpdir}" || { err_exit "cd ${tmpdir} failed." ; exit $((Errors)) ; } 63 rmdir "${tmpdir}" || err_exit "Cannot remove temporary directory ${tmpdir}".
|
H A D | arrays2.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 37 do [[ ${a[i][j]} == "$i$j" ]] || err_exit "\${a[$i][$j]} != $i$j" 42 do [[ $k == "$i$j" ]] || err_exit "\${a[i][@]} != $i$j" 62 do [[ ${a[$i][$j]} == "$i$j" ]] || err_exit "\${$c[$i][$j]} != $i$j" 65 (( ${#a[@]} == 4 )) || err_exit "\${#$c[@]} not 4" 66 (( ${#a[0][@]} == 5 )) || err_exit "\${#$c[0][@]} not 5" 67 (( ${#a[1][@]} == 6 )) || err_exit "\${#$c[1][@]} not 6" 69 [[ ${@} == '0 1 2 3' ]] || err_exit "\ [all...] |
H A D | exit.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 45 cd $tmp || { err_exit "cd $tmp failed"; exit 1; } 63 then err_exit 'exit in .profile is ignored' 65 then err_exit 'privileged .profile not ignored' 68 then err_exit 'exit not setting $?' 75 then err_exit 'subshell trap on exit overwrites parent trap' 77 cd ~- || err_exit "c [all...] |
H A D | grep.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 102 then err_exit
|
H A D | options.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 36 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 43 then err_exit "${SHELL-ksh} -s not working" 51 then err_exit 'sh -e not working' 53 [[ $($SHELL -D -c 'print hi; print $"hello"') == '"hello"' ]] || err_exit 'ksh -D not working' 67 err_exit "\$ENV file &>/dev/null does not redirect stdout -- expected '', got $got" 73 err_exit "\$ENV file &>/dev/null does not redirect stderr -- expected one diagnostic line, got $got" 81 err_exit 'privilege [all...] |
H A D | pointtype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 43 [[ ${p.x} == 1 ]] || err_exit '${p[x]} is not 1' 45 [[ $(p.len) == 1 ]] || err_exit '$(p.len) != 1' 46 [[ ${p.len} == 1 ]] || err_exit '${p.len} != 1' 47 (( p.len == 1 )) || err_exit '((p.len != 1))' 49 (( q.x == 1 )) || err_exit 'q.x is not 1' 50 (( (q.len - sqrt(5)) < 10e-10 )) || err_exit 'q.len != sqrt(5)' 55 (( q.len == 3 )) || err_exit ' [all...] |
H A D | restricted.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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' 53 [[ $(rksh -c 'print hello') == hello ]] || err_exit 'unable to run print' 54 check_restricted /bin/echo || err_exit '/bin/echo not resticted' 55 check_restricted ./echo || err_exit './echo not resticted' 56 check_restricted 'SHELL=ksh' || err_exit 'SHEL [all...] |
H A D | substring.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 33 then err_exit "string1:0" 36 then err_exit "string1: -1" 39 then err_exit "string1:0" 42 then err_exit "string1:1" 45 then err_exit "string1:1:4" 48 then err_exit "string1: -5:4" 51 then err_exit "string [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' 72 mkdir -p "${testdir}" || err_exit "Cannot create test dirctory" 73 cd "${testdir}" || { err_exit "Cannot cd to test dirctory" ; exit $Errors ; } 92 err_exit "Child still active after 5 seconds (hang ?)" 103 (( childretval == 0 )) || err_exit "Child returned non-zero exit code ${childretval}." 105 [[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; } 126 err_exit "Child still active after 5 seconds (hang ?)" 137 (( childretval == 0 )) || err_exit "Chil [all...] |
H A D | sun_solaris_cr_6766246_pattern_matching_bug.sh | 73 function err_exit function 79 alias err_exit='err_exit $LINENO' 103 pat="foo-bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 104 pat="foo+bar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not 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." 107 pat="foo@bar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched." 108 pat="foobar-" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched." 109 pat="foobar+" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit " [all...] |
H A D | sun_solaris_cr_6769332_substitutions_terminate_shell_after_257_iterations.sh | 79 function err_exit function 85 alias err_exit='err_exit $LINENO' 117 ) | out="$( ${SHELL} 2>&1 ; )" || err_exit "Shell returned non-zero exit code $?." 119 [[ "${out}" == "done" ]] || err_exit "Output expected to be 'done', got '${out}'."
|
H A D | sun_solaris_cr_6800929_large_command_substitution_hang.sh | 81 function err_exit function 87 alias err_exit='err_exit $LINENO' 105 tmpfile="$(mktemp -t "sun_solaris_cr_6800929_large_command_substitution_hang.${PPID}.$$.XXXXXX")" || err_exit "Cannot create temporary file." 151 err_exit "${currtst.name}: child (pid=${childpid}) still busy, filesize=${testfilesize}." 154 wait || err_exit "${currtst.name}: Child returned non-zero exit code." # wait for child (and/or avoid zombies/slime) 157 cmp -s "${tmpfile}" "${tmpfile}.out" || err_exit "${currtst.name}: ${tmpfile} and ${tmpfile}.out differ, filesize=${testfilesize}." 171 err_exit "test2a: child (pid=${childpid}) still busy." 174 wait || err_exit "test2a: Child returned non-zero exit code." # wait for child (and/or avoid zombies/slime) 182 err_exit "test2 [all...] |
H A D | sun_solaris_cr_6904557_wc_no_longer_counts_number_of_bytes_correctly.sh | 64 function err_exit function 70 alias err_exit='err_exit $LINENO' 82 tmpdir="$(mktemp -t -d "test_sun_solaris_cr_6904557_wc_no_longer_counts_number_of_bytes_correctly.XXXXXXXX")" || err_exit "Cannot create temporary directory" 84 cd "${tmpdir}" || { err_exit "cd ${tmpdir} failed." ; exit $((Errors)) ; } 152 out="$(printf "${tc.input_format}" | ${SHELL} -c "${wc_cmd} \"\$@\"" dummy "${tc.wc_args[@]}" 2>&1)" || err_exit "${testname}: Command returned exit code $?" 153 [[ "${out}" == ${tc.output_pattern} ]] || err_exit "${testname}: Expected match for $(printf "%q\n" "${tc.output_pattern}"), got $(printf "%q\n" "${out}")" 171 rmdir "${tmpdir}" || err_exit "Cannot remove temporary directory ${tmpdir}".
|
H A D | tilde.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 47 then err_exit '~' not $HOME 51 then err_exit x=~ not $HOME 55 then err_exit x=x:~ not x:$HOME 58 then err_exit '~' not $PWD 62 then err_exit x=~+ not $PWD 65 then err_exit '~' no [all...] |
H A D | arrays.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 45 then err_exit '$x is not element 0' 48 then err_exit '${x[0] is not element 0' 51 then err_exit "length of ${x[0]} is not 4" 54 then err_exit 'number of elements of x is not 6' 57 then err_exit ' element two is not 2' 60 then err_exit ' [all...] |
H A D | attributes.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 39 (r=newval) 2> /dev/null && err_exit readonly attribute fails 42 then err_exit integer attributes fails 45 then err_exit integer base 8 fails 48 then err_exit uppercase fails 51 then err_exit lowercase fails 54 then err_exit referenc [all...] |
H A D | coprocess.sh | 21 function err_exit function 27 alias err_exit='err_exit $LINENO' 32 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 36 then err_exit cygwin detected - coprocess tests disabled - enable at the risk of wedging your system 52 [[ $line == hello ]] || err_exit 'coprocessing fails' 54 print -u5 'hello again' || err_exit 'write on u5 fails' 56 [[ $line == 'hello again' ]] || err_exit 'coprocess after moving fds fails' 82 then err_exit "$1 does not match $2" 88 *) err_exit "unknow [all...] |
H A D | cubetype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 58 [[ "$got" == "$exp" ]] || err_exit "\${b.x} incorrect for iteration $i -- expected $exp, got '$got'" 60 (( got == exp )) || err_exit "b.len incorrect for iteration $i -- expected $exp, got '$got = sqrt(${b.x}*${b.x}+${b.y}*${b.y})'" 62 [[ "$got" == "$exp" ]] || err_exit "\${b.len} incorrect for iteration $i -- expected $exp, got '$got = sqrt(${b.x}*${b.x}+${b.y}*${b.y})'" 64 [[ "$got" == "${exp}" ]] || err_exit "\${b.name} incorrect for iteration $i -- expected $exp, got '$got'" 66 (( got == exp )) || err_exit "b.count incorrect for iteration $i -- expected $exp, got '$got'" 68 [[ "$got" == "$exp" ]] || err_exit "\${b.ccount} incorrect for iteration $i -- expected $exp, got '$got'" 72 [[ "$got" == "$exp" ]] || err_exit "\ [all...] |
H A D | glob.sh | 20 function err_exit function 25 alias err_exit='err_exit $LINENO' 30 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 70 then 'err_exit' $lineno "glob -- expected '$expected', got '$got'" 86 then 'err_exit' $lineno "case $subject in $pattern) -- expected '$expected', got '$got'" 95 cd $tmp || { err_exit "cd $tmp failed"; exit 1; } 310 then 'err_exit' $1 subject="'$subject' $x failed, expected '$3', got '$g'"
|
H A D | heredoc.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 40 then err_exit "'hello world' here doc not working" 45 cmp $f $g 2> /dev/null || err_exit "'hello world' quoted here doc not working" 49 cmp $f $g 2> /dev/null || err_exit "'hello world' tabbed here doc not working" 53 cmp $f $g 2> /dev/null || err_exit "'hello world' quoted tabbed here doc not working" 58 cmp $f $g 2> /dev/null || err_exit "'$x world' here doc not working" 62 cmp $f $g 2> /dev/null || err_exit "' [all...] |
H A D | io.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 48 [[ $a == foo ]] || err_exit "bad file descriptor $i in comsub script" 51 [[ $(fun) == good ]] || err_exit 'file 3 closed before subshell completes' 53 cd $tmp || { err_exit "cd $tmp failed"; exit ; } 57 then err_exit 'append (>>) not working' 64 then err_exit "read on <> fd failed -- expected '$exp', got '$line'" 67 then err_exit 'noclobbe [all...] |
H A D | recttype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 52 [[ ${r.area} == 1 ]] || err_exit '${r.area} != 1' 57 [[ ${s.ur.x} == 9 ]] || err_exit ' ${s.ur.x} != 9' 58 (( s.ur.x == 9 ))|| err_exit ' ((s.ur.x)) != 9' 59 [[ ${s.ll.y} == 7 ]] || err_exit '${s.ll.y} != 7' 60 (( s.area == 4 )) || err_exit 'area of s should be 4' 61 [[ ${s.area} == 4 ]] || err_exit '${s.area} != 4' 66 (( r[one].area == 16 )) || err_exit 'are [all...] |