test-0039.sh 777 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. . ./test-common.sh
  3. cleanup 39
  4. # ------------------------------- Test 39 ------------------------------------
  5. # preremove script error - do not remove log file
  6. preptest test.log 39 1
  7. preptest test2.log 39 1
  8. $RLR test-config.39 --force 2>error.log
  9. grep "error running preremove script" error.log >/dev/null
  10. if [ $? != 0 ]; then
  11. echo "No error 'error running preremove script' printed, but there should be one."
  12. exit 3
  13. fi
  14. # Check both possible orders
  15. grep "test2.log.1" scriptout >/dev/null
  16. if [ $? != 0 ]; then
  17. grep "test.log.1" scriptout >/dev/null
  18. if [ $? != 0 ]; then
  19. echo "ERROR: scriptout should contain 'test2.log.1' or 'test.log.1'"
  20. exit 3
  21. fi
  22. fi
  23. rm -f scriptout
  24. checkoutput <<EOF
  25. test.log 0
  26. test.log.1 0 zero
  27. test2.log 0
  28. test2.log.1 0 zero
  29. EOF