/tests/t2000-exec.sh
Shell | 41 lines | 35 code | 5 blank | 1 comment | 1 complexity | 5246f73999b4e57ab289a9ef649745f7 MD5 | raw file
1#!/bin/sh 2 3test_description='pdsh exec module tests' 4 5. ${srcdir:-.}/test-lib.sh 6 7if ! test_have_prereq MOD_RCMD_EXEC; then 8 skip_all='skipping ssh tests, ssh module not available' 9 test_done 10fi 11 12test_expect_success 'exec module works' ' 13 OUTPUT=$(pdsh -Rexec -w foo echo test_command) 14 test "$OUTPUT" = "foo: test_command" 15' 16test_debug ' 17 echo Output: $OUTPUT 18' 19test_expect_success 'exec cmd substitution works ' ' 20 OUTPUT=$(pdsh -Rexec -w foo -l buser echo %u %h %n %%) 21 test "$OUTPUT" = "foo: buser foo 0 %" 22' 23test_debug ' 24 echo Output: $OUTPUT 25' 26 27test_expect_success 'exec module works in interactive mode' ' 28 OUTPUT=$(echo echo test command | pdsh -R exec -w foo) 29 echo "$OUTPUT" | grep "foo: test command" 30' 31test_debug ' 32 echo Output: $OUTPUT 33' 34test_expect_success 'exec cmd susbstitution works interactive mode' ' 35 OUTPUT=$(echo echo %u %h %n %% | pdsh -R exec -w foo -l auser) 36 echo "$OUTPUT" | grep "foo: auser foo 0 %" 37' 38test_debug ' 39 echo Output: $OUTPUT 40' 41test_done