-
Notifications
You must be signed in to change notification settings - Fork 951
Expand file tree
/
Copy pathesxcli.bats
More file actions
executable file
·120 lines (85 loc) · 2.36 KB
/
esxcli.bats
File metadata and controls
executable file
·120 lines (85 loc) · 2.36 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env bats
load test_helper
@test "esxcli network vm list" {
vcsim_env -esx
# make sure there's at least 1 VM so we get a table header to count against
vm=$(new_empty_vm)
govc vm.power -on $vm
nlines=$(govc host.esxcli network vm list | wc -l)
vm=$(new_empty_vm)
govc vm.power -on $vm
xlines=$(govc host.esxcli network vm list | wc -l)
# test that we see a new row
[ $(($nlines + 1)) -eq $xlines ]
run govc host.esxcli network vm list enoent
assert_failure
run govc host.esxcli network vm list
assert_success
assert_matches "VM Network"
assert_matches VM0
assert_matches VM1
}
@test "esxcli network ip connection list" {
vcsim_env
run govc host.esxcli -- network ip connection list -t tcp
assert_success
# test that we get the expected number of table columns
nf=$(echo "${lines[1]}" | awk '{print NF}')
[ $nf -eq 9 ]
run govc host.esxcli -- network ip connection list -t enoent
assert_failure
}
@test "esxcli system settings advanced list" {
vcsim_env
run govc host.esxcli -- system settings advanced list -o /Net/GuestIPHack
assert_success
assert_line "Path: /Net/GuestIPHack"
run govc host.esxcli -- system settings advanced list -o /Net/ENOENT
assert_failure
}
@test "esxcli software vib" {
vcsim_env
run govc host.esxcli software enoent
assert_failure
run govc host.esxcli software vib enoent
assert_failure
run govc host.esxcli software vib get -n esx-ui
assert_success
}
@test "esxcli native types" {
vcsim_env
run govc host.esxcli hardware clock get # xsd:string
assert_success
assert_matches Z
run govc host.esxcli iscsi software get # xsd:boolean
assert_success false
run govc host.esxcli system stats uptime get # xsd:long
assert_success
}
@test "esxcli vm process" {
vcsim_env -esx
run govc host.esxcli vm process list
assert_success
assert_matches VM0
assert_matches VM1
}
@test "esxcli firewall" {
vcsim_env -esx
run govc host.esxcli network firewall get
assert_success
assert_matches "DROP"
}
@test "esxcli model" {
vcsim_env -esx
export GOVC_SHOW_UNRELEASED=true
run govc host.esxcli.model
assert_success
run govc host.esxcli.model network.vm network.ip.connection
assert_success
run govc host.esxcli.model -dump
assert_success
run govc host.esxcli.model -c
assert_success
run govc host.esxcli.model -i
assert_success
}