test-0068.sh 683 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. . ./test-common.sh
  3. cleanup 68
  4. # ------------------------------- Test 68 ------------------------------------
  5. # Old state file entries should be removed when not used. Logrotate should
  6. # not freeze on big state file.
  7. preptest test.log 68 1 0
  8. cat > state << EOF
  9. logrotate state -- version 1
  10. "$PWD/test.log" 2000-1-1
  11. EOF
  12. for i in $(seq 1 200000)
  13. do
  14. echo "\"$PWD/removed.log$i\" 2000-1-1" >> state
  15. done
  16. $RLR test-config.68 --force
  17. cat state|grep test.log >/dev/null
  18. if [ $? != 0 ]; then
  19. echo "state file should contain 'test.log'"
  20. exit 3
  21. fi
  22. cat state|grep removed.log >/dev/null
  23. if [ $? = 0 ]; then
  24. echo "state file should not contain 'removed.log'"
  25. exit 3
  26. fi