You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Gary Benson <gb...@redhat.com> on 2001/08/10 13:58:30 UTC

Ensure paths for EAPI exist

Hi all,

Another patch...

If you have mod_ssl's EAPI compiled in, then Apache trys to write files to
a location defined in EAPI_MM_CORE_PATH. If this path does not exist then
httpd can't start and TestServer::start fails.

You can't override this path with configuration directives; you just have
to live with whatever it's set to. This patch ensures that the path exists.

Hope it's ok,
Gary

[ Gary Benson, Red Hat Europe ][ gbenson@redhat.com ][ GnuPG 60E8793A ]


Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.14
diff -u -r1.14 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm	2001/08/07 16:18:32	1.14
+++ Apache-Test/lib/Apache/TestConfig.pm	2001/08/10 11:52:40
@@ -5,7 +5,8 @@

 use constant WIN32 => $^O eq 'MSWin32';

-use File::Spec::Functions qw(catfile abs2rel splitdir);
+use File::Spec::Functions qw(catfile abs2rel splitdir
+                             catdir file_name_is_absolute);
 use Cwd qw(fastcwd);

 use Apache::TestConfigPerl ();
@@ -155,6 +156,7 @@
     $self->configure_apxs;
     $self->configure_httpd;
     $self->inherit_config; #see TestConfigParse.pm
+    $self->configure_httpd_eapi; #must come after inherit_config

     $self->{hostport} = $self->hostport;

@@ -201,6 +203,25 @@
     my $sem = catfile $vars->{t_logs}, 'apache_runtime_status.sem';
     unless (-e $sem) {
         $self->{clean}->{files}->{$sem} = 1;
+    }
+}
+
+sub configure_httpd_eapi {
+    my $self = shift;
+    my $vars = $self->{vars};
+
+    #deal with EAPI_MM_CORE_PATH if defined.
+    if (defined($self->{httpd_defines}->{EAPI_MM_CORE_PATH})) {
+        my $path = $self->{httpd_defines}->{EAPI_MM_CORE_PATH};
+
+        #ensure the directory exists
+        my @chunks = splitdir $path;
+        pop @chunks; #the file component of the path
+        $path = catdir @chunks;
+        unless (file_name_is_absolute $path) {
+            $path = catdir $vars->{serverroot}, $path;
+        }
+        $self->gendir($path);
     }
 }



Re: Ensure paths for EAPI exist

Posted by Gary Benson <gb...@redhat.com>.
On Fri, 10 Aug 2001, Doug MacEachern wrote:

> thanks, looks good, applied.

Thank you,
Gary


Re: Ensure paths for EAPI exist

Posted by Doug MacEachern <do...@covalent.net>.
thanks, looks good, applied.