apparmor.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. FPM: Apparmor Test
  3. --DESCRIPTION--
  4. This test tries to launches a pool which tries to change to non existing
  5. apparmor hat a. Test succeeds if apparmor is not running or hat is non
  6. existent.
  7. --SKIPIF--
  8. <?php
  9. include "skipif.inc";
  10. include "skipapparmor.inc";
  11. ?>
  12. --FILE--
  13. <?php
  14. include "include.inc";
  15. $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
  16. $cfg = <<<EOT
  17. [global]
  18. error_log = $logfile
  19. [a]
  20. listen = 127.0.0.1:9001
  21. pm = dynamic
  22. pm.max_children = 5
  23. pm.start_servers = 2
  24. pm.min_spare_servers = 1
  25. pm.max_spare_servers = 3
  26. apparmor_hat = a
  27. EOT;
  28. /* libapparmor has a bug which can cause SIGSEGV till Version 2.8.0-0ubuntu28
  29. See https://bugs.launchpad.net/apparmor/+bug/1196880
  30. Possible outcomes:
  31. - SIGSEGV|failed to query apparmor confinement
  32. apparmor not running
  33. - failed to change to new confinement
  34. something in apparmor went wrong
  35. - exited with code 70
  36. Change to successful; Hat not existent (Process gets killed by apparmor)
  37. */
  38. var_dump(run_fpm_till('/(SIGSEGV|failed to query apparmor confinement|failed to change to new confinement|exited with code 70)/', $cfg));
  39. ?>
  40. --EXPECTF--
  41. string(%d) "%s
  42. "
  43. --CLEAN--
  44. <?php
  45. $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
  46. @unlink($logfile);
  47. ?>