test-0051.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. . ./test-common.sh
  3. cleanup 51
  4. # ------------------------------- Test 51 ------------------------------------
  5. # regression in 3.8.4, logrotate crashes with sharedscripts when 0 logs rotated
  6. preptest test.log 51 1 0
  7. # It's memory corruption and without something in state file, it won't crash
  8. # reliably. It would be better to run valgrind here and check the errors, but
  9. # I don't want the test-suite to depend on valgrind...
  10. cat > state << EOF
  11. logrotate state -- version 2
  12. "/var/log/httpd/backend_error_log" 2013-6-16
  13. "/var/log/tokyotyrant/*.log" 2011-5-30
  14. "/var/log/mailman/digest" 2011-5-30
  15. "/var/log/piranha/piranha-gui-access" 2011-5-30
  16. "/var/log/boincerr.log" 2011-5-30
  17. "/var/log/btmp" 2013-7-9
  18. "/var/log/httpd/a_log" 2011-11-15
  19. "/var/log/cups/*_log" 2012-7-19
  20. "/var/log/rabbitmq/*.log" 2011-5-30
  21. "/var/log/func/func.log" 2011-11-17
  22. "/var/log/wtmp" 2013-7-9
  23. "/var/log/glusterfs/*glusterd.vol.log" 2011-11-17
  24. "/var/log/imapd.log" 2011-5-30
  25. "/var/log/cobbler/cobbler.log" 2011-11-6
  26. "/var/log/httpd/ssl_access_log" 2013-3-27
  27. "/var/log/mrepo.log" 2011-5-30
  28. EOF
  29. $RLR test-config.51
  30. if [ $? != 0 ]; then
  31. echo "logrotate ended with non-zero exit code (probably crashed)"
  32. exit 3
  33. fi