Commit 30ed9e9f authored by Franco Fichtner's avatar Franco Fichtner

rc: import test script from old tools

... and add a make target to execute it properly
parent 8920d202
...@@ -35,6 +35,10 @@ style: ...@@ -35,6 +35,10 @@ style:
setup: setup:
${.CURDIR}/src/etc/rc.php_ini_setup ${.CURDIR}/src/etc/rc.php_ini_setup
health:
# check test script output and advertise a failure...
[ "`${.CURDIR}/src/etc/rc.php_test_run`" == "FCGI-PASSED PASSED" ]
clean: clean:
git reset --hard HEAD && git clean -xdqf . git reset --hard HEAD && git clean -xdqf .
......
#!/usr/local/bin/php -f
<?php
/*
This script will chroot via the builder system to test
the local php setup. If we can perform a series of
small tests to ensure the php environment is sane.
*/
require_once('globals.inc');
require_once('util.inc');
require_once('xmlparse.inc');
require_once('config.lib.inc');
require_once('functions.inc');
$config = parse_config(true);
$passed_tests = true;
// Test config.inc
if ($config['system']['hostname'] == '') {
$passed_tests = false;
}
// Test for php-fcgi
$php_cgi = trim(`php-cgi -v | grep cgi-fcgi`);
if (stristr($php_cgi, 'cgi-fcgi')) {
echo 'FCGI-PASSED ';
} else {
echo 'FCGI-FAILED ';
exit(1);
}
if ($passed_tests) {
echo 'PASSED';
exit(0);
}
// Tests failed.
exit(1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment