1
0
mirror of https://github.com/Oxalide/vsphere-influxdb-go.git synced 2023-10-10 13:36:51 +02:00
vsphere-influxdb-go/vendor/github.com/vmware/govmomi/govc/test/datastore_tail_test.sh
2017-10-25 20:52:40 +00:00

27 lines
557 B
Bash
Executable File

#!/bin/bash -xe
# This test is not run via bats as the bats pipeline hangs when we background a process
. "$(dirname "$0")"/test_helper.bash
name=$(new_id)
n=16
tmp=$(mktemp --tmpdir "${name}-XXXXX")
echo -n | govc datastore.upload - "$name"
govc datastore.tail -f "$name" > "$tmp" &
pid=$!
sleep 1
yes | dd bs=${n}K count=1 2>/dev/null | govc datastore.upload - "$name"
sleep 2
# stops following when the file has gone away
govc datastore.mv "$name" "${name}.old"
wait $pid
govc datastore.download "${name}.old" - | cmp "$tmp" -
rm "$tmp"
teardown