forked from vmware/govmomi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesxcli.bats
executable file
·49 lines (34 loc) · 1.07 KB
/
esxcli.bats
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
#!/usr/bin/env bats
load test_helper
@test "network vm list" {
esx_env
# 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
}
@test "network ip connection list" {
esx_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[3]}" | awk '{print NF}')
[ $nf -eq 9 ]
run govc host.esxcli -- network ip connection list -t enoent
assert_failure
}
@test "system settings advanced list" {
esx_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
}