#!/bin/bash

# Test vdi tree functionality

. ./common

for i in 0 1 2; do
    _start_sheep $i
done

_wait_for_sheep 3

_cluster_format -c 1

$QEMU_IMG create sheepdog:test 4G
$QEMU_IMG snapshot -c tag1 sheepdog:test
$QEMU_IMG snapshot -c tag2 sheepdog:test
$QEMU_IMG snapshot -c tag3 sheepdog:test

$QEMU_IMG create sheepdog:test2 4G
$QEMU_IMG snapshot -c tag1 sheepdog:test2
$QEMU_IMG snapshot -c tag2 sheepdog:test2
$QEMU_IO -c "write 0 512" sheepdog:test2:1 | _filter_qemu_io
$QEMU_IMG snapshot -c tag3 sheepdog:test2

$DOG vdi tree | _filter_short_date
