From 21956a33628d16e042c057dbb348b692d0d8d880 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 27 Jan 2007 18:55:56 +0100 Subject: [PATCH] Add test script number one. --- test/test-ccollect1.sh | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 test/test-ccollect1.sh diff --git a/test/test-ccollect1.sh b/test/test-ccollect1.sh new file mode 100755 index 0000000..c5acf54 --- /dev/null +++ b/test/test-ccollect1.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# +# Nico Schottelius +# Date: 27-Jan-2007 +# Last Modified: - +# Description: +# + +ccollect=../ccollect.sh +testdir="$(dirname $0)/test-backups" +confdir="$(dirname $0)/test-config" +source="$(hostname)" +source_source="/tmp" +interval="taeglich" + + +# backup destination +mkdir -p "$testdir" +source_dest="$(cd "$testdir"; pwd -P)" + +# configuration +mkdir -p "${confdir}/sources/${source}" +ln -s "$source_dest" "${confdir}/sources/${source}/destination" +echo "$source_source" > "${confdir}/sources/${source}/source" +touch "${confdir}/sources/${source}/summary" +touch "${confdir}/sources/${source}/verbose" + +mkdir -p "${confdir}/defaults/intervals/" +echo 3 > "${confdir}/defaults/intervals/$interval" + +# create backups + +CCOLLECT_CONF="$confdir" "$ccollect" "$interval" -p -a +touch "${source_source}/$(date +%s)-$$.1982" + +CCOLLECT_CONF="$confdir" "$ccollect" "$interval" -p -a +touch "${source_source}/$(date +%s)-$$.42" + +CCOLLECT_CONF="$confdir" "$ccollect" "$interval" -p -a + +du -sh "$testdir" +du -shl "$testdir" + +echo "Delete $testdir and $confdir after test"