Page MenuHomeDevCentral

D587.diff
No OneTemporary

D587.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
Sat, Nov 23, 19:21 (19 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258745
Default Alt Text
D587.diff (2 KB)

Event Timeline