5
@test "host info esx" {
8
grep -q Manufacturer: <<<$output
10
run govc host.info -host enoent
11
assert_failure "Error: host 'enoent' not found"
13
for opt in dns ip ipath uuid
15
run govc host.info "-host.$opt" enoent
16
assert_failure "Error: no such host"
19
# avoid hardcoding the esxbox hostname
20
local name=$(govc ls '/*/host/*' | grep -v Resources)
22
run govc host.info -host $name
24
grep -q Manufacturer: <<<$output
26
run govc host.info -host ${name##*/}
28
grep -q Manufacturer: <<<$output
30
run govc host.info -host.ipath $name
33
run govc host.info -host.dns $(basename $(dirname $name))
36
uuid=$(govc host.info -json | jq -r .HostSystems[].Hardware.SystemInfo.Uuid)
37
run govc host.info -host.uuid $uuid
41
@test "host info vc" {
46
grep -q Manufacturer: <<<$output
48
run govc host.info -host enoent
49
assert_failure "Error: host 'enoent' not found"
51
for opt in dns ip ipath uuid
53
run govc host.info "-host.$opt" enoent
54
assert_failure "Error: no such host"
61
assert_failure "Error: please specify a host"
63
run govc host.info -host $name
65
grep -q Manufacturer: <<<$output
67
run govc host.info -host.ipath $name
70
run govc host.info -host.dns $(basename $name)
73
uuid=$(govc host.info -host $name -json | jq -r .HostSystems[].Hardware.SystemInfo.Uuid)
74
run govc host.info -host.uuid $uuid