mirror of
https://github.com/deajan/obackup.git
synced 2024-12-25 06:53:41 +01:00
Added upgrade script test
This commit is contained in:
parent
da5dc6f4bc
commit
281cb38ba5
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## obackup basic tests suite 2016090403
|
## obackup basic tests suite 2016090403
|
||||||
|
|
||||||
|
#TODO: add old conf file, have upgrade and check
|
||||||
#TODO: Must recreate files before each test set
|
#TODO: Must recreate files before each test set
|
||||||
|
|
||||||
OBACKUP_DIR="$(pwd)"
|
OBACKUP_DIR="$(pwd)"
|
||||||
@ -20,8 +21,10 @@ fi
|
|||||||
LOCAL_CONF="local.conf"
|
LOCAL_CONF="local.conf"
|
||||||
PULL_CONF="pull.conf"
|
PULL_CONF="pull.conf"
|
||||||
PUSH_CONF="push.conf"
|
PUSH_CONF="push.conf"
|
||||||
|
OLD_CONF="old.conf"
|
||||||
|
|
||||||
OBACKUP_EXECUTABLE=obackup.sh
|
OBACKUP_EXECUTABLE=obackup.sh
|
||||||
|
OBACKUP_UPGRADE=upgrade-v1.x-2.1x.sh
|
||||||
|
|
||||||
SOURCE_DIR="${HOME}/obackup-testdata"
|
SOURCE_DIR="${HOME}/obackup-testdata"
|
||||||
TARGET_DIR="${HOME}/obackup-storage"
|
TARGET_DIR="${HOME}/obackup-storage"
|
||||||
@ -621,5 +624,19 @@ function test_ParallelExec () {
|
|||||||
assertEquals "ParallelExec test 3" "2" $?
|
assertEquals "ParallelExec test 3" "2" $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_UpgradeConfPullRun () {
|
||||||
|
|
||||||
|
# Basic return code tests. Need to go deep into file presence testing
|
||||||
|
cd "$OBACKUP_DIR"
|
||||||
|
|
||||||
|
./$OBACKUP_UPGRADE "$CONF_DIR/$OLD_CONF"
|
||||||
|
assertEquals "Conf file upgrade" "0" $?
|
||||||
|
./$OBACKUP_EXECUTABLE "$CONF_DIR/$OLD_CONF"
|
||||||
|
assertEquals "Upgraded conf file execution test" "0" $?
|
||||||
|
|
||||||
|
# Move pre-upgraded file to original location agian
|
||||||
|
mv -f "$CONF_DIR/$OLD_CONF.save" "$CONF_DIR/$OLD_CONF"
|
||||||
|
}
|
||||||
|
|
||||||
. "$TESTS_DIR/shunit2/shunit2"
|
. "$TESTS_DIR/shunit2/shunit2"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user