aboutsummaryrefslogtreecommitdiff
path: root/exp/exp.sh
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-09 14:08:34 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-09 14:10:21 +0200
commit64e858b2699f6807cf1cdd7903fe2cf33f3b0ae2 (patch)
treea1767f63f527364380bf5432c9e9625c7e23a4c6 /exp/exp.sh
parent2df30c27ead445724d066fc7df301be4d22f3c44 (diff)
downloaddna-backup-64e858b2699f6807cf1cdd7903fe2cf33f3b0ae2.tar.gz
dna-backup-64e858b2699f6807cf1cdd7903fe2cf33f3b0ae2.zip
factorize dna backup runs in exp
Diffstat (limited to 'exp/exp.sh')
-rwxr-xr-xexp/exp.sh43
1 files changed, 18 insertions, 25 deletions
diff --git a/exp/exp.sh b/exp/exp.sh
index d5cc4dd..3a32f8f 100755
--- a/exp/exp.sh
+++ b/exp/exp.sh
@@ -2,12 +2,11 @@
# This script expects the following variables to be exported:
# - DNA_BACKUP: the path to dna-backup binary
+# - DNA_PARAMS: the path of the files that desscribes the multiple parameters to test
# - REPO_PATH: the path of the repo the experiment is based on
# - GIT_PATH: the path of the repo git-dir
# - MAX_VERSION: the max number for versions for the experiment
# - COMMITS: the name of the file that contains the lists of versions
-# - DNA_4K: the path fo the dna-backup dir with 4K chunksize
-# - DNA_8K: the path fo the dna-backup dir with 8K chunksize
# - DIFFS: the path of the git diff dir
# - GIT_NOPACK: the path of the git nopack dir
@@ -67,13 +66,12 @@ do
> $(printf "%s.versions/%05d" $GIT_NOPACK $i)
set-git-dir $GIT_PATH
- # Create 4k dna backup for this version
- log "create 4k dna backup for this version"
- $DNA_BACKUP commit -v 2 -c 4096 $REPO_PATH $DNA_4K
-
- # Create 8k dna backup for this version
- log "create 8k dna backup for this version"
- $DNA_BACKUP commit -v 2 $REPO_PATH $DNA_8K
+ # Create dna backups for this version
+ cat $DNA_PARAMS | while read name flags
+ do
+ log "create $name backup for this version"
+ $DNA_BACKUP commit -v 2 $flags $REPO_PATH $name
+ done
if [[ $(( $i % 4 )) == 0 ]]
then
@@ -93,23 +91,18 @@ do
|| log "git patchs restore do not match source"
rm -rf $TEMP
- # Check restore from 4k dna backup
- log "restore from 4k dna backup"
- TEMP=$(mktemp -d)
- $DNA_BACKUP restore -v 2 -c 4096 $DNA_4K $TEMP
- log "check restore from backup"
- diff --brief --recursive $REPO_PATH $TEMP \
- || log "dna backup restore do not match source"
- rm -rf $TEMP
- # Check restore from 8k dna backup
- log "restore from 8k dna backup"
- TEMP=$(mktemp -d)
- $DNA_BACKUP restore -v 2 $DNA_8K $TEMP
- log "check restore from backup"
- diff --brief --recursive $REPO_PATH $TEMP \
- || log "dna backup restore do not match source"
- rm -rf $TEMP
+ # Check restore from dna backups
+ cat $DNA_PARAMS | while read name flags
+ do
+ log "restore from $name backup"
+ TEMP=$(mktemp -d)
+ $DNA_BACKUP restore -v 2 $flags $name $TEMP
+ log "check restore from backup"
+ diff --brief --recursive $REPO_PATH $TEMP \
+ || log "dna backup restore do not match source"
+ rm -rf $TEMP
+ done
fi
prev=$hash