# Common tests
# Pulled out of existing tests to prevent duplication.
#
-test_smbclient() {
+test_smbclient()
+{
name="$1"
cmd="$2"
unc="$3"
shift
shift
subunit_start_test "$name"
- output=`$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1`
+ output=$($VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1)
status=$?
if [ x$status = x0 ]; then
subunit_pass_test "$name"
return $status
}
-test_smbclient_expect_failure() {
+test_smbclient_expect_failure()
+{
name="$1"
cmd="$2"
unc="$3"
shift
shift
subunit_start_test "$name"
- output=`$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1`
+ output=$($VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1)
status=$?
if [ x$status = x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name"
return $status
}
-test_rpcclient_grep() {
+test_rpcclient_grep()
+{
name="$1"
cmd="$2"
srv="$3"
shift
shift
subunit_start_test "$name"
- output=`$VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" $@ 2>&1`
+ output=$($VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" $@ 2>&1)
status=$?
if [ x$status != x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name"
return $status
}
-test_rpcclient_expect_failure_grep() {
+test_rpcclient_expect_failure_grep()
+{
name="$1"
cmd="$2"
srv="$3"
shift
shift
subunit_start_test "$name"
- output=`$VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" $@ 2>&1`
+ output=$($VALGRIND $rpcclient $CONFIGURATION "$srv" -c "$cmd" $@ 2>&1)
status=$?
if [ x$status = x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name"
return $status
}
-kerberos_kinit() {
+kerberos_kinit()
+{
kinit_tool="${1}"
principal="${2}"
password="${3}"
kbase=$(basename ${kinit_tool})
if [ "${kbase}" = "samba4kinit" ]; then
kpassfile=$(mktemp)
- echo $password > ${kpassfile}
+ echo $password >${kpassfile}
$kinit_tool -c ${KRB5CCNAME} --password-file=${kpassfile} $@ $principal
status=$?
rm -f ${kpassfile}
return $status
}
-remove_directory() {
+remove_directory()
+{
local xdir=${1}
shift