summaryrefslogtreecommitdiff
path: root/testprogs/blackbox/common_test_fns.inc
blob: aff1aa9dc79e26a3c6c499b93d46510af97a7e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Common tests
# Pulled out of existing tests to prevent duplication.
#
test_smbclient() {
	name="$1"
	cmd="$2"
	unc="$3"
	shift
	shift
	shift
	echo "test: $name"
	$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
	status=$?
	if [ x$status = x0 ]; then
		echo "success: $name"
	else
		echo "failure: $name"
	fi
	return $status
}

test_smbclient_expect_failure() {
	name="$1"
	cmd="$2"
	unc="$3"
	shift
	shift
	shift
	echo "test: $name"
	$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
	status=$?
	if [ x$status = x0 ]; then
		echo "failure: $name"
	else
		echo "success: $name"
	fi
	return $status
}