libcurl backend
For rpm-ostree, we already link to libcurl indirectly via librepo, and only having one HTTP library in process makes sense. Further, libcurl is (I think) more popular in the embedded space. It also supports HTTP/2.0 today, which is a *very* nice to have for OSTree. This seems to be working fairly well for me in my local testing, but it's obviously brand new nontrivial code, so it's going to need some soak time. The ugliest part of this is having to vendor in the soup-url code. With Oxidation we could follow the path of Firefox and use the [Servo URL parser](https://github.com/servo/rust-url). Having to redo cookie parsing also sucked, and that would also be a good oxidation target. But that's for the future. Closes: #641 Approved by: jlebon
This commit is contained in:
1 parent
425ccc0a33
commit
361aa449fb
20 files changed
+3301
-171
No files matched your search
@@ -52,6 +52,10 @@ NULL=
|
||||
# If yes, test failures break the build; if no, they are reported but ignored
|
||||
: "${ci_test_fatal:=yes}"
|
||||
|
||||
# ci_configopts:
|
||||
# Additional args for configure
|
||||
: "${ci_configopts:=}"
|
||||
|
||||
if [ -n "$ci_docker" ]; then
|
||||
exec docker run \
|
||||
--env=ci_docker="" \
|
||||
@@ -59,6 +63,7 @@ if [ -n "$ci_docker" ]; then
|
||||
--env=ci_sudo=yes \
|
||||
--env=ci_test="${ci_test}" \
|
||||
--env=ci_test_fatal="${ci_test_fatal}" \
|
||||
--env=ci_configopts="${ci_configopts}" \
|
||||
--privileged \
|
||||
ci-image \
|
||||
tests/ci-build.sh
|
||||
@@ -81,6 +86,7 @@ make="make -j${ci_parallel} V=1 VERBOSE=1"
|
||||
../configure \
|
||||
--enable-always-build-tests \
|
||||
--enable-installed-tests \
|
||||
${ci_configopts}
|
||||
"$@"
|
||||
|
||||
${make}
|
||||
|
||||
@@ -50,6 +50,9 @@ NULL=
|
||||
# Typical values for ci_distro=fedora might be 25, rawhide
|
||||
: "${ci_suite:=jessie}"
|
||||
|
||||
# ci_configopts: Additional arguments for configure
|
||||
: "${ci_configopts:=}"
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
sudo=
|
||||
else
|
||||
@@ -104,6 +107,7 @@ case "$ci_distro" in
|
||||
libmount-dev \
|
||||
libselinux1-dev \
|
||||
libsoup2.4-dev \
|
||||
libcurl4-openssl-dev \
|
||||
procps \
|
||||
zlib1g-dev \
|
||||
${NULL}
|
||||
|
||||
@@ -28,12 +28,9 @@ setup_fake_remote_repo1 "archive-z2" "" \
|
||||
"--expected-cookies foo=bar --expected-cookies baz=badger"
|
||||
|
||||
assert_fail (){
|
||||
set +e
|
||||
$@
|
||||
if [ $? = 0 ] ; then
|
||||
echo 1>&2 "$@ did not fail"; exit 1
|
||||
if $@; then
|
||||
(echo 1>&2 "$@ did not fail"; exit 1)
|
||||
fi
|
||||
set -euo pipefail
|
||||
}
|
||||
|
||||
cd ${test_tmpdir}
|
||||
@@ -50,12 +47,16 @@ echo "ok, setup done"
|
||||
# Add 2 cookies, pull should succeed now
|
||||
${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / foo bar
|
||||
${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / baz badger
|
||||
assert_file_has_content repo/origin.cookies.txt foo.*bar
|
||||
assert_file_has_content repo/origin.cookies.txt baz.*badger
|
||||
${CMD_PREFIX} ostree --repo=repo pull origin main
|
||||
|
||||
echo "ok, initial cookie pull succeeded"
|
||||
|
||||
# Delete one cookie, if successful pulls will fail again
|
||||
${CMD_PREFIX} ostree --repo=repo remote delete-cookie origin 127.0.0.1 / baz badger
|
||||
assert_file_has_content repo/origin.cookies.txt foo.*bar
|
||||
assert_not_file_has_content repo/origin.cookies.txt baz.*badger
|
||||
assert_fail ${CMD_PREFIX} ostree --repo=repo pull origin main
|
||||
|
||||
echo "ok, delete succeeded"
|
||||
@@ -63,6 +64,8 @@ echo "ok, delete succeeded"
|
||||
# Re-add the removed cooking and things succeed again, verified the removal
|
||||
# removed exactly one cookie
|
||||
${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / baz badger
|
||||
assert_file_has_content repo/origin.cookies.txt foo.*bar
|
||||
assert_file_has_content repo/origin.cookies.txt baz.*badger
|
||||
${CMD_PREFIX} ostree --repo=repo pull origin main
|
||||
|
||||
echo "ok, second cookie pull succeeded"
|
||||
Reference in new issue
Block a user