Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 73 lines (54 sloc) 1.766 kB
#!/bin/bash
# Test vdi backup and restore
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
_cleanup
for i in `seq 0 4`; do
_start_sheep $i
done
_wait_for_sheep 5
$COLLIE cluster format
$COLLIE vdi create test 12M
# create the first object
echo 0 | $COLLIE vdi write test 0 512
$COLLIE vdi snapshot test -s snap1
# create the second object
echo 1 | $COLLIE vdi write test $((4 * 1024 * 1024)) 512
$COLLIE vdi snapshot test -s snap2
# update the first object
echo 2 | $COLLIE vdi write test 0 512
$COLLIE vdi snapshot test -s snap3
# check vdis
$COLLIE vdi list | _filter_short_date
$COLLIE vdi tree | _filter_short_date
for i in `seq 1 3`; do
$COLLIE vdi read test -s snap$i | md5sum
done
# create backup files between snapshots
$COLLIE vdi backup test -F snap1 -s snap2 > /tmp/backup.1.2
$COLLIE vdi backup test -F snap1 -s snap3 > /tmp/backup.1.3
$COLLIE vdi backup test -F snap2 -s snap3 > /tmp/backup.2.3
# restore backups
$COLLIE vdi restore test -s snap1 < /tmp/backup.1.2
$COLLIE vdi list | _filter_short_date
$COLLIE vdi tree | _filter_short_date
$COLLIE vdi restore test -s 4 < /tmp/backup.2.3
$COLLIE vdi list | _filter_short_date
$COLLIE vdi tree | _filter_short_date
$COLLIE vdi restore test -s snap1 < /tmp/backup.1.3
$COLLIE vdi list | _filter_short_date
$COLLIE vdi tree | _filter_short_date
$COLLIE vdi restore test -s snap2 < /tmp/backup.2.3
$COLLIE vdi list | _filter_short_date
$COLLIE vdi tree | _filter_short_date
# check vdi contents
$COLLIE vdi read test | md5sum
for i in `seq 1 $($COLLIE vdi list | grep "^s " | wc -l)`; do
$COLLIE vdi read test -s $i | md5sum
done
Jump to Line
Something went wrong with that request. Please try again.