/t/t01-tarball.sh

http://github.com/sukria/Backup-Manager · Shell · 41 lines · 23 code · 9 blank · 9 comment · 2 complexity · 84ae8838a0967451327e6c89a7463024 MD5 · raw file

  1. #! /usr/bin/env bash
  2. set -e
  3. # Each test script should include testlib.sh
  4. source testlib.sh
  5. # When the test is ready, set this to false for nice outputs.
  6. # if you want to see what happens, use those flags
  7. # verbose="true"
  8. # verbosedebug="true"
  9. # warnings="true"
  10. # The conffile part of the test, see confs/* for details.
  11. source confs/base.conf
  12. source confs/tarball.conf
  13. export BM_ARCHIVE_ROOT="repository"
  14. export BM_ARCHIVE_METHOD="tarball"
  15. export BM_TARBALL_DIRECTORIES="$PWD"
  16. export BM_TARBALL_FILETYPE="tar.gz"
  17. source $locallib/sanitize.sh
  18. # The test actions
  19. if [[ -e $BM_ARCHIVE_ROOT ]]; then
  20. rm -f $BM_ARCHIVE_ROOT/*
  21. fi
  22. bm_init_env
  23. bm_init_today
  24. create_directories
  25. make_archives
  26. name=$(get_dir_name $PWD long)
  27. if [[ -e "$BM_ARCHIVE_ROOT/$BM_ARCHIVE_PREFIX$name.$TODAY.master.tar.gz" ]]; then
  28. rm -rf $BM_ARCHIVE_ROOT
  29. exit 0
  30. else
  31. exit 1
  32. fi