-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·81 lines (61 loc) · 1.56 KB
/
test.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env /bin/bash
TESTNUM=1
function colorize {
echo -e "\e[1;32m${1}\e[0m"
}
function testcase {
colorize "#${TESTNUM} ${1}"
TESTNUM=$((TESTNUM+1))
}
function ok {
colorize "OK"
echo -e "Press Enter to continue..."
read
}
# build the latest version
go build
testcase "defined host defined command"
./vmx run messaging-prod mem
ok
testcase "defined host non defined command"
./vmx run messaging-prod pwd
ok
testcase "non defined host defined command"
./vmx run rest-prod2 mem
ok
testcase "non defined host non defined command"
./vmx run rest-prod2 "free -h"
ok
testcase "command with the confirmation and no reply"
./vmx run rest-prod1 date
ok
testcase "command with the confirmation and yes reply"
./vmx run rest-prod1 date
ok
testcase "list command"
./vmx list
ok
testcase "list command over test profile full name argument"
./vmx --profile test list
ok
testcase "list command over test profile short name argument"
./vmx --profile test list
ok
testcase "list command over test profile VMX_DEFAULT_PROFILE env"
VMX_DEFAULT_PROFILE=test && ./vmx --profile test list
ok
testcase "all hosts group"
./vmx run all mem
ok
testcase "pass extra args to the custom command"
./vmx run dev app-logs rest.log
ok
testcase "using working dir from the defaults config"
./vmx run dev tail -n 10 logs/rest.log
ok
testcase "do not use working dir from the defaults config if the one already provided explicitly by the user using cd"
./vmx run dev "cd /etc/apt/sources.list.d && ls"
ok
testcase "tail-ing/following"
./vmx run --follow rest-prod1 less-logs
ok