mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 11:36:51 +00:00
add vendoring with go dep
This commit is contained in:
36
vendor/github.com/vmware/govmomi/govc/test/session.bats
generated
vendored
Executable file
36
vendor/github.com/vmware/govmomi/govc/test/session.bats
generated
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
@test "session.ls" {
|
||||
run govc session.ls
|
||||
assert_success
|
||||
|
||||
run govc session.ls -json
|
||||
assert_success
|
||||
|
||||
# Test User-Agent
|
||||
govc session.ls | grep "$(govc version | tr ' ' /)"
|
||||
}
|
||||
|
||||
@test "session.rm" {
|
||||
run govc session.rm enoent
|
||||
assert_failure
|
||||
assert_output "govc: ServerFaultCode: The object or item referred to could not be found."
|
||||
|
||||
# Can't remove the current session
|
||||
id=$(govc session.ls -json | jq -r .CurrentSession.Key)
|
||||
run govc session.rm "$id"
|
||||
assert_failure
|
||||
|
||||
thumbprint=$(govc about.cert -thumbprint)
|
||||
# persist session just to avoid the Logout() so we can session.rm below
|
||||
dir=$(mktemp -d govc-test-XXXXX)
|
||||
|
||||
id=$(GOVMOMI_HOME="$dir" govc session.ls -json -k=false -persist-session -tls-known-hosts <(echo "$thumbprint") | jq -r .CurrentSession.Key)
|
||||
|
||||
rm -rf "$dir"
|
||||
|
||||
run govc session.rm "$id"
|
||||
assert_success
|
||||
}
|
||||
Reference in New Issue
Block a user