test-0043.sh 751 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. . ./test-common.sh
  3. cleanup 43
  4. # ------------------------------- Test 43 ------------------------------------
  5. # Test that prerotate and postrotate scripts are called twice for two files
  6. # when sharedscripts defined
  7. preptest test.log 43 1
  8. echo number2 > test2.log
  9. $RLR test-config.43
  10. # Check both possible orders
  11. grep "test2.log;test2.log;test.log;test.log;" scriptout >/dev/null
  12. if [ $? != 0 ]; then
  13. grep "test.log;test.log;test2.log;test2.log;" scriptout >/dev/null
  14. if [ $? != 0 ]; then
  15. echo "ERROR: scriptout should contain 'test2.log;test2.log;test.log;test.log;' or 'test.log;test.log;test2.log;test2.log;'"
  16. exit 3
  17. fi
  18. fi
  19. rm -f scriptout
  20. checkoutput <<EOF
  21. test.log 0
  22. test.log.1 0 zero
  23. test2.log 0
  24. test2.log.1 0 number2
  25. EOF