Page MenuHomeDevCentral

D587.id.diff
No OneTemporary

D587.id.diff

diff --git a/YsulApacheTest.php b/YsulApacheTest.php
--- a/YsulApacheTest.php
+++ b/YsulApacheTest.php
@@ -2,11 +2,15 @@
require_once 'traits/assertHttp.php';
+/**
+ * These tests ensure Apache has been recompiled with
+ * the right options as long as SuEXEC is concerned.
+ */
class YsulApacheTest extends PHPUnit_Framework_TestCase {
use assertHttp;
/**
- * Apache server hostname to tet
+ * Apache server hostname to test
*/
const SERVER = 'ysul.nasqueron.org';
@@ -15,27 +19,39 @@
*/
const PORT = 3200;
- /**
- * Path to SuEXEC binary
- */
- const SUEXEC = '/usr/local/sbin/suexec';
+ /**
+ * @var string
+ */
+ protected $url;
+
+ public function setUp () {
+ $this->url = "http://" . self::SERVER . ":" . self::PORT . "/";
+ }
public function testApacheIsLive () {
- $url = "http://" . self::SERVER . ":" . self::PORT . "/";
- $this->assertHttpResponseCode(200, $url, "Apache looks down.");
+ $this->assertHttpResponseCode(200, $this->url, "Apache looks down.");
}
+ public function testUserDirectoryWorks () {
+ $url = $this->url . "~qa/status.html";
+ $this->assertHttpResponseCode(200, $url, "Apache doesn't serve user directories.");
+ }
+
+ public function testUserDirectoryChmod () {
+ $url = $this->url . "~qa/";
+ $this->assertHttpResponseCode(200, $url, "Apache doesn't autoindex user directories.");
+
+ $url = $this->url . "~qa/noautoindex/";
+ $this->assertHttpResponseCode(403, $url, "Apache should return a 403 for user directories chmoded 711.");
+ }
+
public function testSuEXECHasBeenInstalled () {
// Reported by amj on T823, see also T508 and T517.
- if (gethostname() !== self::SERVER) {
- $this->markTestSkipped(
- "This test can only run on " . self::SERVER
- );
- };
+ $url = $this->url . "~qa/test.cgi";
+ $this->assertHttpResponseCode(200, $url, "SuEXEC isn't installed or not configured to allow public_html CGI scripts.");
- $this->assertTrue(
- file_exists(self::SUEXEC)
- );
+ $url = $this->url . "~qa/test.php";
+ $this->assertHttpResponseCode(200, $url, "SuEXEC should be patched to invoke php interpreter when the extension is .php.");
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 15:24 (19 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2232047
Default Alt Text
D587.id.diff (2 KB)

Event Timeline