2024-10-02 23:14:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
run_test() {
|
2024-10-08 19:51:30 +02:00
|
|
|
echo "Running backup on branch main; repo $1 dest $2; num: $3..."
|
|
|
|
/bin/bash scripts/backup.sh -b main -r $1 -d $2 -n $3
|
2024-10-02 23:14:50 +02:00
|
|
|
echo
|
2024-10-08 19:51:30 +02:00
|
|
|
diff -r $2 tests/tests_cases/$3
|
2024-10-02 23:14:50 +02:00
|
|
|
if test $? -ne 0
|
|
|
|
then
|
|
|
|
echo "Test fail"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "... done"
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
ROOTDIR=$(git rev-parse --show-toplevel)
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
|
|
|
|
cd ${ROOTDIR}
|
|
|
|
|
2024-10-08 19:51:30 +02:00
|
|
|
run_test https://github.com/descartes-underwriting/devops-technical-test-data.git ${TMPDIR}/1 1
|
|
|
|
run_test https://github.com/descartes-underwriting/devops-technical-test-data.git ${TMPDIR}/2 2
|
|
|
|
run_test https://github.com/descartes-underwriting/devops-technical-test-data.git ${TMPDIR}/10 10
|
|
|
|
|
|
|
|
run_test https://github.com/mycroft/sample-repository.git ${TMPDIR}/test_sample 99
|
2024-10-02 23:14:50 +02:00
|
|
|
|
|
|
|
echo "All tests were OK"
|