On my machine with CentOS, httpd is located at /usr/sbin/httpd, and
the modules are located at /usr/lib64/httpd/modules. To enable easy
testing of httpd, we would like those locations to be detected
automatically.
uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across. We do the same for the
modules directory.
Signed-off-by: Tarmigan Casebolt <redacted>
---
Would any machines have httpd or the modules/ directory in several of
these locations?
Also I don't really know shell scripting, so while this Works For Me,
it may be completely wrong.
t/lib-httpd.sh | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
With smart http, git over http is likely to become much more common.
To increase testing of smart http, enable the http tests by default.
If we cannot detect httpd, we still skip these tests, so it should not
cause problems on platforms where we cannot run the tests.
Signed-off-by: Tarmigan Casebolt <redacted>
---
t/lib-httpd.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
@@ -3,11 +3,12 @@# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>#-iftest-z"$GIT_TEST_HTTPD"+iftest-n"$NO_GIT_TEST_HTTPD"then-say"skipping test, network testing disabled by default"-say"(define GIT_TEST_HTTPD to enable)"+say"Skipping http tests because NO_GIT_TEST_HTTPD is defined"test_done+else+say"Define NO_GIT_TEST_HTTPD to disable http testing"fiHTTPD_PARA=""
From: Jay Soffian <hidden> Date: 2016-06-15 22:47:44
On Thu, Nov 19, 2009 at 8:22 PM, Tarmigan Casebolt
[off-list ref] wrote:
uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across. We do the same for the
modules directory.
Perhaps testing the distribution and looking in the known location for
that distribution then? That said, going through a list of well known
locations should work too.
+for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
+do
+ test -x "$DEFAULT_HTTPD_PATH" && break
+done
Unfortunately this leaves DEFAULT_HTTPD_PATH as the last item in the
list even if the test does not pass. You can add an empty item to the
end of the list if you want to do this way.
On Thu, Nov 19, 2009 at 7:14 PM, Jay Soffian [off-list ref] wrote:
On Thu, Nov 19, 2009 at 8:22 PM, Tarmigan Casebolt
[off-list ref] wrote:
quoted
uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across. We do the same for the
modules directory.
Perhaps testing the distribution and looking in the known location for
that distribution then? That said, going through a list of well known
locations should work too.
Is there a nice way to test the distribution? Seems to me like doing
that might be more complicated and also more fragile.
quoted
+for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
+do
+ test -x "$DEFAULT_HTTPD_PATH" && break
+done
Unfortunately this leaves DEFAULT_HTTPD_PATH as the last item in the
list even if the test does not pass. You can add an empty item to the
end of the list if you want to do this way.
Yes. I think this is how it was before though too, and it is caught
later in the script with the LIB_HTTPD_PATH setting and testing.
Yes. Again, this is still more thorough than before, but in this case
the script does not check later. Perhaps the script should test this
value and test_done if it's not a directory?
Thanks,
Tarmigan
On CentOS 5, httpd is located at /usr/sbin/httpd, and the modules are
located at /usr/lib64/httpd/modules. To enable easy testing of httpd,
we would like those locations to be detected automatically.
uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across. We do the same for the
modules directory.
cc: Jay Soffian <redacted>
Signed-off-by: Tarmigan Casebolt <redacted>
---
Jay was concerned about the final fallthrough cases for testing these
lists. I have added a test for the modules directory and the existing
tests later in the script already test that the apache executable
exists. If either cannot be found, we do test_done.
Would any machines have httpd or the modules/ directory in several of
these locations?
---
t/lib-httpd.sh | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
@@ -49,6 +62,11 @@ thensay"skipping test, at least Apache version 2 is required"test_donefi+if!test-d"$DEFAULT_HTTPD_MODULE_PATH"+then+say"Apache module directory not found. Skipping tests."+test_done+fiLIB_HTTPD_MODULE_PATH="$DEFAULT_HTTPD_MODULE_PATH"fi