forked from adamlaska/machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssh-backends.bats
More file actions
40 lines (31 loc) · 927 Bytes
/
ssh-backends.bats
File metadata and controls
40 lines (31 loc) · 927 Bytes
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
#!/usr/bin/env bats
load ${BASE_TEST_DIR}/helpers.bash
use_shared_machine
@test "$DRIVER: test external ssh backend" {
run machine ssh $NAME df -h
[[ "$status" -eq 0 ]]
}
@test "$DRIVER: test command did what it purported to -- external ssh" {
run machine ssh $NAME echo foo
[[ "$output" == "foo" ]]
}
@test "$DRIVER: test native ssh backend" {
run machine --native-ssh ssh $NAME df -h
[[ "$status" -eq 0 ]]
}
@test "$DRIVER: test command did what it purported to -- native ssh" {
run machine --native-ssh ssh $NAME echo foo
[[ "$output" =~ "foo" ]]
}
@test "$DRIVER: ensure that ssh extra arguments work" {
# don't run this test if we can't use external SSH
which ssh
if [[ $? -ne 0 ]]; then
skip
fi
# this will not fare well if -C doesn't get interpreted as "use compression"
# like intended
run machine ssh $NAME -C echo foo
[[ "$status" -eq 0 ]]
[[ "$output" == "foo" ]]
}