File: t2000-exec.sh

package info (click to toggle)
pdsh 2.35-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,008 kB
  • sloc: ansic: 12,433; sh: 6,838; makefile: 400; perl: 163
file content (41 lines) | stat: -rwxr-xr-x 980 bytes parent folder | download | duplicates (4)
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
39
40
41
#!/bin/sh

test_description='pdsh exec module tests'

. ${srcdir:-.}/test-lib.sh

if ! test_have_prereq MOD_RCMD_EXEC; then
	skip_all='skipping exec tests, exec module not available'
	test_done
fi

test_expect_success 'exec module works' '
	OUTPUT=$(pdsh -Rexec -w foo echo test_command)
	test "$OUTPUT" = "foo: test_command"
'
test_debug '
	echo Output: $OUTPUT
'
test_expect_success 'exec cmd substitution works ' '
	OUTPUT=$(pdsh -Rexec -w foo -l buser echo %u %h %n %%)
	test "$OUTPUT" = "foo: buser foo 0 %"
'
test_debug '
	echo Output: $OUTPUT
'

test_expect_success 'exec module works in interactive mode' '
	OUTPUT=$(echo echo test command | pdsh -R exec -w foo)
	echo "$OUTPUT" | grep "foo: test command"
'
test_debug '
	echo Output: $OUTPUT
'
test_expect_success 'exec cmd susbstitution works interactive mode' '
	OUTPUT=$(echo echo %u %h %n %% | pdsh -R exec -w foo -l auser)
	echo "$OUTPUT" | grep "foo: auser foo 0 %"
'
test_debug '
	echo Output: $OUTPUT
'
test_done