2 # Pulled out of existing tests to prevent duplication.
12 subunit_start_test "$name"
13 output=$($VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" "$@" 2>&1)
15 if [ x$status = x0 ]; then
16 subunit_pass_test "$name"
18 printf '%s' "$output" | subunit_fail_test "$name"
23 test_smbclient_expect_failure()
31 subunit_start_test "$name"
32 output=$($VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" "$@" 2>&1)
34 if [ x$status = x0 ]; then
35 printf '%s' "$output" | subunit_fail_test "$name"
38 subunit_pass_test "$name"
53 subunit_start_test "$name"
54 output=$($VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" "$@" 2>&1)
56 if [ x$status != x0 ]; then
57 printf '%s' "$output" | subunit_fail_test "$name"
60 printf '%s' "$output" | grep -q "$grep"
62 if [ x$gstatus = x0 ]; then
63 subunit_pass_test "$name"
65 printf '%s' "$output" | subunit_fail_test "$name"
70 test_rpcclient_expect_failure_grep()
80 subunit_start_test "$name"
81 output=$($VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" "$@" 2>&1)
83 if [ x$status = x0 ]; then
84 printf '%s' "$output" | subunit_fail_test "$name"
87 printf '%s' "$output" | grep -q "$grep"
89 if [ x$gstatus = x0 ]; then
90 subunit_pass_test "$name"
92 printf '%s' "$output" | subunit_fail_test "$name"
103 kbase=$(basename ${kinit_tool})
104 if [ "${kbase}" = "samba4kinit" ]; then
106 echo $password >${kpassfile}
107 $kinit_tool -c ${KRB5CCNAME} --password-file=${kpassfile} "$@" $principal
111 echo $password | $kinit_tool "$@" $principal
122 if [ "$xdir" = "/" ] || [ ! -d "$xdir" ] || [ -z "$(ls -A "$xdir")" ]; then
129 # This function should be used to either use a system tool or one of our
130 # build dir if available.
134 # system_or_builddir_binary ldbsearch ${BUILDDIR}
135 # system_or_builddir_binary kinit ${BUILDDIR} samba4kinit
137 system_or_builddir_binary()
143 _bin="$(command -v ${_bin_name})"
144 _bin_build_path="${_build_dir}/${_bin_name}"
146 if [ -n "${_alt_bin_name}" ]; then
147 _bin_build_path="${_build_dir}/${_alt_bin_name}"
150 if [ -x "${_bin_build_path}" ]; then
151 _bin="${_bin_build_path}"