diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 14:43:19 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 14:43:19 +0200 |
commit | 54ae271dfc5f8405233ed320b2e9bd821ee8210f (patch) | |
tree | 9b27941b0e5cc0aa5ba805e1bcb9f8d7ff965592 /test | |
parent | 97e14c73be6684259e235a92cc575ea39a04fc7e (diff) | |
download | ck-54ae271dfc5f8405233ed320b2e9bd821ee8210f.tar.gz ck-54ae271dfc5f8405233ed320b2e9bd821ee8210f.tar.bz2 ck-54ae271dfc5f8405233ed320b2e9bd821ee8210f.zip |
Code restructure/simplification, restore regression test
Diffstat (limited to 'test')
-rw-r--r-- | test/05_restore | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/05_restore b/test/05_restore new file mode 100644 index 0000000..b27ed35 --- /dev/null +++ b/test/05_restore @@ -0,0 +1,46 @@ +#!/bin/bash + +init restore + +# setup test configs +path1=$BIN/test1.conf +path2=$BIN/test2.conf +path3=$BIN/test3.conf +path4=$BIN/test4.conf + +add_config prog1 $path1 +add_config prog1 $path2 + +add_config prog2 $path3 +add_config prog2 $path4 + +# delete prog1 links +rm $path1 $path2 + +# restore them +exec $BIN/ck -c $BIN restore -p prog1 > /dev/null & +wait $! + +for i in $($BIN/ck -c $BIN list -p prog1); do + if [[ ! -L "$i" ]]; then + err "Couldn't restore path $i" + exit 1 + fi +done + +## delete all links +rm $path1 $path2 $path3 $path4 + +# restore all +exec $BIN/ck -c $BIN restore all > /dev/null & +wait $! + +for i in $($BIN/ck -c $BIN list paths); do + if [[ ! -L "$i" ]]; then + err "Couldn't restore path $i" + exit 1 + fi +done + +clear_tests +echo -e $PASS |