The URI to use to set a config option is a bit arcane to write/remember
and checking if the setting was successful doubly so.
Git-Dch: Ignore
+webserverconfig() {
+ msgtest "Set webserver config option '${1}' to" "$2"
+ downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null
+ local DOWNLOG='download-testfile.log'
+ rm -f "$DOWNLOG"
+ local STATUS="$(mktemp)"
+ addtrap "rm $STATUS;"
+ downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
+ if [ "$(cat "$STATUS")" = '200' ]; then
+ msgpass
+ else
+ cat >&2 "$DOWNLOG"
+ msgfail "Statuscode was $(cat "$STATUS")"
+ fi
+}
+
rewritesourceslist() {
local APTARCHIVE="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")"
for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
rewritesourceslist() {
local APTARCHIVE="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")"
for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
cp -a ${TESTDIR}/framework $TESTFILE
testrun() {
cp -a ${TESTDIR}/framework $TESTFILE
testrun() {
- downloadfile "$1/_config/set/aptwebserver::support::range/true" '/dev/null' >/dev/null
- testwebserverlaststatuscode '200'
+ webserverconfig 'aptwebserver::support::range' 'true'
copysource $TESTFILE 0 ./testfile
testdownloadfile 'no data' "${1}/testfile" './testfile' '='
copysource $TESTFILE 0 ./testfile
testdownloadfile 'no data' "${1}/testfile" './testfile' '='
testdownloadfile 'old data' "${1}/testfile" './testfile' '='
testwebserverlaststatuscode '200'
testdownloadfile 'old data' "${1}/testfile" './testfile' '='
testwebserverlaststatuscode '200'
- downloadfile "$1/_config/set/aptwebserver::support::range/false" '/dev/null' >/dev/null
- testwebserverlaststatuscode '200'
+ webserverconfig 'aptwebserver::support::range' 'false'
copysource $TESTFILE 20 ./testfile
testdownloadfile 'no server support' "${1}/testfile" './testfile' '='
copysource $TESTFILE 20 ./testfile
testdownloadfile 'no server support' "${1}/testfile" './testfile' '='
setupflataptarchive
changetowebserver
setupflataptarchive
changetowebserver
-downloadfile "http://localhost:8080/_config/set/aptwebserver::support::range/false" '/dev/null' >/dev/null
+webserverconfig 'aptwebserver::support::range' 'false'
prepare() {
local DATE="${2:-now}"
prepare() {
local DATE="${2:-now}"
{
FileFd data(filename, FileFd::ReadOnly);
std::string condition = LookupTag(*m, "If-Modified-Since", "");
{
FileFd data(filename, FileFd::ReadOnly);
std::string condition = LookupTag(*m, "If-Modified-Since", "");
- if (condition.empty() == false)
+ if (_config->FindB("aptwebserver::support::modified-since", true) == true && condition.empty() == false)
{
time_t cache;
if (RFC1123StrToTime(condition.c_str(), cache) == true &&
{
time_t cache;
if (RFC1123StrToTime(condition.c_str(), cache) == true &&