Split trivial-httpd into separate binary

Working on the libcurl backend, I hit the issue that the trivial-httpd program
depends on libsoup. I briefly considered having two versions, but libcurl is
client only, and moreover trivial-httpd is no longer trivial - it has various
features which are used by the test suite extensively.

Hence, what we'll do is build it as a separate binary which links to libsoup,
and use it during the tests. We *also* currently still provide `ostree
trivial-httpd` since some things use it like `rpm-ostree-toolbox` and the
Cockpit tests.

After those are ported to use some other webserver, I plan to add a build-time
option to drop it.

Closes: #636
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-01-04 16:32:11 +00:00
1 parent c051ee4a35
commit ced22f6c9b
10 files changed
+715 -635

No files matched your search

+8 -2
View File
@@ -102,6 +102,12 @@ else
fi
fi
if test -n "${OSTREE_UNINSTALLED:-}"; then
OSTREE_HTTPD=${OSTREE_UNINSTALLED}/ostree-trivial-httpd
else
OSTREE_HTTPD="${CMD_PREFIX} ostree trivial-httpd"
fi
assert_streq () {
test "$1" = "$2" || (echo 1>&2 "$1 != $2"; exit 1)
}
@@ -257,7 +263,7 @@ setup_fake_remote_repo1() {
mkdir ${test_tmpdir}/httpd
cd httpd
ln -s ${test_tmpdir}/ostree-srv ostree
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/httpd-port $args
${OSTREE_HTTPD} --autoexit --daemonize -p ${test_tmpdir}/httpd-port $args
port=$(cat ${test_tmpdir}/httpd-port)
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/httpd-address
cd ${oldpwd}
@@ -379,7 +385,7 @@ EOF
mkdir ${test_tmpdir}/httpd
cd httpd
ln -s ${test_tmpdir} ostree
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/httpd-port
${OSTREE_HTTPD} --autoexit --daemonize -p ${test_tmpdir}/httpd-port
port=$(cat ${test_tmpdir}/httpd-port)
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/httpd-address
cd ${oldpwd}
+1 -1
View File
@@ -53,7 +53,7 @@ cd ${test_tmpdir}
mkdir ${test_tmpdir}/httpd
cd httpd
ln -s ${test_tmpdir}/ostree-srv ostree
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -P 18081 -p ${test_tmpdir}/httpd-port
${OSTREE_HTTPD} --autoexit --daemonize -P 18081 -p ${test_tmpdir}/httpd-port
port=$(cat ${test_tmpdir}/httpd-port)
assert_streq $port 18081
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/httpd-address
+1 -2
View File
@@ -51,8 +51,7 @@ fi
find ${test_tmpdir}/ostree-srv/gnomerepo/objects \
! -name '*.commitmeta' -type f | xargs rm
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize \
-p ${test_tmpdir}/httpd-content-port
${OSTREE_HTTPD} --autoexit --daemonize -p ${test_tmpdir}/httpd-content-port
content_port=$(cat ${test_tmpdir}/httpd-content-port)
echo "http://127.0.0.1:${content_port}" > ${test_tmpdir}/httpd-content-address
+1 -1
View File
@@ -29,7 +29,7 @@ echo '1..9'
cd ${test_tmpdir}
mkdir metalink-data
cd metalink-data
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/metalink-httpd-port
${OSTREE_HTTPD} --autoexit --daemonize -p ${test_tmpdir}/metalink-httpd-port
metalink_port=$(cat ${test_tmpdir}/metalink-httpd-port)
echo "http://127.0.0.1:${metalink_port}" > ${test_tmpdir}/metalink-httpd-address
+1 -1
View File
@@ -33,7 +33,7 @@ setup_mirror () {
cd $name
cp -a ${test_tmpdir}/ostree-srv ostree
${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize \
${OSTREE_HTTPD} --autoexit --daemonize \
-p ${test_tmpdir}/${name}-port
port=$(cat ${test_tmpdir}/${name}-port)
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/${name}-address
+1 -1
View File
@@ -50,7 +50,7 @@ mkdir mirror-httpd
cd mirror-httpd
ln -s ${test_tmpdir}/mirror-srv ostree
mirror_log="${test_tmpdir}/mirror_log"
${CMD_PREFIX} ostree trivial-httpd --log-file=${mirror_log} --autoexit --daemonize -p ${test_tmpdir}/mirror-httpd-port
${OSTREE_HTTPD} --log-file=${mirror_log} --autoexit --daemonize -p ${test_tmpdir}/mirror-httpd-port
port=$(cat ${test_tmpdir}/mirror-httpd-port)
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/mirror-httpd-address