From e6cd40dc17722bbe6c9d734c3a58b39a18c34174 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 9 Jul 2012 17:38:40 +0200
Subject: start implementing an extremely simple webserver for testing APT
---
test/integration/framework | 7 +-
test/integration/skip-aptwebserver | 25 ++++
test/interactive-helper/aptwebserver.cc | 216 ++++++++++++++++++++++++++++++++
test/interactive-helper/makefile | 7 ++
4 files changed, 254 insertions(+), 1 deletion(-)
create mode 100755 test/integration/skip-aptwebserver
create mode 100644 test/interactive-helper/aptwebserver.cc
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 2d6ada117..a514bef20 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -688,7 +688,12 @@ signreleasefiles() {
}
changetowebserver() {
- if which weborf > /dev/null; then
+ if test -x ${BUILDDIRECTORY}/aptwebserver; then
+ cd aptarchive
+ LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver 2> /dev/null > /dev/null &
+ addtrap "kill $!;"
+ cd - > /dev/null
+ elif which weborf > /dev/null; then
weborf -xb aptarchive/ 2>&1 > /dev/null &
addtrap "kill $!;"
elif which gatling > /dev/null; then
diff --git a/test/integration/skip-aptwebserver b/test/integration/skip-aptwebserver
new file mode 100755
index 000000000..0622941ce
--- /dev/null
+++ b/test/integration/skip-aptwebserver
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
+
+setupaptarchive
+changetowebserver
+
+rm -rf rootdir/var/lib/apt/lists
+aptget update -qq
+testequal 'Hit http://localhost stable InRelease
+Hit http://localhost stable/main Sources
+Hit http://localhost stable/main amd64 Packages
+Hit http://localhost stable/main Translation-en
+Reading package lists...' aptget update
+
+mv rootdir/var/lib/apt/lists/localhost* rootdir/var/lib/apt/lists/partial
+aptget update
+
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
new file mode 100644
index 000000000..7a3624b6e
--- /dev/null
+++ b/test/interactive-helper/aptwebserver.cc
@@ -0,0 +1,216 @@
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+char const * const httpcodeToStr(int httpcode) { /*{{{*/
+ switch (httpcode) {
+ // Informational 1xx
+ case 100: return "100 Continue";
+ case 101: return "101 Switching Protocols";
+ // Successful 2xx
+ case 200: return "200 OK";
+ case 201: return "201 Created";
+ case 202: return "202 Accepted";
+ case 203: return "203 Non-Authoritative Information";
+ case 204: return "204 No Content";
+ case 205: return "205 Reset Content";
+ case 206: return "206 Partial Conent";
+ // Redirections 3xx
+ case 300: return "300 Multiple Choices";
+ case 301: return "301 Moved Permanently";
+ case 302: return "302 Found";
+ case 303: return "303 See Other";
+ case 304: return "304 Not Modified";
+ case 305: return "304 Use Proxy";
+ case 307: return "307 Temporary Redirect";
+ // Client errors 4xx
+ case 400: return "400 Bad Request";
+ case 401: return "401 Unauthorized";
+ case 402: return "402 Payment Required";
+ case 403: return "403 Forbidden";
+ case 404: return "404 Not Found";
+ case 405: return "405 Method Not Allowed";
+ case 406: return "406 Not Acceptable";
+ case 407: return "Proxy Authentication Required";
+ case 408: return "Request Time-out";
+ case 409: return "Conflict";
+ case 410: return "Gone";
+ case 411: return "Length Required";
+ case 412: return "Precondition Failed";
+ case 413: return "Request Entity Too Large";
+ case 414: return "Request-URI Too Large";
+ case 415: return "Unsupported Media Type";
+ case 416: return "Requested range not satisfiable";
+ case 417: return "Expectation Failed";
+ // Server error 5xx
+ case 500: return "Internal Server Error";
+ case 501: return "Not Implemented";
+ case 502: return "Bad Gateway";
+ case 503: return "Service Unavailable";
+ case 504: return "Gateway Time-out";
+ case 505: return "HTTP Version not supported";
+ }
+ return NULL;
+} /*}}}*/
+void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
+ std::ostringstream contentlength;
+ contentlength << "Content-Length: " << data.FileSize();
+ headers.push_back(contentlength.str());
+
+ std::string lastmodified("Last-Modified: ");
+ lastmodified.append(TimeRFC1123(data.ModificationTime()));
+ headers.push_back(lastmodified);
+} /*}}}*/
+bool sendHead(int client, int httpcode, std::list &headers) { /*{{{*/
+ string response("HTTP/1.1 ");
+ response.append(httpcodeToStr(httpcode));
+ headers.push_front(response);
+
+ headers.push_back("Server: APT webserver");
+
+ std::string date("Date: ");
+ date.append(TimeRFC1123(time(NULL)));
+ headers.push_back(date);
+
+ std::clog << ">>> RESPONSE >>>" << std::endl;
+ bool Success = true;
+ for (std::list::const_iterator h = headers.begin();
+ Success == true && h != headers.end(); ++h) {
+ Success &= FileFd::Write(client, h->c_str(), h->size());
+ Success &= FileFd::Write(client, "\r\n", 2);
+ std::clog << *h << std::endl;
+ }
+ Success &= FileFd::Write(client, "\r\n", 2);
+ std::clog << "<<<<<<<<<<<<<<<<" << std::endl;
+ return Success;
+} /*}}}*/
+bool sendFile(int client, FileFd &data) { /*{{{*/
+ bool Success = true;
+ char buffer[500];
+ unsigned long long actual = 0;
+ while ((Success &= data.Read(buffer, sizeof(buffer), &actual)) == true) {
+ if (actual == 0)
+ break;
+ Success &= FileFd::Write(client, buffer, actual);
+ }
+ Success &= FileFd::Write(client, "\r\n", 2);
+ return Success;
+} /*}}}*/
+bool sendData(int client, std::string &data) { /*{{{*/
+ bool Success = true;
+ Success &= FileFd::Write(client, data.c_str(), data.size());
+ Success &= FileFd::Write(client, "\r\n", 2);
+ return Success;
+} /*}}}*/
+void sendError(int client, int httpcode, string request, bool content) { /*{{{*/
+ std::list headers;
+ sendHead(client, httpcode, headers);
+ if (content == false)
+ return;
+ string response("");
+ response.append(httpcodeToStr(httpcode)).append("");
+ response.append("").append(httpcodeToStr(httpcode)).append("
");
+ response.append(request).append("");
+ sendData(client, response);
+} /*}}}*/
+
+int main(int argc, const char *argv[])
+{
+ // create socket, bind and listen to it {{{
+ int sock = socket(AF_INET6, SOCK_STREAM, 0);
+ if(sock < 0 ) {
+ _error->Errno("aptwerbserver", "Couldn't create socket");
+ _error->DumpErrors(std::cerr);
+ return 1;
+ }
+
+ // ensure that we accept all connections: v4 or v6
+ int const iponly = 0;
+ setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &iponly, sizeof(iponly));
+ // to not linger to an address
+ int const enable = 1;
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
+
+ struct sockaddr_in6 locAddr;
+ memset(&locAddr, 0, sizeof(locAddr));
+ locAddr.sin6_family = AF_INET6;
+ locAddr.sin6_port = htons(8080);
+ locAddr.sin6_addr = in6addr_any;
+
+ if (bind(sock, (struct sockaddr*) &locAddr, sizeof(locAddr)) < 0) {
+ _error->Errno("aptwerbserver", "Couldn't bind");
+ _error->DumpErrors(std::cerr);
+ return 2;
+ }
+
+ listen(sock, 1);
+ /*}}}*/
+
+ std::vector messages;
+ int client;
+ while ((client = accept(sock, NULL, NULL)) != -1) {
+ std::clog << "ACCEPT client " << client << " on socket " << sock << std::endl;
+
+ while (ReadMessages(client, messages)) {
+ for (std::vector::const_iterator m = messages.begin();
+ m != messages.end(); ++m) {
+ std::clog << ">>> REQUEST >>>>" << std::endl << *m << std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
+ std::list headers;
+ bool sendContent = true;
+ if (strncmp(m->c_str(), "HEAD ", 5) == 0)
+ sendContent = false;
+ if (strncmp(m->c_str(), "GET ", 4) != 0)
+ sendError(client, 501, *m, true);
+
+ std::string host = LookupTag(*m, "Host", "");
+ if (host.empty() == true) {
+ // RFC 2616 §14.23 Host
+ sendError(client, 400, *m, sendContent);
+ continue;
+ }
+
+ size_t const filestart = m->find(' ', 5);
+ string filename = m->substr(5, filestart - 5);
+
+ if (RealFileExists(filename) == false)
+ sendError(client, 404, *m, sendContent);
+ else {
+ FileFd data(filename, FileFd::ReadOnly);
+ std::string condition = LookupTag(*m, "If-Modified-Since", "");
+ if (condition.empty() == false) {
+ time_t cache;
+ if (RFC1123StrToTime(condition.c_str(), cache) == true && cache >= data.ModificationTime()) {
+ sendError(client, 304, *m, false);
+ continue;
+ }
+ }
+ addFileHeaders(headers, data);
+ sendHead(client, 200, headers);
+ if (sendContent == true)
+ sendFile(client, data);
+ }
+ }
+ _error->DumpErrors(std::cerr);
+ messages.clear();
+ }
+
+ std::clog << "CLOSE client " << client << " on socket " << sock << std::endl;
+ close(client);
+ }
+ return 0;
+}
diff --git a/test/interactive-helper/makefile b/test/interactive-helper/makefile
index 10d1e44ec..fee94cd77 100644
--- a/test/interactive-helper/makefile
+++ b/test/interactive-helper/makefile
@@ -37,3 +37,10 @@ include $(PROGRAM_H)
#SLIBS = -lapt-pkg -lrpm
#SOURCE = rpmver.cc
#include $(PROGRAM_H)
+
+# very simple webserver for APT testing
+PROGRAM=aptwebserver
+SLIBS = -lapt-pkg
+LIB_MAKES = apt-pkg/makefile
+SOURCE = aptwebserver.cc
+include $(PROGRAM_H)
--
cgit v1.2.3
From 90d1d54ef2a68bd443815f26e9e2b578a1d7c419 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jul 2012 11:35:56 +0200
Subject: add commandline, add configurable port, add --simulate-paywall to
simulate a broken webserver that intercepts connections and returns nonsese
---
test/interactive-helper/aptwebserver.cc | 52 ++++++++++++++++++++++++++++-----
1 file changed, 45 insertions(+), 7 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 7a3624b6e..3c476ad05 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -2,6 +2,8 @@
#include
#include
#include
+#include
+#include
#include
#include
@@ -66,6 +68,7 @@ char const * const httpcodeToStr(int httpcode) { /*{{{*/
}
return NULL;
} /*}}}*/
+
void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
std::ostringstream contentlength;
contentlength << "Content-Length: " << data.FileSize();
@@ -98,6 +101,7 @@ bool sendHead(int client, int httpcode, std::list &headers) { /*{{{
std::clog << "<<<<<<<<<<<<<<<<" << std::endl;
return Success;
} /*}}}*/
+
bool sendFile(int client, FileFd &data) { /*{{{*/
bool Success = true;
char buffer[500];
@@ -110,12 +114,14 @@ bool sendFile(int client, FileFd &data) { /*{{{*/
Success &= FileFd::Write(client, "\r\n", 2);
return Success;
} /*}}}*/
+
bool sendData(int client, std::string &data) { /*{{{*/
bool Success = true;
Success &= FileFd::Write(client, data.c_str(), data.size());
Success &= FileFd::Write(client, "\r\n", 2);
return Success;
} /*}}}*/
+
void sendError(int client, int httpcode, string request, bool content) { /*{{{*/
std::list headers;
sendHead(client, httpcode, headers);
@@ -131,6 +137,19 @@ void sendError(int client, int httpcode, string request, bool content) { /*{{{*/
int main(int argc, const char *argv[])
{
+ CommandLine::Args Args[] = {
+ {0, "simulate-paywall", "aptwebserver::Simulate-Paywall",
+ CommandLine::Boolean},
+ {0, "port", "aptwebserver::port", CommandLine::HasArg},
+ {0,0,0,0}
+ };
+
+ CommandLine CmdL(Args, _config);
+ if(pkgInitConfig(*_config) == false || CmdL.Parse(argc,argv) == false) {
+ _error->DumpErrors();
+ exit(1);
+ }
+
// create socket, bind and listen to it {{{
int sock = socket(AF_INET6, SOCK_STREAM, 0);
if(sock < 0 ) {
@@ -139,6 +158,10 @@ int main(int argc, const char *argv[])
return 1;
}
+ // get the port
+ int const port = _config->FindI("aptwebserver::port", 8080);
+ bool const simulate_broken_server = _config->FindB("aptwebserver::Simulate-Paywall", false);
+
// ensure that we accept all connections: v4 or v6
int const iponly = 0;
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &iponly, sizeof(iponly));
@@ -149,7 +172,7 @@ int main(int argc, const char *argv[])
struct sockaddr_in6 locAddr;
memset(&locAddr, 0, sizeof(locAddr));
locAddr.sin6_family = AF_INET6;
- locAddr.sin6_port = htons(8080);
+ locAddr.sin6_port = htons(port);
locAddr.sin6_addr = in6addr_any;
if (bind(sock, (struct sockaddr*) &locAddr, sizeof(locAddr)) < 0) {
@@ -158,18 +181,26 @@ int main(int argc, const char *argv[])
return 2;
}
+ if (simulate_broken_server) {
+ std::clog << "Simulating a broken web server that return nonsense "
+ "for all querries" << std::endl;
+ } else {
+ std::clog << "Serving ANY file on port: " << port << std::endl;
+ }
+
listen(sock, 1);
- /*}}}*/
std::vector messages;
int client;
while ((client = accept(sock, NULL, NULL)) != -1) {
- std::clog << "ACCEPT client " << client << " on socket " << sock << std::endl;
+ std::clog << "ACCEPT client " << client
+ << " on socket " << sock << std::endl;
while (ReadMessages(client, messages)) {
for (std::vector::const_iterator m = messages.begin();
m != messages.end(); ++m) {
- std::clog << ">>> REQUEST >>>>" << std::endl << *m << std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
+ std::clog << ">>> REQUEST >>>>" << std::endl << *m
+ << std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
std::list headers;
bool sendContent = true;
if (strncmp(m->c_str(), "HEAD ", 5) == 0)
@@ -187,14 +218,20 @@ int main(int argc, const char *argv[])
size_t const filestart = m->find(' ', 5);
string filename = m->substr(5, filestart - 5);
- if (RealFileExists(filename) == false)
+ if (simulate_broken_server == true) {
+ sendHead(client, 200, headers);
+ string data("ni ni ni");
+ sendData(client, data);
+ }
+ else if (RealFileExists(filename) == false)
sendError(client, 404, *m, sendContent);
else {
FileFd data(filename, FileFd::ReadOnly);
std::string condition = LookupTag(*m, "If-Modified-Since", "");
if (condition.empty() == false) {
time_t cache;
- if (RFC1123StrToTime(condition.c_str(), cache) == true && cache >= data.ModificationTime()) {
+ if (RFC1123StrToTime(condition.c_str(), cache) == true &&
+ cache >= data.ModificationTime()) {
sendError(client, 304, *m, false);
continue;
}
@@ -209,7 +246,8 @@ int main(int argc, const char *argv[])
messages.clear();
}
- std::clog << "CLOSE client " << client << " on socket " << sock << std::endl;
+ std::clog << "CLOSE client " << client
+ << " on socket " << sock << std::endl;
close(client);
}
return 0;
--
cgit v1.2.3
From da3ebfe79d570c3aeb5f0a407cfec7996f44420c Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jul 2012 12:01:46 +0200
Subject: add failing regression test for bug #346386
---
test/integration/framework | 9 ++++++++-
test/integration/test-ubuntu-bug346386 | 19 +++++++++++++++++++
test/interactive-helper/aptwebserver.cc | 8 ++++----
3 files changed, 31 insertions(+), 5 deletions(-)
create mode 100755 test/integration/test-ubuntu-bug346386
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index a514bef20..bf46ae0c5 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -687,10 +687,17 @@ signreleasefiles() {
msgdone "info"
}
+simulatebrokenwebserver() {
+ if ! test -x ${BUILDDIRECTORY}/aptwebserver; then
+ msgdie 'Need the aptwebserver to simulate broken connections'
+ fi
+ changetowebserver '--simulate-paywall'
+}
+
changetowebserver() {
if test -x ${BUILDDIRECTORY}/aptwebserver; then
cd aptarchive
- LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver 2> /dev/null > /dev/null &
+ LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> /dev/null > /dev/null &
addtrap "kill $!;"
cd - > /dev/null
elif which weborf > /dev/null; then
diff --git a/test/integration/test-ubuntu-bug346386 b/test/integration/test-ubuntu-bug346386
new file mode 100755
index 000000000..57004f343
--- /dev/null
+++ b/test/integration/test-ubuntu-bug346386
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
+
+setupaptarchive
+simulatebrokenwebserver
+
+rm -rf rootdir/var/lib/apt/lists
+aptget update
+testequal 'partial' "$(ls rootdir/var/lib/apt/lists/)"
+
+
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 3c476ad05..c7b815925 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -244,11 +244,11 @@ int main(int argc, const char *argv[])
}
_error->DumpErrors(std::cerr);
messages.clear();
- }
- std::clog << "CLOSE client " << client
- << " on socket " << sock << std::endl;
- close(client);
+ std::clog << "CLOSE client " << client
+ << " on socket " << sock << std::endl;
+ close(client);
+ }
}
return 0;
}
--
cgit v1.2.3
From a38a00b981de3031a51e76c8a2e220b59557c469 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jul 2012 12:26:15 +0200
Subject: always send content-length via the new addDataHeaders() to ensure
w3m/curl are happy too for 404 pages and to comply with the http 1.1 spec
---
test/interactive-helper/aptwebserver.cc | 34 +++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index c7b815925..ebe04d2a3 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -78,6 +78,13 @@ void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
lastmodified.append(TimeRFC1123(data.ModificationTime()));
headers.push_back(lastmodified);
} /*}}}*/
+
+void addDataHeaders(std::list &headers, std::string &data) {/*{{{*/
+ std::ostringstream contentlength;
+ contentlength << "Content-Length: " << data.size();
+ headers.push_back(contentlength.str());
+} /*}}}*/
+
bool sendHead(int client, int httpcode, std::list &headers) { /*{{{*/
string response("HTTP/1.1 ");
response.append(httpcodeToStr(httpcode));
@@ -124,14 +131,16 @@ bool sendData(int client, std::string &data) { /*{{{*/
void sendError(int client, int httpcode, string request, bool content) { /*{{{*/
std::list headers;
+ string response;
+ if (content == true) {
+ response.append("");
+ response.append(httpcodeToStr(httpcode)).append("");
+ response.append("").append(httpcodeToStr(httpcode)).append("
");
+ response.append(request).append("");
+ addDataHeaders(headers, response);
+ }
sendHead(client, httpcode, headers);
- if (content == false)
- return;
- string response("");
- response.append(httpcodeToStr(httpcode)).append("");
- response.append("").append(httpcodeToStr(httpcode)).append("
");
- response.append(request).append("");
sendData(client, response);
} /*}}}*/
@@ -219,8 +228,9 @@ int main(int argc, const char *argv[])
string filename = m->substr(5, filestart - 5);
if (simulate_broken_server == true) {
+ string data("ni ni ni\n");
+ addDataHeaders(headers, data);
sendHead(client, 200, headers);
- string data("ni ni ni");
sendData(client, data);
}
else if (RealFileExists(filename) == false)
@@ -244,11 +254,11 @@ int main(int argc, const char *argv[])
}
_error->DumpErrors(std::cerr);
messages.clear();
-
- std::clog << "CLOSE client " << client
- << " on socket " << sock << std::endl;
- close(client);
}
+
+ std::clog << "CLOSE client " << client
+ << " on socket " << sock << std::endl;
+ close(client);
}
return 0;
}
--
cgit v1.2.3
From 3ce22d4f714414d6deb8b044c5b08a8fe7a78967 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jul 2012 13:19:54 +0200
Subject: cleanup, thanks to donkult for his feedback
---
test/integration/framework | 9 +++------
test/integration/test-ubuntu-bug346386 | 2 +-
test/interactive-helper/aptwebserver.cc | 2 +-
3 files changed, 5 insertions(+), 8 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index bf46ae0c5..8f37d4a03 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -687,14 +687,11 @@ signreleasefiles() {
msgdone "info"
}
-simulatebrokenwebserver() {
- if ! test -x ${BUILDDIRECTORY}/aptwebserver; then
- msgdie 'Need the aptwebserver to simulate broken connections'
+changetowebserver() {
+ if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then
+ msgdie 'Need the aptwebserver when passing arguments'
fi
- changetowebserver '--simulate-paywall'
-}
-changetowebserver() {
if test -x ${BUILDDIRECTORY}/aptwebserver; then
cd aptarchive
LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> /dev/null > /dev/null &
diff --git a/test/integration/test-ubuntu-bug346386 b/test/integration/test-ubuntu-bug346386
index 57004f343..a5f502853 100755
--- a/test/integration/test-ubuntu-bug346386
+++ b/test/integration/test-ubuntu-bug346386
@@ -10,7 +10,7 @@ configarchitecture 'amd64'
buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
setupaptarchive
-simulatebrokenwebserver
+changetowebserver --simulate-paywall
rm -rf rootdir/var/lib/apt/lists
aptget update
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index ebe04d2a3..8fbb9eab9 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -154,7 +154,7 @@ int main(int argc, const char *argv[])
};
CommandLine CmdL(Args, _config);
- if(pkgInitConfig(*_config) == false || CmdL.Parse(argc,argv) == false) {
+ if(CmdL.Parse(argc,argv) == false) {
_error->DumpErrors();
exit(1);
}
--
cgit v1.2.3
From 549b49394848d051dc116600571df55d7160eeaa Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jul 2012 14:10:19 +0200
Subject: improve test some more
---
test/integration/framework | 1 +
test/integration/test-ubuntu-bug346386 | 32 ++++++++++++++++++++++++++++++--
2 files changed, 31 insertions(+), 2 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 8f37d4a03..d15fd0e01 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -688,6 +688,7 @@ signreleasefiles() {
}
changetowebserver() {
+
if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then
msgdie 'Need the aptwebserver when passing arguments'
fi
diff --git a/test/integration/test-ubuntu-bug346386 b/test/integration/test-ubuntu-bug346386
index a5f502853..1fbfb5ca4 100755
--- a/test/integration/test-ubuntu-bug346386
+++ b/test/integration/test-ubuntu-bug346386
@@ -1,6 +1,24 @@
#!/bin/sh
set -e
+ensure_n_canary_strings_in_dir() {
+ DIR=$1
+ CANARY_STRING=$2
+ EXPECTED_N=$3
+
+ msgtest "Testing for $EXPECTED_N canary strings '$CANARY_STRING' in in $DIR"
+
+
+ N=$(grep "$CANARY_STRING" $DIR/* 2>/dev/null |wc -l )
+ if [ "$N" = "$EXPECTED_N" ]; then
+ msgpass
+ return 0
+ else
+ msgfail "Expected $EXPECTED_N canaries, got $N"
+ return 1
+ fi
+}
+
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
@@ -13,7 +31,17 @@ setupaptarchive
changetowebserver --simulate-paywall
rm -rf rootdir/var/lib/apt/lists
-aptget update
-testequal 'partial' "$(ls rootdir/var/lib/apt/lists/)"
+if aptget update -qq 2>/dev/null; then
+ msgfail "excpected apt-get update failure"
+fi
+ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ "ni ni ni" 0
+testequal 'partial' ls rootdir/var/lib/apt/lists/
+# again, this time with pre-existing files valid data
+for f in Release Release.gpg main_binary-amd64_Packages stable_main_source_Sources; do
+ echo "canary" > rootdir/var/lib/apt/lists/localhost:8080_dists_stable_${f}
+done
+# this will fail, the important part is that the canaries remain
+aptget update -qq 2>/dev/null || true
+ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ "canary" 4
--
cgit v1.2.3
From 721b05b8501b3ffffcaef4d90b4f24e2a72b0fef Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jul 2012 15:28:28 +0200
Subject: rename the paywall testcase and reformat it a bit
---
.../test-ubuntu-bug-346386-apt-get-update-paywall | 47 ++++++++++++++++++++++
test/integration/test-ubuntu-bug346386 | 47 ----------------------
2 files changed, 47 insertions(+), 47 deletions(-)
create mode 100755 test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
delete mode 100755 test/integration/test-ubuntu-bug346386
(limited to 'test')
diff --git a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
new file mode 100755
index 000000000..25cccf067
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
@@ -0,0 +1,47 @@
+#!/bin/sh
+set -e
+
+ensure_n_canary_strings_in_dir() {
+ DIR=$1
+ CANARY_STRING=$2
+ EXPECTED_N=$3
+
+ msgtest "Testing for $EXPECTED_N canary strings '$CANARY_STRING' in in" "$DIR"
+
+ N=$(grep "$CANARY_STRING" $DIR/* 2>/dev/null |wc -l )
+ if [ "$N" = "$EXPECTED_N" ]; then
+ msgpass
+ return 0
+ else
+ msgfail "Expected $EXPECTED_N canaries, got $N"
+ return 1
+ fi
+}
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'native'
+
+insertpackage 'unstable' 'unrelated' 'all' '1.0' 'stable'
+
+setupaptarchive
+changetowebserver --simulate-paywall
+
+rm -rf rootdir/var/lib/apt/lists
+msgtest 'excpected failure of' 'apt-get update'
+aptget update -qq 2>/dev/null && msgfail || msgpass
+
+ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ 'ni ni ni' 0
+testequal 'partial' ls rootdir/var/lib/apt/lists/
+
+# again, this time with pre-existing files valid data
+for f in Release Release.gpg main_binary-amd64_Packages stable_main_source_Sources; do
+ echo "canary" > rootdir/var/lib/apt/lists/localhost:8080_dists_stable_${f}
+done
+
+# this will fail, the important part is that the canaries remain
+msgtest 'excpected failure of' 'apt-get update'
+aptget update -qq 2>/dev/null && msgfail || msgpass
+ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ 'canary' 4
diff --git a/test/integration/test-ubuntu-bug346386 b/test/integration/test-ubuntu-bug346386
deleted file mode 100755
index 1fbfb5ca4..000000000
--- a/test/integration/test-ubuntu-bug346386
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-set -e
-
-ensure_n_canary_strings_in_dir() {
- DIR=$1
- CANARY_STRING=$2
- EXPECTED_N=$3
-
- msgtest "Testing for $EXPECTED_N canary strings '$CANARY_STRING' in in $DIR"
-
-
- N=$(grep "$CANARY_STRING" $DIR/* 2>/dev/null |wc -l )
- if [ "$N" = "$EXPECTED_N" ]; then
- msgpass
- return 0
- else
- msgfail "Expected $EXPECTED_N canaries, got $N"
- return 1
- fi
-}
-
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
-
-setupenvironment
-configarchitecture 'amd64'
-
-buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
-
-setupaptarchive
-changetowebserver --simulate-paywall
-
-rm -rf rootdir/var/lib/apt/lists
-if aptget update -qq 2>/dev/null; then
- msgfail "excpected apt-get update failure"
-fi
-ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ "ni ni ni" 0
-testequal 'partial' ls rootdir/var/lib/apt/lists/
-
-# again, this time with pre-existing files valid data
-for f in Release Release.gpg main_binary-amd64_Packages stable_main_source_Sources; do
- echo "canary" > rootdir/var/lib/apt/lists/localhost:8080_dists_stable_${f}
-done
-# this will fail, the important part is that the canaries remain
-aptget update -qq 2>/dev/null || true
-ensure_n_canary_strings_in_dir rootdir/var/lib/apt/lists/ "canary" 4
-
--
cgit v1.2.3
From dc57a59b1e7a904ad7263245fa2b1d6a5a55655e Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jul 2012 18:00:11 +0200
Subject: reformat the aptwebserver code to look more like the rest of APT
---
test/interactive-helper/aptwebserver.cc | 89 ++++++++++++++++-----------------
1 file changed, 44 insertions(+), 45 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 8fbb9eab9..97a298c70 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -18,7 +18,7 @@
#include
#include
-char const * const httpcodeToStr(int httpcode) { /*{{{*/
+char const * const httpcodeToStr(int const httpcode) { /*{{{*/
switch (httpcode) {
// Informational 1xx
case 100: return "100 Continue";
@@ -67,9 +67,9 @@ char const * const httpcodeToStr(int httpcode) { /*{{{*/
case 505: return "HTTP Version not supported";
}
return NULL;
-} /*}}}*/
-
-void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
+}
+ /*}}}*/
+void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
std::ostringstream contentlength;
contentlength << "Content-Length: " << data.FileSize();
headers.push_back(contentlength.str());
@@ -77,15 +77,15 @@ void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
std::string lastmodified("Last-Modified: ");
lastmodified.append(TimeRFC1123(data.ModificationTime()));
headers.push_back(lastmodified);
-} /*}}}*/
-
+}
+ /*}}}*/
void addDataHeaders(std::list &headers, std::string &data) {/*{{{*/
std::ostringstream contentlength;
contentlength << "Content-Length: " << data.size();
headers.push_back(contentlength.str());
-} /*}}}*/
-
-bool sendHead(int client, int httpcode, std::list &headers) { /*{{{*/
+}
+ /*}}}*/
+bool sendHead(int const client, int const httpcode, std::list &headers) { /*{{{*/
string response("HTTP/1.1 ");
response.append(httpcodeToStr(httpcode));
headers.push_front(response);
@@ -107,9 +107,9 @@ bool sendHead(int client, int httpcode, std::list &headers) { /*{{{
Success &= FileFd::Write(client, "\r\n", 2);
std::clog << "<<<<<<<<<<<<<<<<" << std::endl;
return Success;
-} /*}}}*/
-
-bool sendFile(int client, FileFd &data) { /*{{{*/
+}
+ /*}}}*/
+bool sendFile(int const client, FileFd &data) { /*{{{*/
bool Success = true;
char buffer[500];
unsigned long long actual = 0;
@@ -120,34 +120,32 @@ bool sendFile(int client, FileFd &data) { /*{{{*/
}
Success &= FileFd::Write(client, "\r\n", 2);
return Success;
-} /*}}}*/
-
-bool sendData(int client, std::string &data) { /*{{{*/
+}
+ /*}}}*/
+bool sendData(int const client, std::string const &data) { /*{{{*/
bool Success = true;
Success &= FileFd::Write(client, data.c_str(), data.size());
Success &= FileFd::Write(client, "\r\n", 2);
return Success;
-} /*}}}*/
-
-void sendError(int client, int httpcode, string request, bool content) { /*{{{*/
+}
+ /*}}}*/
+void sendError(int const client, int const httpcode, string const &request, bool content) { /*{{{*/
std::list headers;
- string response;
- if (content == true) {
- response.append("");
- response.append(httpcodeToStr(httpcode)).append("");
- response.append("").append(httpcodeToStr(httpcode)).append("
");
- response.append(request).append("");
- addDataHeaders(headers, response);
- }
+ string response("");
+ response.append(httpcodeToStr(httpcode)).append("");
+ response.append("").append(httpcodeToStr(httpcode)).append("
");
+ response.append(request).append("");
+ addDataHeaders(headers, response);
sendHead(client, httpcode, headers);
- sendData(client, response);
-} /*}}}*/
-
-int main(int argc, const char *argv[])
+ if (content == true)
+ sendData(client, response);
+}
+ /*}}}*/
+int main(int const argc, const char * argv[])
{
CommandLine::Args Args[] = {
- {0, "simulate-paywall", "aptwebserver::Simulate-Paywall",
+ {0, "simulate-paywall", "aptwebserver::Simulate-Paywall",
CommandLine::Boolean},
{0, "port", "aptwebserver::port", CommandLine::HasArg},
{0,0,0,0}
@@ -198,18 +196,19 @@ int main(int argc, const char *argv[])
}
listen(sock, 1);
+ /*}}}*/
std::vector messages;
int client;
while ((client = accept(sock, NULL, NULL)) != -1) {
std::clog << "ACCEPT client " << client
- << " on socket " << sock << std::endl;
+ << " on socket " << sock << std::endl;
while (ReadMessages(client, messages)) {
for (std::vector::const_iterator m = messages.begin();
m != messages.end(); ++m) {
- std::clog << ">>> REQUEST >>>>" << std::endl << *m
- << std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
+ std::clog << ">>> REQUEST >>>>" << std::endl << *m
+ << std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
std::list headers;
bool sendContent = true;
if (strncmp(m->c_str(), "HEAD ", 5) == 0)
@@ -227,12 +226,12 @@ int main(int argc, const char *argv[])
size_t const filestart = m->find(' ', 5);
string filename = m->substr(5, filestart - 5);
- if (simulate_broken_server == true) {
- string data("ni ni ni\n");
- addDataHeaders(headers, data);
- sendHead(client, 200, headers);
- sendData(client, data);
- }
+ if (simulate_broken_server == true) {
+ string data("ni ni ni\n");
+ addDataHeaders(headers, data);
+ sendHead(client, 200, headers);
+ sendData(client, data);
+ }
else if (RealFileExists(filename) == false)
sendError(client, 404, *m, sendContent);
else {
@@ -240,8 +239,8 @@ int main(int argc, const char *argv[])
std::string condition = LookupTag(*m, "If-Modified-Since", "");
if (condition.empty() == false) {
time_t cache;
- if (RFC1123StrToTime(condition.c_str(), cache) == true &&
- cache >= data.ModificationTime()) {
+ if (RFC1123StrToTime(condition.c_str(), cache) == true &&
+ cache >= data.ModificationTime()) {
sendError(client, 304, *m, false);
continue;
}
@@ -256,8 +255,8 @@ int main(int argc, const char *argv[])
messages.clear();
}
- std::clog << "CLOSE client " << client
- << " on socket " << sock << std::endl;
+ std::clog << "CLOSE client " << client
+ << " on socket " << sock << std::endl;
close(client);
}
return 0;
--
cgit v1.2.3
From d64053295c5544c62d7743c13bd415e42cf8f84d Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jul 2012 20:03:00 +0200
Subject: implement directory listing in your webserver
---
test/interactive-helper/aptwebserver.cc | 95 +++++++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 4 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 97a298c70..0b2720dad 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -12,11 +12,13 @@
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
char const * const httpcodeToStr(int const httpcode) { /*{{{*/
switch (httpcode) {
@@ -142,6 +144,86 @@ void sendError(int const client, int const httpcode, string const &request, bool
sendData(client, response);
}
/*}}}*/
+// sendDirectoryLisiting /*{{{*/
+int filter_hidden_files(const struct dirent *a) {
+ if (a->d_name[0] == '.')
+ return 0;
+#ifdef _DIRENT_HAVE_D_TYPE
+ // if we have the d_type check that only files and dirs will be included
+ if (a->d_type != DT_UNKNOWN &&
+ a->d_type != DT_REG &&
+ a->d_type != DT_LNK && // this includes links to regular files
+ a->d_type != DT_DIR)
+ return 0;
+#endif
+ return 1;
+}
+int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) {
+#ifdef _DIRENT_HAVE_D_TYPE
+ if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_DIR);
+ else if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_REG)
+ return -1;
+ else if ((*b)->d_type == DT_DIR && (*a)->d_type == DT_REG)
+ return 1;
+ else
+#endif
+ {
+ struct stat f_prop; //File's property
+ stat((*a)->d_name, &f_prop);
+ int const amode = f_prop.st_mode;
+ stat((*b)->d_name, &f_prop);
+ int const bmode = f_prop.st_mode;
+ if (S_ISDIR(amode) && S_ISDIR(bmode));
+ else if (S_ISDIR(amode))
+ return -1;
+ else if (S_ISDIR(bmode))
+ return 1;
+ }
+ return strcasecmp((*a)->d_name, (*b)->d_name);
+}
+void sendDirectoryListing(int const client, string const &dir, string const &request, bool content) {
+ std::list headers;
+ std::ostringstream listing;
+
+ struct dirent **namelist;
+ int const counter = scandir(dir.c_str(), &namelist, filter_hidden_files, grouped_alpha_case_sort);
+ if (counter == -1) {
+ sendError(client, 500, request, content);
+ return;
+ }
+
+ listing << "Index of " << dir << ""
+ << ""
+ << "" << std::endl
+ << "Index of " << dir << "
" << std::endl
+ << "# | Name | Size | Last-Modified |
" << std::endl;
+ if (dir != ".")
+ listing << "d | Parent Directory | - | - |
";
+ for (int i = 0; i < counter; ++i) {
+ struct stat fs;
+ std::string filename(dir);
+ filename.append("/").append(namelist[i]->d_name);
+ stat(filename.c_str(), &fs);
+ listing << "" << ((S_ISDIR(fs.st_mode)) ? 'd' : 'f') << " | "
+ << "d_name << "\">" << namelist[i]->d_name << " | ";
+ if (S_ISDIR(fs.st_mode))
+ listing << "- | ";
+ else
+ listing << "" << SizeToStr(fs.st_size) << "B | ";
+ listing << "" << TimeRFC1123(fs.st_mtime) << " |
" << std::endl;
+ }
+ listing << "
" << std::endl;
+
+ std::string response(listing.str());
+ addDataHeaders(headers, response);
+ sendHead(client, 200, headers);
+ if (content == true)
+ sendData(client, response);
+}
+ /*}}}*/
int main(int const argc, const char * argv[])
{
CommandLine::Args Args[] = {
@@ -225,6 +307,8 @@ int main(int const argc, const char * argv[])
size_t const filestart = m->find(' ', 5);
string filename = m->substr(5, filestart - 5);
+ if (filename.empty() == true)
+ filename = ".";
if (simulate_broken_server == true) {
string data("ni ni ni\n");
@@ -232,16 +316,14 @@ int main(int const argc, const char * argv[])
sendHead(client, 200, headers);
sendData(client, data);
}
- else if (RealFileExists(filename) == false)
- sendError(client, 404, *m, sendContent);
- else {
+ else if (RealFileExists(filename) == true) {
FileFd data(filename, FileFd::ReadOnly);
std::string condition = LookupTag(*m, "If-Modified-Since", "");
if (condition.empty() == false) {
time_t cache;
if (RFC1123StrToTime(condition.c_str(), cache) == true &&
cache >= data.ModificationTime()) {
- sendError(client, 304, *m, false);
+ sendHead(client, 304, headers);
continue;
}
}
@@ -250,6 +332,11 @@ int main(int const argc, const char * argv[])
if (sendContent == true)
sendFile(client, data);
}
+ else if (DirectoryExists(filename) == true) {
+ sendDirectoryListing(client, filename, *m, sendContent);
+ }
+ else
+ sendError(client, 404, *m, false);
}
_error->DumpErrors(std::cerr);
messages.clear();
--
cgit v1.2.3
From 4958ba98e66af264e1f03f5dbacc713e51cd437d Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jul 2012 20:05:05 +0200
Subject: include our usual config.h in the webserver
---
test/interactive-helper/aptwebserver.cc | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 0b2720dad..0780288a4 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -1,3 +1,5 @@
+#include
+
#include
#include
#include
@@ -88,7 +90,7 @@ void addDataHeaders(std::list &headers, std::string &data) {/*{{{*/
}
/*}}}*/
bool sendHead(int const client, int const httpcode, std::list &headers) { /*{{{*/
- string response("HTTP/1.1 ");
+ std::string response("HTTP/1.1 ");
response.append(httpcodeToStr(httpcode));
headers.push_front(response);
@@ -131,9 +133,9 @@ bool sendData(int const client, std::string const &data) { /*{{{*/
return Success;
}
/*}}}*/
-void sendError(int const client, int const httpcode, string const &request, bool content) { /*{{{*/
+void sendError(int const client, int const httpcode, std::string const &request, bool content) { /*{{{*/
std::list headers;
- string response("");
+ std::string response("");
response.append(httpcodeToStr(httpcode)).append("");
response.append("").append(httpcodeToStr(httpcode)).append("
");
@@ -181,7 +183,7 @@ int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) {
}
return strcasecmp((*a)->d_name, (*b)->d_name);
}
-void sendDirectoryListing(int const client, string const &dir, string const &request, bool content) {
+void sendDirectoryListing(int const client, std::string const &dir, std::string const &request, bool content) {
std::list headers;
std::ostringstream listing;
@@ -306,12 +308,12 @@ int main(int const argc, const char * argv[])
}
size_t const filestart = m->find(' ', 5);
- string filename = m->substr(5, filestart - 5);
+ std::string filename = m->substr(5, filestart - 5);
if (filename.empty() == true)
filename = ".";
if (simulate_broken_server == true) {
- string data("ni ni ni\n");
+ std::string data("ni ni ni\n");
addDataHeaders(headers, data);
sendHead(client, 200, headers);
sendData(client, data);
--
cgit v1.2.3
From 59fe94ea0135b1f8bc3d66e97460bd481054b061 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jul 2012 20:08:58 +0200
Subject: http get requests need to be dequoted
---
test/interactive-helper/aptwebserver.cc | 2 ++
1 file changed, 2 insertions(+)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 0780288a4..920ab3bcc 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -311,6 +311,8 @@ int main(int const argc, const char * argv[])
std::string filename = m->substr(5, filestart - 5);
if (filename.empty() == true)
filename = ".";
+ else
+ filename = DeQuoteString(filename);
if (simulate_broken_server == true) {
std::string data("ni ni ni\n");
--
cgit v1.2.3
From 64a28515923aa67a1d109a82aba1892cd227bb15 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 00:46:27 +0200
Subject: ensure that directories are accessed with a slash at the end of the
url
---
test/interactive-helper/aptwebserver.cc | 40 +++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 7 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 920ab3bcc..2052fe6d8 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -146,6 +146,26 @@ void sendError(int const client, int const httpcode, std::string const &request,
sendData(client, response);
}
/*}}}*/
+void sendRedirect(int const client, int const httpcode, std::string const &uri, std::string const &request, bool content) { /*{{{*/
+ std::list headers;
+ std::string response("");
+ response.append(httpcodeToStr(httpcode)).append("");
+ response.append("").append(httpcodeToStr(httpcode)).append("
You should be redirected to ").append(uri).append("
");
+ response.append("This page is a result of the request: ");
+ response.append(request).append("
");
+ addDataHeaders(headers, response);
+ std::string location("Location: ");
+ if (strncmp(uri.c_str(), "http://", 7) != 0)
+ location.append("http://").append(LookupTag(request, "Host")).append("/").append(uri);
+ else
+ location.append(uri);
+ headers.push_back(location);
+ sendHead(client, httpcode, headers);
+ if (content == true)
+ sendData(client, response);
+}
+ /*}}}*/
// sendDirectoryLisiting /*{{{*/
int filter_hidden_files(const struct dirent *a) {
if (a->d_name[0] == '.')
@@ -209,12 +229,15 @@ void sendDirectoryListing(int const client, std::string const &dir, std::string
std::string filename(dir);
filename.append("/").append(namelist[i]->d_name);
stat(filename.c_str(), &fs);
- listing << "" << ((S_ISDIR(fs.st_mode)) ? 'd' : 'f') << " | "
- << "d_name << "\">" << namelist[i]->d_name << " | ";
- if (S_ISDIR(fs.st_mode))
- listing << "- | ";
- else
- listing << "" << SizeToStr(fs.st_size) << "B | ";
+ if (S_ISDIR(fs.st_mode)) {
+ listing << "
d | "
+ << "d_name << "/\">" << namelist[i]->d_name << " | "
+ << "- | ";
+ } else {
+ listing << "
f | "
+ << "d_name << "\">" << namelist[i]->d_name << " | "
+ << "" << SizeToStr(fs.st_size) << "B | ";
+ }
listing << "" << TimeRFC1123(fs.st_mtime) << " |
" << std::endl;
}
listing << "" << std::endl;
@@ -337,7 +360,10 @@ int main(int const argc, const char * argv[])
sendFile(client, data);
}
else if (DirectoryExists(filename) == true) {
- sendDirectoryListing(client, filename, *m, sendContent);
+ if (filename == "." || filename[filename.length()-1] == '/')
+ sendDirectoryListing(client, filename, *m, sendContent);
+ else
+ sendRedirect(client, 301, filename.append("/"), *m, sendContent);
}
else
sendError(client, 404, *m, false);
--
cgit v1.2.3
From 3522b1a8f16f45cf9c0c45b8b86cc886f1368df4 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 10:39:51 +0200
Subject: do not hardcode /dev/null in changetowebserver so it can be changed
for debugging easily
---
test/integration/framework | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index d15fd0e01..965f984ca 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -688,30 +688,30 @@ signreleasefiles() {
}
changetowebserver() {
+ if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then
+ msgdie 'Need the aptwebserver when passing arguments'
+ fi
- if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then
- msgdie 'Need the aptwebserver when passing arguments'
- fi
-
+ local LOG='/dev/null'
if test -x ${BUILDDIRECTORY}/aptwebserver; then
cd aptarchive
- LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> /dev/null > /dev/null &
+ LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> $LOG > $LOG &
addtrap "kill $!;"
cd - > /dev/null
elif which weborf > /dev/null; then
- weborf -xb aptarchive/ 2>&1 > /dev/null &
+ weborf -xb aptarchive/ 2> $LOG > $LOG &
addtrap "kill $!;"
elif which gatling > /dev/null; then
cd aptarchive
- gatling -p 8080 -F -S 2>&1 > /dev/null &
+ gatling -p 8080 -F -S 2> $LOG > $LOG &
addtrap "kill $!;"
cd - > /dev/null
elif which lighttpd > /dev/null; then
echo "server.document-root = \"$(readlink -f ./aptarchive)\"
server.port = 8080
server.stat-cache-engine = \"disable\"" > lighttpd.conf
- lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
- lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
+ lighttpd -t -f lighttpd.conf 2> $LOG > $LOG || msgdie 'Can not change to webserver: our lighttpd config is invalid'
+ lighttpd -D -f lighttpd.conf 2> $LOG > $LOG &
addtrap "kill $!;"
else
msgdie 'You have to install weborf or lighttpd first'
--
cgit v1.2.3
From d37911acee3eb34368e6d9e6a0046c9150d2bce6 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 11:07:54 +0200
Subject: add simple url rewriting to the webserver
---
test/integration/skip-bug-602412-dequote-redirect | 38 -----------------------
test/integration/test-bug-602412-dequote-redirect | 29 +++++++++++++++++
test/interactive-helper/aptwebserver.cc | 19 ++++++++++--
3 files changed, 46 insertions(+), 40 deletions(-)
delete mode 100755 test/integration/skip-bug-602412-dequote-redirect
create mode 100755 test/integration/test-bug-602412-dequote-redirect
(limited to 'test')
diff --git a/test/integration/skip-bug-602412-dequote-redirect b/test/integration/skip-bug-602412-dequote-redirect
deleted file mode 100755
index 689b671ce..000000000
--- a/test/integration/skip-bug-602412-dequote-redirect
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-set -e
-
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
-setupenvironment
-configarchitecture 'i386'
-
-if ! which lighttpd > /dev/null; then
- msgdie 'You need lighttpd for this testcase, sorry…'
- exit 1
-fi
-
-buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
-
-setupaptarchive
-
-echo "server.modules = ( \"mod_redirect\" )
-server.document-root = \"$(readlink -f ./aptarchive)\"
-server.port = 8080
-server.stat-cache-engine = \"disable\"
-url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\",
- \"^/dists/(.*)$\" => \"/newdists/\$1\" )" > lighttpd.conf
-
-mv aptarchive/pool aptarchive/newpool
-mv aptarchive/dists aptarchive/newdists
-
-lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
-lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
-addtrap "kill $!;"
-
-APTARCHIVE="file://$(readlink -f ./aptarchive)"
-for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
- sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
-done
-
-aptget update || msgdie 'apt-get update failed'
-aptget install unrelated --download-only || msgdie 'downloading package failed'
diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect
new file mode 100755
index 000000000..f1e67c6d8
--- /dev/null
+++ b/test/integration/test-bug-602412-dequote-redirect
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
+
+setupaptarchive
+changetowebserver -o aptwebserver::redirect::replace::/pool/=/newpool/ \
+ -o aptwebserver::redirect::replace::/dists/=/newdists/
+
+mv aptarchive/pool aptarchive/newpool
+mv aptarchive/dists aptarchive/newdists
+
+msgtest 'Test redirection works in' 'apt-get update'
+aptget update -qq && msgpass || msgfail
+
+# check that I-M-S header is kept in redirections
+testequal 'Hit http://localhost unstable InRelease
+Hit http://localhost unstable/main Sources
+Hit http://localhost unstable/main amd64 Packages
+Hit http://localhost unstable/main Translation-en
+Reading package lists...' aptget update
+
+msgtest 'Test redirection works in' 'package download'
+aptget install unrelated --download-only -qq && msgpass || msgfail
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 2052fe6d8..7fa322ea9 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -137,7 +137,7 @@ void sendError(int const client, int const httpcode, std::string const &request,
std::list headers;
std::string response("");
response.append(httpcodeToStr(httpcode)).append("");
- response.append("").append(httpcodeToStr(httpcode)).append("
").append(httpcodeToStr(httpcode)).append("
");
response.append("This error is a result of the request: ");
response.append(request).append("
");
addDataHeaders(headers, response);
@@ -255,6 +255,8 @@ int main(int const argc, const char * argv[])
{0, "simulate-paywall", "aptwebserver::Simulate-Paywall",
CommandLine::Boolean},
{0, "port", "aptwebserver::port", CommandLine::HasArg},
+ {'c',"config-file",0,CommandLine::ConfigFile},
+ {'o',"option",0,CommandLine::ArbItem},
{0,0,0,0}
};
@@ -366,7 +368,20 @@ int main(int const argc, const char * argv[])
sendRedirect(client, 301, filename.append("/"), *m, sendContent);
}
else
- sendError(client, 404, *m, false);
+ {
+ ::Configuration::Item const *Replaces = _config->Tree("aptwebserver::redirect::replace");
+ if (Replaces != NULL) {
+ std::string redirect = "/" + filename;
+ for (::Configuration::Item *I = Replaces->Child; I != NULL; I = I->Next)
+ redirect = SubstVar(redirect, I->Tag, I->Value);
+ redirect.erase(0,1);
+ if (redirect != filename) {
+ sendRedirect(client, 301, redirect, *m, sendContent);
+ continue;
+ }
+ }
+ sendError(client, 404, *m, sendContent);
+ }
}
_error->DumpErrors(std::cerr);
messages.clear();
--
cgit v1.2.3
From 7a1bed9d453379fcd22489bdb9f81f377abcaae2 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 17:11:26 +0200
Subject: rework parsing of the first request-line to be more robust
---
test/interactive-helper/aptwebserver.cc | 106 ++++++++++++++++++++++----------
1 file changed, 75 insertions(+), 31 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 7fa322ea9..4746aed96 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -51,24 +51,24 @@ char const * const httpcodeToStr(int const httpcode) { /*{{{*/
case 404: return "404 Not Found";
case 405: return "405 Method Not Allowed";
case 406: return "406 Not Acceptable";
- case 407: return "Proxy Authentication Required";
- case 408: return "Request Time-out";
- case 409: return "Conflict";
- case 410: return "Gone";
- case 411: return "Length Required";
- case 412: return "Precondition Failed";
- case 413: return "Request Entity Too Large";
- case 414: return "Request-URI Too Large";
- case 415: return "Unsupported Media Type";
- case 416: return "Requested range not satisfiable";
- case 417: return "Expectation Failed";
+ case 407: return "407 Proxy Authentication Required";
+ case 408: return "408 Request Time-out";
+ case 409: return "409 Conflict";
+ case 410: return "410 Gone";
+ case 411: return "411 Length Required";
+ case 412: return "412 Precondition Failed";
+ case 413: return "413 Request Entity Too Large";
+ case 414: return "414 Request-URI Too Large";
+ case 415: return "415 Unsupported Media Type";
+ case 416: return "416 Requested range not satisfiable";
+ case 417: return "417 Expectation Failed";
// Server error 5xx
- case 500: return "Internal Server Error";
- case 501: return "Not Implemented";
- case 502: return "Bad Gateway";
- case 503: return "Service Unavailable";
- case 504: return "Gateway Time-out";
- case 505: return "HTTP Version not supported";
+ case 500: return "500 Internal Server Error";
+ case 501: return "501 Not Implemented";
+ case 502: return "502 Bad Gateway";
+ case 503: return "503 Service Unavailable";
+ case 504: return "504 Gateway Time-out";
+ case 505: return "505 HTTP Version not supported";
}
return NULL;
}
@@ -133,11 +133,13 @@ bool sendData(int const client, std::string const &data) { /*{{{*/
return Success;
}
/*}}}*/
-void sendError(int const client, int const httpcode, std::string const &request, bool content) { /*{{{*/
+void sendError(int const client, int const httpcode, std::string const &request, bool content, std::string const &error = "") { /*{{{*/
std::list headers;
std::string response("");
response.append(httpcodeToStr(httpcode)).append("");
response.append("").append(httpcodeToStr(httpcode)).append("
");
+ if (error.empty() == false)
+ response.append("Error: ").append(error).append("
");
response.append("This error is a result of the request: ");
response.append(request).append("
");
addDataHeaders(headers, response);
@@ -249,6 +251,55 @@ void sendDirectoryListing(int const client, std::string const &dir, std::string
sendData(client, response);
}
/*}}}*/
+bool parseFirstLine(int const client, std::string const &request, std::string &filename, bool &sendContent) { /*{{{*/
+ if (strncmp(request.c_str(), "HEAD ", 5) == 0)
+ sendContent = false;
+ if (strncmp(request.c_str(), "GET ", 4) != 0)
+ {
+ sendError(client, 501, request, true);
+ return false;
+ }
+
+ size_t const lineend = request.find('\n');
+ size_t filestart = request.find(' ');
+ for (; request[filestart] == ' '; ++filestart);
+ size_t fileend = request.rfind(' ', lineend);
+ if (lineend == std::string::npos || filestart == std::string::npos ||
+ fileend == std::string::npos || filestart == fileend) {
+ sendError(client, 500, request, sendContent, "Filename can't be extracted");
+ return false;
+ }
+
+ size_t httpstart = fileend;
+ for (; request[httpstart] == ' '; ++httpstart);
+ if (strncmp(request.c_str() + httpstart, "HTTP/1.1\r", 9) != 0) {
+ sendError(client, 500, request, sendContent, "Not an HTTP/1.1 request");
+ return false;
+ }
+
+ filename = request.substr(filestart, fileend - filestart);
+ if (filename.find(' ') != std::string::npos) {
+ sendError(client, 500, request, sendContent, "Filename contains an unencoded space");
+ return false;
+ }
+ filename = DeQuoteString(filename);
+
+ // this is not a secure server, but at least prevent the obvious …
+ if (filename.empty() == true || filename[0] != '/' ||
+ strncmp(filename.c_str(), "//", 2) == 0 ||
+ filename.find_first_of("\r\n\t\f\v") != std::string::npos ||
+ filename.find("/../") != std::string::npos) {
+ sendError(client, 400, request, sendContent, "Filename contains illegal character (sequence)");
+ return false;
+ }
+
+ // nuke the first character which is a / as we assured above
+ filename.erase(0, 1);
+ if (filename.empty() == true)
+ filename = ".";
+ return true;
+}
+ /*}}}*/
int main(int const argc, const char * argv[])
{
CommandLine::Args Args[] = {
@@ -318,27 +369,20 @@ int main(int const argc, const char * argv[])
m != messages.end(); ++m) {
std::clog << ">>> REQUEST >>>>" << std::endl << *m
<< std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
+
std::list headers;
+ std::string filename;
bool sendContent = true;
- if (strncmp(m->c_str(), "HEAD ", 5) == 0)
- sendContent = false;
- if (strncmp(m->c_str(), "GET ", 4) != 0)
- sendError(client, 501, *m, true);
+ if (parseFirstLine(client, *m, filename, sendContent) == false)
+ continue;
std::string host = LookupTag(*m, "Host", "");
if (host.empty() == true) {
- // RFC 2616 §14.23 Host
- sendError(client, 400, *m, sendContent);
+ // RFC 2616 §14.23 requires Host
+ sendError(client, 400, *m, sendContent, "Host header is required");
continue;
}
- size_t const filestart = m->find(' ', 5);
- std::string filename = m->substr(5, filestart - 5);
- if (filename.empty() == true)
- filename = ".";
- else
- filename = DeQuoteString(filename);
-
if (simulate_broken_server == true) {
std::string data("ni ni ni\n");
addDataHeaders(headers, data);
--
cgit v1.2.3
From 57d13de2fb64a97d1a43d493c253ad2132ffd566 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 18:43:53 +0200
Subject: make the server a little more robust against write errors (e.g.
broken pipe)
---
test/interactive-helper/aptwebserver.cc | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 4746aed96..dbc4a19e0 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
char const * const httpcodeToStr(int const httpcode) { /*{{{*/
switch (httpcode) {
@@ -105,10 +106,12 @@ bool sendHead(int const client, int const httpcode, std::list &head
for (std::list::const_iterator h = headers.begin();
Success == true && h != headers.end(); ++h) {
Success &= FileFd::Write(client, h->c_str(), h->size());
- Success &= FileFd::Write(client, "\r\n", 2);
+ if (Success == true)
+ Success &= FileFd::Write(client, "\r\n", 2);
std::clog << *h << std::endl;
}
- Success &= FileFd::Write(client, "\r\n", 2);
+ if (Success == true)
+ Success &= FileFd::Write(client, "\r\n", 2);
std::clog << "<<<<<<<<<<<<<<<<" << std::endl;
return Success;
}
@@ -122,14 +125,16 @@ bool sendFile(int const client, FileFd &data) { /*{{{*/
break;
Success &= FileFd::Write(client, buffer, actual);
}
- Success &= FileFd::Write(client, "\r\n", 2);
+ if (Success == true)
+ Success &= FileFd::Write(client, "\r\n", 2);
return Success;
}
/*}}}*/
bool sendData(int const client, std::string const &data) { /*{{{*/
bool Success = true;
Success &= FileFd::Write(client, data.c_str(), data.size());
- Success &= FileFd::Write(client, "\r\n", 2);
+ if (Success == true)
+ Success &= FileFd::Write(client, "\r\n", 2);
return Success;
}
/*}}}*/
@@ -318,6 +323,8 @@ int main(int const argc, const char * argv[])
}
// create socket, bind and listen to it {{{
+ // ignore SIGPIPE, this can happen on write() if the socket closes connection
+ signal(SIGPIPE, SIG_IGN);
int sock = socket(AF_INET6, SOCK_STREAM, 0);
if(sock < 0 ) {
_error->Errno("aptwerbserver", "Couldn't create socket");
--
cgit v1.2.3
From 06b3095f81d9a730e8cb95274c8208cb0604cdfe Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Wed, 11 Jul 2012 19:11:24 +0200
Subject: add option to send Content-Type based on file extension
---
test/interactive-helper/aptwebserver.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index dbc4a19e0..4ef9631b8 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -82,6 +82,18 @@ void addFileHeaders(std::list &headers, FileFd &data) { /*{{{*/
std::string lastmodified("Last-Modified: ");
lastmodified.append(TimeRFC1123(data.ModificationTime()));
headers.push_back(lastmodified);
+
+ std::string const fileext = flExtension(data.Name());
+ if (fileext.empty() == false && fileext != data.Name()) {
+ std::string confcontenttype("aptwebserver::ContentType::");
+ confcontenttype.append(fileext);
+ std::string const contenttype = _config->Find(confcontenttype);
+ if (contenttype.empty() == false) {
+ std::string header("Content-Type: ");
+ header.append(contenttype);
+ headers.push_back(header);
+ }
+ }
}
/*}}}*/
void addDataHeaders(std::list &headers, std::string &data) {/*{{{*/
--
cgit v1.2.3
From 056c36565706cad136df288db777c01555f4ecd9 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 12 Jul 2012 12:04:36 +0200
Subject: add (partial) partial request support for the webserver
---
test/interactive-helper/aptwebserver.cc | 71 +++++++++++++++++++++++++++++----
1 file changed, 63 insertions(+), 8 deletions(-)
(limited to 'test')
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 4ef9631b8..ff60d64a3 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -35,7 +35,7 @@ char const * const httpcodeToStr(int const httpcode) { /*{{{*/
case 203: return "203 Non-Authoritative Information";
case 204: return "204 No Content";
case 205: return "205 Reset Content";
- case 206: return "206 Partial Conent";
+ case 206: return "206 Partial Content";
// Redirections 3xx
case 300: return "300 Multiple Choices";
case 301: return "301 Moved Permanently";
@@ -113,6 +113,8 @@ bool sendHead(int const client, int const httpcode, std::list &head
date.append(TimeRFC1123(time(NULL)));
headers.push_back(date);
+ headers.push_back("Accept-Ranges: bytes");
+
std::clog << ">>> RESPONSE >>>" << std::endl;
bool Success = true;
for (std::list::const_iterator h = headers.begin();
@@ -135,7 +137,8 @@ bool sendFile(int const client, FileFd &data) { /*{{{*/
while ((Success &= data.Read(buffer, sizeof(buffer), &actual)) == true) {
if (actual == 0)
break;
- Success &= FileFd::Write(client, buffer, actual);
+ if (Success == true)
+ Success &= FileFd::Write(client, buffer, actual);
}
if (Success == true)
Success &= FileFd::Write(client, "\r\n", 2);
@@ -268,7 +271,7 @@ void sendDirectoryListing(int const client, std::string const &dir, std::string
sendData(client, response);
}
/*}}}*/
-bool parseFirstLine(int const client, std::string const &request, std::string &filename, bool &sendContent) { /*{{{*/
+bool parseFirstLine(int const client, std::string const &request, std::string &filename, bool &sendContent, bool &closeConnection) { /*{{{*/
if (strncmp(request.c_str(), "HEAD ", 5) == 0)
sendContent = false;
if (strncmp(request.c_str(), "GET ", 4) != 0)
@@ -289,8 +292,12 @@ bool parseFirstLine(int const client, std::string const &request, std::string &f
size_t httpstart = fileend;
for (; request[httpstart] == ' '; ++httpstart);
- if (strncmp(request.c_str() + httpstart, "HTTP/1.1\r", 9) != 0) {
- sendError(client, 500, request, sendContent, "Not an HTTP/1.1 request");
+ if (strncmp(request.c_str() + httpstart, "HTTP/1.1\r", 9) == 0)
+ closeConnection = strcasecmp(LookupTag(request, "Connection", "Keep-Alive").c_str(), "Keep-Alive") != 0;
+ else if (strncmp(request.c_str() + httpstart, "HTTP/1.0\r", 9) == 0)
+ closeConnection = strcasecmp(LookupTag(request, "Connection", "Keep-Alive").c_str(), "close") == 0;
+ else {
+ sendError(client, 500, request, sendContent, "Not an HTTP/1.{0,1} request");
return false;
}
@@ -384,15 +391,15 @@ int main(int const argc, const char * argv[])
<< " on socket " << sock << std::endl;
while (ReadMessages(client, messages)) {
+ bool closeConnection = false;
for (std::vector::const_iterator m = messages.begin();
- m != messages.end(); ++m) {
+ m != messages.end() && closeConnection == false; ++m) {
std::clog << ">>> REQUEST >>>>" << std::endl << *m
<< std::endl << "<<<<<<<<<<<<<<<<" << std::endl;
-
std::list headers;
std::string filename;
bool sendContent = true;
- if (parseFirstLine(client, *m, filename, sendContent) == false)
+ if (parseFirstLine(client, *m, filename, sendContent, closeConnection) == false)
continue;
std::string host = LookupTag(*m, "Host", "");
@@ -419,6 +426,52 @@ int main(int const argc, const char * argv[])
continue;
}
}
+ condition = LookupTag(*m, "If-Range", "");
+ bool ignoreRange = false;
+ if (condition.empty() == false) {
+ time_t cache;
+ if (RFC1123StrToTime(condition.c_str(), cache) == false ||
+ cache < data.ModificationTime())
+ ignoreRange = true;
+ }
+ condition = LookupTag(*m, "Range", "");
+ if (ignoreRange == false && condition.empty() == false &&
+ strncmp(condition.c_str(), "bytes=", 6) == 0) {
+ size_t end = condition.find(',');
+ // FIXME: support multiple byte-ranges
+ if (end == std::string::npos) {
+ size_t start = 6;
+ unsigned long long filestart = strtoull(condition.c_str() + start, NULL, 10);
+ // FIXME: no fileend support
+ size_t dash = condition.find('-') + 1;
+ unsigned long long fileend = strtoull(condition.c_str() + dash, NULL, 10);
+ unsigned long long filesize = data.FileSize();
+ if (fileend == 0 || fileend == filesize) {
+ if (filesize > filestart) {
+ data.Skip(filestart);
+ std::ostringstream contentlength;
+ contentlength << "Content-Length: " << (filesize - filestart);
+ headers.push_back(contentlength.str());
+ std::ostringstream contentrange;
+ contentrange << "Content-Range: bytes " << filestart << "-"
+ << filesize - 1 << "/" << filesize;
+ headers.push_back(contentrange.str());
+ sendHead(client, 206, headers);
+ if (sendContent == true)
+ sendFile(client, data);
+ continue;
+ } else {
+ headers.push_back("Content-Length: 0");
+ std::ostringstream contentrange;
+ contentrange << "Content-Range: bytes 0-0/" << filesize;
+ headers.push_back(contentrange.str());
+ sendHead(client, 416, headers);
+ continue;
+ }
+ }
+ }
+ }
+
addFileHeaders(headers, data);
sendHead(client, 200, headers);
if (sendContent == true)
@@ -448,6 +501,8 @@ int main(int const argc, const char * argv[])
}
_error->DumpErrors(std::cerr);
messages.clear();
+ if (closeConnection == true)
+ break;
}
std::clog << "CLOSE client " << client
--
cgit v1.2.3
From 8d01b9d692f49309235e710b79937baf605fda3d Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 4 Sep 2012 12:21:29 +0200
Subject: add "Glob()" to fileutl
---
test/libapt/fileutl_test.cc | 42 ++++++++++++++++++++++++++++++++++++++++++
test/libapt/makefile | 6 ++++++
2 files changed, 48 insertions(+)
create mode 100644 test/libapt/fileutl_test.cc
(limited to 'test')
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
new file mode 100644
index 000000000..b6b8ac579
--- /dev/null
+++ b/test/libapt/fileutl_test.cc
@@ -0,0 +1,42 @@
+#include
+#include
+
+#include "assert.h"
+#include
+#include
+
+#include
+#include
+#include
+
+
+int main(int argc,char *argv[])
+{
+ std::vector files;
+
+ // normal match
+ files = Glob("*.lst");
+ if (files.size() != 1)
+ {
+ _error->DumpErrors();
+ return 1;
+ }
+
+ // not there
+ files = Glob("xxxyyyzzz");
+ if (files.size() != 0 || _error->PendingError())
+ {
+ _error->DumpErrors();
+ return 1;
+ }
+
+ // many matches (number is a bit random)
+ files = Glob("*.cc");
+ if (files.size() < 10)
+ {
+ _error->DumpErrors();
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/test/libapt/makefile b/test/libapt/makefile
index 1952051e2..1e3652e00 100644
--- a/test/libapt/makefile
+++ b/test/libapt/makefile
@@ -80,3 +80,9 @@ PROGRAM = CdromFindPackages${BASENAME}
SLIBS = -lapt-pkg
SOURCE = cdromfindpackages_test.cc
include $(PROGRAM_H)
+
+# test fileutls
+PROGRAM = FileUtl${BASENAME}
+SLIBS = -lapt-pkg
+SOURCE = fileutl_test.cc
+include $(PROGRAM_H)
--
cgit v1.2.3
From d016834e39f668449385b1668240bdf905d62ade Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 28 Sep 2012 14:43:39 +0200
Subject: add new ClearAll
---
test/libapt/configuration_test.cc | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'test')
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 9a3e2c118..5ec48834a 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -80,6 +80,10 @@ int main(int argc,const char *argv[]) {
equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+ Cnf.Set("Moo::Bar", "1");
+ Cnf.ClearAll();
+ equals(Cnf.Find("Moo::Bar"), "");
+
//FIXME: Test for configuration file parsing;
// currently only integration/ tests test them implicitly
--
cgit v1.2.3
From 62b66f2593293aea5b42185fd2a2eb9d6e4d0cf2 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 1 Oct 2012 15:05:43 +0200
Subject: rename CleaAll() -> Clear()
---
test/libapt/configuration_test.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 5ec48834a..5120e86c9 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -81,7 +81,7 @@ int main(int argc,const char *argv[]) {
equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
Cnf.Set("Moo::Bar", "1");
- Cnf.ClearAll();
+ Cnf.Clear();
equals(Cnf.Find("Moo::Bar"), "");
//FIXME: Test for configuration file parsing;
--
cgit v1.2.3
From 30c54ac89ce01b93b42a9a37d3edd9837d0f34bb Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 31 Jan 2013 06:27:20 +0100
Subject: test/integration/test-debsrc-hashes: add integration test, thanks to
Daniel Hartwig
---
test/integration/test-debsrc-hashes | 77 +++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
create mode 100755 test/integration/test-debsrc-hashes
(limited to 'test')
diff --git a/test/integration/test-debsrc-hashes b/test/integration/test-debsrc-hashes
new file mode 100755
index 000000000..5e917232b
--- /dev/null
+++ b/test/integration/test-debsrc-hashes
@@ -0,0 +1,77 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+# pkg-sha256-bad has a bad SHA sum, but good MD5 sum. If apt is
+# checking the best available hash (as it should), this will trigger
+# a hash mismatch.
+
+cat > aptarchive/Sources <
+Architecture: i386
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.tar.gz
+
+Package: pkg-sha256-ok
+Binary: pkg-sha256-ok
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: i386
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.tar.gz
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.tar.gz
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.tar.gz
+
+Package: pkg-sha256-bad
+Binary: pkg-sha256-bad
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: i386
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.tar.gz
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.tar.gz
+Checksums-Sha256:
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.dsc
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.tar.gz
+EOF
+
+# create fetchable files
+for x in "pkg-md5-ok" "pkg-sha256-ok" "pkg-sha256-bad"; do
+ touch aptarchive/${x}_1.0.dsc
+ touch aptarchive/${x}_1.0.tar.gz
+done
+
+testok() {
+ msgtest "Test for hash ok of" "$*"
+ $* 2>&1 | grep "Download complete" > /dev/null && msgpass || msgfail
+}
+
+testmismatch() {
+ msgtest "Test for hash mismatch of" "$*"
+ $* 2>&1 | grep "Hash Sum mismatch" > /dev/null && msgpass || msgfail
+}
+
+setupaptarchive
+changetowebserver
+aptget update -qq
+
+testok aptget source -d pkg-md5-ok
+testok aptget source -d pkg-sha256-ok
+testmismatch aptget source -d pkg-sha256-bad
--
cgit v1.2.3
From ce928105d7279c5604f034740b04dc6a745fb859 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 4 Apr 2014 14:30:17 +0200
Subject: Implement CacheDB for source packages in apt-ftparchive
---
test/integration/framework | 5 +-
test/integration/test-apt-ftparchive | 164 +++++++++++++++++++++++++++++++++++
2 files changed, 168 insertions(+), 1 deletion(-)
create mode 100755 test/integration/test-apt-ftparchive
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 1c6f041b0..fae21eac4 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -128,7 +128,10 @@ dpkgcheckbuilddeps() {
}
gdb() {
echo "gdb: run »$*«"
- APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${LIBRARYPATH} command gdb ${BUILDDIRECTORY}/$1 --args "$@"
+ CMD="$1"
+ shift
+
+ APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${LIBRARYPATH} command gdb ${BUILDDIRECTORY}/$CMD --args ${BUILDDIRECTORY}/$CMD "$@"
}
gpg() {
# see apt-key for the whole trickery. Setup is done in setupenvironment
diff --git a/test/integration/test-apt-ftparchive b/test/integration/test-apt-ftparchive
new file mode 100755
index 000000000..b05c15c47
--- /dev/null
+++ b/test/integration/test-apt-ftparchive
@@ -0,0 +1,164 @@
+#!/bin/sh
+set -e
+
+assert_correct_sources_file() {
+ testequal "Package: bar
+Binary: bar
+Version: 1.0
+Architecture: all
+Format: 3.0 (native)
+Directory: pool/main
+Files:
+ 7b57dd065e51de5905288a5104d4bef5 406 bar_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 bar_1.0.tar.gz
+Package-List:
+ bar deb admin extra
+Checksums-Sha1:
+ 17a40b76715f393ab7fd6485c9392a02f1adf903 406 bar_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 bar_1.0.tar.gz
+Checksums-Sha256:
+ d9d7507f66a89258b6920aca47747d7a30e0e64b09ecabbf02b2efbdabf840a9 406 bar_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 bar_1.0.tar.gz
+Checksums-Sha512:
+ ee0a9bfb6614159b45203fc29487d4f37387993ca0e6d6f27b80010498f3731d75753188ece307508ae9af0259bd11a6af15a1a38f0b87dbd5ea1273b7a7d53e 406 bar_1.0.dsc
+ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
+
+Package: foo
+Binary: foo
+Version: 1.0
+Architecture: all
+Format: 3.0 (native)
+Directory: pool/main
+Files:
+ d144826e6f02831c1933e910c92cd7e0 171 foo_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 foo_1.0.tar.gz
+Package-List:
+ foo deb admin extra
+Checksums-Sha1:
+ 979306aa3ccff3d61bba062bb6977e2493c6f907 171 foo_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 foo_1.0.tar.gz
+Checksums-Sha256:
+ 8c780af8b5a6d5b3c2e2f9518940beebea52ac6d6ad7b52c082dc925cfe5b532 171 foo_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 foo_1.0.tar.gz
+Checksums-Sha512:
+ 3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
+ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
+" cat ./aptarchive/dists/test/main/source/Sources
+}
+
+create_source_files() {
+ NAME="$1"
+ REQUEST_CLEARSIGN="$2"
+
+ TARFILE="aptarchive/pool/main/${NAME}_1.0.tar.gz"
+ DSC_FILE="aptarchive/pool/main/${NAME}_1.0.dsc"
+ touch $TARFILE
+ if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
+ printf -- "-----BEGIN PGP SIGNED MESSAGE-----\n\n" > $DSC_FILE
+ fi
+ cat >> $DSC_FILE << EOF
+Format: 3.0 (native)
+Source: $NAME
+Binary: $NAME
+Architecture: all
+Version: 1.0
+Package-List:
+ $NAME deb admin extra
+Files:
+ $(md5sum $TARFILE|cut -f1 -d' ') $(stat --print="%s" $TARFILE) ${NAME}_1.0.tar.gz
+EOF
+ if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
+ cat >> $DSC_FILE < apt-ftparchive.conf <<"EOF"
+Dir {
+ ArchiveDir "./aptarchive";
+ OverrideDir "./aptarchive-overrides";
+ CacheDir "./aptarchive-cache";
+};
+
+Default {
+ Packages::Compress ". gzip bzip2";
+ Contents::Compress ". gzip bzip2";
+ LongDescription "false";
+};
+
+TreeDefault {
+ BinCacheDB "packages-$(SECTION)-$(ARCH).db";
+ SrcCacheDB "sources-$(SECTION).db";
+
+ Directory "pool/$(SECTION)";
+ SrcDirectory "pool/$(SECTION)";
+
+ Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
+ Sources "$(DIST)/$(SECTION)/source/Sources";
+ Contents "$(DIST)/Contents-$(ARCH)";
+};
+
+Tree "dists/test" {
+ Sections "main";
+ Architectures "source";
+
+};
+EOF
+
+
+# generate (no cachedb)
+aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testequal " Misses in Cache: 2" grep Misses stats-out.txt
+assert_correct_sources_file
+
+
+# generate again out of the cache
+rm -f ./aptarchive/dists/test/main/source/Sources
+aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testequal " Misses in Cache: 0" grep Misses stats-out.txt
+assert_correct_sources_file
+
+# generate invalid files
+mkdir aptarchive/pool/invalid
+printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
+testequal "
+E: Could not find a Source entry in the DSC 'aptarchive/pool/invalid/invalid_1.0.dsc'" aptftparchive sources aptarchive/pool/invalid
+rm -f aptarchive/pool/invalid/invalid_1.0.dsc
+
+dd if=/dev/zero of="aptarchive/pool/invalid/toobig_1.0.dsc" bs=1k count=129 2>/dev/null
+testequal "
+E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchive sources aptarchive/pool/invalid
+
+
--
cgit v1.2.3
From 0a3b93fc3da95c5cbeb18b2d92738cbd50e95d83 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 4 Apr 2014 15:36:42 +0200
Subject: add test for binary cachedb and contents generation
---
test/integration/test-apt-ftparchive | 164 -----------------------
test/integration/test-apt-ftparchive-cachedb | 93 +++++++++++++
test/integration/test-apt-ftparchive-src-cachedb | 162 ++++++++++++++++++++++
3 files changed, 255 insertions(+), 164 deletions(-)
delete mode 100755 test/integration/test-apt-ftparchive
create mode 100755 test/integration/test-apt-ftparchive-cachedb
create mode 100755 test/integration/test-apt-ftparchive-src-cachedb
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive b/test/integration/test-apt-ftparchive
deleted file mode 100755
index b05c15c47..000000000
--- a/test/integration/test-apt-ftparchive
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/bin/sh
-set -e
-
-assert_correct_sources_file() {
- testequal "Package: bar
-Binary: bar
-Version: 1.0
-Architecture: all
-Format: 3.0 (native)
-Directory: pool/main
-Files:
- 7b57dd065e51de5905288a5104d4bef5 406 bar_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 bar_1.0.tar.gz
-Package-List:
- bar deb admin extra
-Checksums-Sha1:
- 17a40b76715f393ab7fd6485c9392a02f1adf903 406 bar_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 bar_1.0.tar.gz
-Checksums-Sha256:
- d9d7507f66a89258b6920aca47747d7a30e0e64b09ecabbf02b2efbdabf840a9 406 bar_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 bar_1.0.tar.gz
-Checksums-Sha512:
- ee0a9bfb6614159b45203fc29487d4f37387993ca0e6d6f27b80010498f3731d75753188ece307508ae9af0259bd11a6af15a1a38f0b87dbd5ea1273b7a7d53e 406 bar_1.0.dsc
- cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
-
-Package: foo
-Binary: foo
-Version: 1.0
-Architecture: all
-Format: 3.0 (native)
-Directory: pool/main
-Files:
- d144826e6f02831c1933e910c92cd7e0 171 foo_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 foo_1.0.tar.gz
-Package-List:
- foo deb admin extra
-Checksums-Sha1:
- 979306aa3ccff3d61bba062bb6977e2493c6f907 171 foo_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 foo_1.0.tar.gz
-Checksums-Sha256:
- 8c780af8b5a6d5b3c2e2f9518940beebea52ac6d6ad7b52c082dc925cfe5b532 171 foo_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 foo_1.0.tar.gz
-Checksums-Sha512:
- 3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
- cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
-" cat ./aptarchive/dists/test/main/source/Sources
-}
-
-create_source_files() {
- NAME="$1"
- REQUEST_CLEARSIGN="$2"
-
- TARFILE="aptarchive/pool/main/${NAME}_1.0.tar.gz"
- DSC_FILE="aptarchive/pool/main/${NAME}_1.0.dsc"
- touch $TARFILE
- if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
- printf -- "-----BEGIN PGP SIGNED MESSAGE-----\n\n" > $DSC_FILE
- fi
- cat >> $DSC_FILE << EOF
-Format: 3.0 (native)
-Source: $NAME
-Binary: $NAME
-Architecture: all
-Version: 1.0
-Package-List:
- $NAME deb admin extra
-Files:
- $(md5sum $TARFILE|cut -f1 -d' ') $(stat --print="%s" $TARFILE) ${NAME}_1.0.tar.gz
-EOF
- if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
- cat >> $DSC_FILE < apt-ftparchive.conf <<"EOF"
-Dir {
- ArchiveDir "./aptarchive";
- OverrideDir "./aptarchive-overrides";
- CacheDir "./aptarchive-cache";
-};
-
-Default {
- Packages::Compress ". gzip bzip2";
- Contents::Compress ". gzip bzip2";
- LongDescription "false";
-};
-
-TreeDefault {
- BinCacheDB "packages-$(SECTION)-$(ARCH).db";
- SrcCacheDB "sources-$(SECTION).db";
-
- Directory "pool/$(SECTION)";
- SrcDirectory "pool/$(SECTION)";
-
- Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
- Sources "$(DIST)/$(SECTION)/source/Sources";
- Contents "$(DIST)/Contents-$(ARCH)";
-};
-
-Tree "dists/test" {
- Sections "main";
- Architectures "source";
-
-};
-EOF
-
-
-# generate (no cachedb)
-aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
-testequal " Misses in Cache: 2" grep Misses stats-out.txt
-assert_correct_sources_file
-
-
-# generate again out of the cache
-rm -f ./aptarchive/dists/test/main/source/Sources
-aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
-testequal " Misses in Cache: 0" grep Misses stats-out.txt
-assert_correct_sources_file
-
-# generate invalid files
-mkdir aptarchive/pool/invalid
-printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
-testequal "
-E: Could not find a Source entry in the DSC 'aptarchive/pool/invalid/invalid_1.0.dsc'" aptftparchive sources aptarchive/pool/invalid
-rm -f aptarchive/pool/invalid/invalid_1.0.dsc
-
-dd if=/dev/zero of="aptarchive/pool/invalid/toobig_1.0.dsc" bs=1k count=129 2>/dev/null
-testequal "
-E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchive sources aptarchive/pool/invalid
-
-
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
new file mode 100755
index 000000000..2a3bfce99
--- /dev/null
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -0,0 +1,93 @@
+#!/bin/sh
+set -e
+
+ensure_correct_packages_file() {
+ testequal "Package: foo
+Priority: optional
+Section: others
+Installed-Size: 29
+Maintainer: Joe Sixpack
+Architecture: i386
+Version: 1
+Filename: pool/main/foo_1_i386.deb" head -n8 ./aptarchive/dists/test/main/binary-i386/Packages
+}
+
+ensure_correct_contents_file() {
+ testequal "usr/bin/foo-i386 others/foo
+usr/share/doc/foo/FEATURES others/foo
+usr/share/doc/foo/changelog others/foo
+usr/share/doc/foo/copyright others/foo" cat ./aptarchive/dists/test/Contents-i386
+}
+
+#
+# main()
+#
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+mkdir -p aptarchive/dists/test/main/i18n/
+mkdir -p aptarchive/dists/test/main/source/
+mkdir -p aptarchive/dists/test/main/binary-i386
+mkdir -p aptarchive/pool/main
+
+mkdir aptarchive-overrides
+mkdir aptarchive-cache
+cat > ftparchive.conf <<"EOF"
+Dir {
+ ArchiveDir "./aptarchive";
+ OverrideDir "./aptarchive-overrides";
+ CacheDir "./aptarchive-cache";
+};
+
+Default {
+ Packages::Compress ". gzip bzip2";
+ Contents::Compress ". gzip bzip2";
+ LongDescription "false";
+};
+
+TreeDefault {
+ BinCacheDB "packages-$(SECTION)-$(ARCH).db";
+
+ Directory "pool/$(SECTION)";
+ SrcDirectory "pool/$(SECTION)";
+
+ Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
+ Contents "$(DIST)/Contents-$(ARCH)";
+};
+
+Tree "dists/test" {
+ Sections "main";
+ Architectures "i386";
+
+};
+EOF
+
+# build one pacakge
+buildsimplenativepackage 'foo' 'i386' '1' 'test'
+mv incoming/* aptarchive/pool/main/
+
+# generate (empty cachedb)
+aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+ensure_correct_packages_file
+ensure_correct_contents_file
+testequal " Misses in Cache: 2
+ dists/test/Contents-i386: New 402 B Misses in Cache: 0" grep Misses stats-out.txt
+
+# generate again
+aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+ensure_correct_packages_file
+ensure_correct_contents_file
+testequal " Misses in Cache: 0
+ dists/test/Contents-i386: Misses in Cache: 0" grep Misses stats-out.txt
+
+# and again (with removing the Packages file)
+rm -f ./aptarchive/dists/test/main/binary-i386/*
+rm -f ./aptarchive/dists/test/Contents-i386
+aptftparchive generate ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+ensure_correct_packages_file
+ensure_correct_contents_file
+testequal " Misses in Cache: 0
+ dists/test/Contents-i386: New 402 B Misses in Cache: 0" grep Misses stats-out.txt
+
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
new file mode 100755
index 000000000..3a5507c21
--- /dev/null
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -0,0 +1,162 @@
+#!/bin/sh
+set -e
+
+assert_correct_sources_file() {
+ testequal "Package: bar
+Binary: bar
+Version: 1.0
+Architecture: all
+Format: 3.0 (native)
+Directory: pool/main
+Files:
+ 7b57dd065e51de5905288a5104d4bef5 406 bar_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 bar_1.0.tar.gz
+Package-List:
+ bar deb admin extra
+Checksums-Sha1:
+ 17a40b76715f393ab7fd6485c9392a02f1adf903 406 bar_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 bar_1.0.tar.gz
+Checksums-Sha256:
+ d9d7507f66a89258b6920aca47747d7a30e0e64b09ecabbf02b2efbdabf840a9 406 bar_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 bar_1.0.tar.gz
+Checksums-Sha512:
+ ee0a9bfb6614159b45203fc29487d4f37387993ca0e6d6f27b80010498f3731d75753188ece307508ae9af0259bd11a6af15a1a38f0b87dbd5ea1273b7a7d53e 406 bar_1.0.dsc
+ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
+
+Package: foo
+Binary: foo
+Version: 1.0
+Architecture: all
+Format: 3.0 (native)
+Directory: pool/main
+Files:
+ d144826e6f02831c1933e910c92cd7e0 171 foo_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 foo_1.0.tar.gz
+Package-List:
+ foo deb admin extra
+Checksums-Sha1:
+ 979306aa3ccff3d61bba062bb6977e2493c6f907 171 foo_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 foo_1.0.tar.gz
+Checksums-Sha256:
+ 8c780af8b5a6d5b3c2e2f9518940beebea52ac6d6ad7b52c082dc925cfe5b532 171 foo_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 foo_1.0.tar.gz
+Checksums-Sha512:
+ 3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
+ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
+" cat ./aptarchive/dists/test/main/source/Sources
+}
+
+create_source_files() {
+ NAME="$1"
+ REQUEST_CLEARSIGN="$2"
+
+ TARFILE="aptarchive/pool/main/${NAME}_1.0.tar.gz"
+ DSC_FILE="aptarchive/pool/main/${NAME}_1.0.dsc"
+ touch $TARFILE
+ if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
+ printf -- "-----BEGIN PGP SIGNED MESSAGE-----\n\n" > $DSC_FILE
+ fi
+ cat >> $DSC_FILE << EOF
+Format: 3.0 (native)
+Source: $NAME
+Binary: $NAME
+Architecture: all
+Version: 1.0
+Package-List:
+ $NAME deb admin extra
+Files:
+ $(md5sum $TARFILE|cut -f1 -d' ') $(stat --print="%s" $TARFILE) ${NAME}_1.0.tar.gz
+EOF
+ if [ "$REQUEST_CLEARSIGN" = "CLEARSIGN" ]; then
+ cat >> $DSC_FILE < apt-ftparchive.conf <<"EOF"
+Dir {
+ ArchiveDir "./aptarchive";
+ OverrideDir "./aptarchive-overrides";
+ CacheDir "./aptarchive-cache";
+};
+
+Default {
+ Packages::Compress ". gzip bzip2";
+ Contents::Compress ". gzip bzip2";
+ LongDescription "false";
+};
+
+TreeDefault {
+ BinCacheDB "packages-$(SECTION)-$(ARCH).db";
+ SrcCacheDB "sources-$(SECTION).db";
+
+ Directory "pool/$(SECTION)";
+ SrcDirectory "pool/$(SECTION)";
+
+ Sources "$(DIST)/$(SECTION)/source/Sources";
+};
+
+Tree "dists/test" {
+ Sections "main";
+ Architectures "source";
+
+};
+EOF
+
+
+# generate (empty cachedb)
+aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testequal " Misses in Cache: 2" grep Misses stats-out.txt
+assert_correct_sources_file
+
+
+# generate again out of the cache
+rm -f ./aptarchive/dists/test/main/source/Sources
+aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
+testequal " Misses in Cache: 0" grep Misses stats-out.txt
+assert_correct_sources_file
+
+# generate invalid files
+mkdir aptarchive/pool/invalid
+printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
+testequal "
+E: Could not find a Source entry in the DSC 'aptarchive/pool/invalid/invalid_1.0.dsc'" aptftparchive sources aptarchive/pool/invalid
+rm -f aptarchive/pool/invalid/invalid_1.0.dsc
+
+dd if=/dev/zero of="aptarchive/pool/invalid/toobig_1.0.dsc" bs=1k count=129 2>/dev/null
+testequal "
+E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchive sources aptarchive/pool/invalid
+
+
--
cgit v1.2.3
From 53ba4e2c2dd29758be0a911489ca5c23e5107513 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 4 Apr 2014 17:09:43 +0200
Subject: ensure clean works
---
test/integration/test-apt-ftparchive-cachedb | 7 +++++++
test/integration/test-apt-ftparchive-src-cachedb | 6 ++++++
2 files changed, 13 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
index 2a3bfce99..147272a2c 100755
--- a/test/integration/test-apt-ftparchive-cachedb
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -91,3 +91,10 @@ ensure_correct_contents_file
testequal " Misses in Cache: 0
dists/test/Contents-i386: New 402 B Misses in Cache: 0" grep Misses stats-out.txt
+# and clean
+rm -rf aptarchive/pool/main/*
+testequal "packages-main-i386.db" aptftparchive clean ftparchive.conf
+aptftparchive clean ftparchive.conf -o Debug::APT::FTPArchive::Clean=1 > clean-out.txt 2>&1
+testequal "0 Number of unique keys in the tree" grep unique clean-out.txt
+testequal "packages-main-i386.db" grep packages-main-i386.db clean-out.txt
+
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index 3a5507c21..9cc0a98de 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -159,4 +159,10 @@ dd if=/dev/zero of="aptarchive/pool/invalid/toobig_1.0.dsc" bs=1k count=129 2>/d
testequal "
E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchive sources aptarchive/pool/invalid
+# ensure clean works
+rm -f aptarchive/pool/main/*
+aptftparchive clean apt-ftparchive.conf -o Debug::APT::FTPArchive::Clean=1 > clean-out.txt 2>&1
+testequal "0 Number of unique keys in the tree" grep unique clean-out.txt
+testequal "sources-main.db" grep sources-main.db clean-out.txt
+
--
cgit v1.2.3
From cf6bbca0a93b21ab7d3378f26dd9b57951a1d987 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 7 Apr 2014 09:41:20 +0200
Subject: ensure "--db" also works with the new srcpkgdb
---
test/integration/test-apt-ftparchive-src-cachedb | 27 +++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index 9cc0a98de..1af193632 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -105,6 +105,30 @@ mkdir -p aptarchive/dists/test/main/source/
mkdir aptarchive-overrides
mkdir aptarchive-cache
+
+
+
+# generate with --db option
+(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
+ -o APT::FTPArchive::ShowCacheMisses=1 \
+ > dists/test/main/source/Sources \
+ 2> stats-out.txt
+ testequal " Misses in Cache: 2" grep Misses stats-out.txt
+)
+assert_correct_sources_file
+
+# generate with --db option (again to ensure its in the cache)
+(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
+ -o APT::FTPArchive::ShowCacheMisses=1 \
+ > dists/test/main/source/Sources \
+ 2> stats-out.txt
+ testequal " Misses in Cache: 0" grep Misses stats-out.txt
+)
+assert_correct_sources_file
+
+
+
+# get ready for the "apt-ftparchive generate" command
cat > apt-ftparchive.conf <<"EOF"
Dir {
ArchiveDir "./aptarchive";
@@ -135,7 +159,6 @@ Tree "dists/test" {
};
EOF
-
# generate (empty cachedb)
aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
testequal " Misses in Cache: 2" grep Misses stats-out.txt
@@ -148,6 +171,8 @@ aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1
testequal " Misses in Cache: 0" grep Misses stats-out.txt
assert_correct_sources_file
+
+
# generate invalid files
mkdir aptarchive/pool/invalid
printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
--
cgit v1.2.3
From feab34c5216941ca95aae1a389238a77b662d1de Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 22 Apr 2014 17:59:09 +0200
Subject: add support for apt-get build-dep foo.dsc
---
test/integration/test-apt-get-build-dep | 85 +++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
create mode 100755 test/integration/test-apt-get-build-dep
(limited to 'test')
diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep
new file mode 100755
index 000000000..6516aa705
--- /dev/null
+++ b/test/integration/test-apt-get-build-dep
@@ -0,0 +1,85 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildsimplenativepackage 'debhelper' 'i386' '7' 'stable'
+buildsimplenativepackage 'build-essential' 'i386' '1' 'stable'
+
+setupaptarchive
+cat > 2vcard_0.5-3.dsc <
+Uploaders: Marcela Tiznado
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 5.0.37)
+Checksums-Sha1:
+ b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
+ 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
+Checksums-Sha256:
+ efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
+ 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
+Files:
+ f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
+ 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
+EOF
+
+testequal "Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ build-essential debhelper
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst build-essential (1 stable [i386])
+Inst debhelper (7 stable [i386])
+Conf build-essential (1 stable [i386])
+Conf debhelper (7 stable [i386])" aptget build-dep -s 2vcard_0.5-3.dsc
+
+cat > 2vcard_0.5-3.dsc <
+Uploaders: Marcela Tiznado
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 5.0.37)
+Checksums-Sha1:
+ b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
+ 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
+Checksums-Sha256:
+ efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
+ 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
+Files:
+ f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
+ 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
+z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
+=4eRd
+-----END PGP SIGNATURE-----
+EOF
+
+testequal "Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ build-essential debhelper
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst build-essential (1 stable [i386])
+Inst debhelper (7 stable [i386])
+Conf build-essential (1 stable [i386])
+Conf debhelper (7 stable [i386])" aptget build-dep --simulate 2vcard_0.5-3.dsc
--
cgit v1.2.3
From 77da39b95870498431fc21df65900acc5ce2f7ea Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 25 Apr 2014 09:47:50 +0200
Subject: add support for apt-get build-dep unpacked-source-dir
---
test/integration/test-apt-get-build-dep | 41 +++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep
index 6516aa705..f71beae9c 100755
--- a/test/integration/test-apt-get-build-dep
+++ b/test/integration/test-apt-get-build-dep
@@ -83,3 +83,44 @@ Inst build-essential (1 stable [i386])
Inst debhelper (7 stable [i386])
Conf build-essential (1 stable [i386])
Conf debhelper (7 stable [i386])" aptget build-dep --simulate 2vcard_0.5-3.dsc
+
+
+# unpacked source dir
+mkdir -p foo-1.0/debian
+cat > foo-1.0/debian/control <<'EOF'
+Source: apturl
+Section: admin
+Priority: optional
+Maintainer: Michael Vogt
+Build-Depends: debhelper (>= 7)
+X-Python3-Version: >= 3.2
+Standards-Version: 3.9.3
+
+Package: apturl-common
+Architecture: any
+Depends: ${python3:Depends},
+ ${shlibs:Depends},
+ ${misc:Depends},
+ python3-apt,
+ python3-update-manager
+Replaces: apturl (<< 0.3.6ubuntu2)
+Description: install packages using the apt protocol - common data
+ AptUrl is a simple graphical application that takes an URL (which follows the
+ apt-protocol) as a command line option, parses it and carries out the
+ operations that the URL describes (that is, it asks the user if he wants the
+ indicated packages to be installed and if the answer is positive does so for
+ him).
+ .
+ This package contains the common data shared between the frontends.
+
+EOF
+
+testequal "Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ build-essential debhelper
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst build-essential (1 stable [i386])
+Inst debhelper (7 stable [i386])
+Conf build-essential (1 stable [i386])
+Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
--
cgit v1.2.3
From 7ad2a3477f39e2eac221c53e5f94954f481eb1b4 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 28 Apr 2014 16:43:58 +0200
Subject: Implement Popen() execv helper to avoid popen()
---
test/libapt/fileutl_test.cc | 48 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
(limited to 'test')
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index 643c02297..c2a43eda7 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -224,3 +224,51 @@ TEST(FileUtlTest, GetTempDir)
if (old_tmpdir.empty() == false)
setenv("TMPDIR", old_tmpdir.c_str(), 1);
}
+
+TEST(FileUtlTest, Popen)
+{
+ FileFd Fd;
+ pid_t Child;
+ char buf[1024];
+ std::string s;
+ unsigned long long n = 0;
+ std::vector OpenFds;
+
+ // count Fds to ensure we don't have a resource leak
+ if(FileExists("/proc/self/fd"))
+ OpenFds = Glob("/proc/self/fd/*");
+
+ // output something
+ const char* Args[10] = {"/bin/echo", "meepmeep", NULL};
+ bool res = Popen(Args, Fd, Child, FileFd::ReadOnly);
+ Fd.Read(buf, sizeof(buf)-1, &n);
+ buf[n] = 0;
+ EXPECT_NE(n, 0);
+ EXPECT_EQ(res, true);
+ EXPECT_STREQ(buf, "meepmeep\n");
+
+ // wait for the child to exit and cleanup
+ ExecWait(Child, "PopenRead");
+ Fd.Close();
+
+ // ensure that after a close all is good again
+ if(FileExists("/proc/self/fd"))
+ EXPECT_EQ(Glob("/proc/self/fd/*").size(), OpenFds.size());
+
+
+ // ReadWrite is not supported
+ res = Popen(Args, Fd, Child, FileFd::ReadWrite);
+ EXPECT_EQ(res, false);
+ _error->Discard();
+
+ // write something
+ Args[0] = "/bin/bash";
+ Args[1] = "-c";
+ Args[2] = "read";
+ Args[3] = NULL;
+ res = Popen(Args, Fd, Child, FileFd::WriteOnly);
+ s = "\n";
+ Fd.Write(s.c_str(), s.size());
+ Fd.Close();
+ ExecWait(Child, "PopenWrite");
+}
--
cgit v1.2.3
From 53ac87ac9c27af39df062516aab5dce880af107a Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 28 Apr 2014 17:24:35 +0200
Subject: add flAbsPath() as a wrapper to realpath()
---
test/libapt/fileutl_test.cc | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'test')
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index 643c02297..9c7e1630a 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -224,3 +224,10 @@ TEST(FileUtlTest, GetTempDir)
if (old_tmpdir.empty() == false)
setenv("TMPDIR", old_tmpdir.c_str(), 1);
}
+TEST(FileUtlTest, flAbsPath)
+{
+ int res = chdir("/bin/");
+ EXPECT_EQ(res, 0);
+ std::string p = flAbsPath("ls");
+ EXPECT_EQ(p, "/bin/ls");
+}
--
cgit v1.2.3
From a111a024a30b805fc3f2b8a5b4db8d0c26c10fb8 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 28 Apr 2014 17:44:34 +0200
Subject: fix tests
---
test/libapt/fileutl_test.cc | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'test')
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index 9c7e1630a..15b57983b 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -226,8 +226,12 @@ TEST(FileUtlTest, GetTempDir)
}
TEST(FileUtlTest, flAbsPath)
{
+ std::string cwd = SafeGetCWD();
int res = chdir("/bin/");
EXPECT_EQ(res, 0);
std::string p = flAbsPath("ls");
EXPECT_EQ(p, "/bin/ls");
+
+ res = chdir(cwd.c_str());
+ EXPECT_EQ(res, 0);
}
--
cgit v1.2.3
From 773642528b6d9858c2c68ada42705ea71c8db37e Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 7 May 2014 20:55:41 +0200
Subject: fix test-bug-602412-dequote-redirect by removing the aptget update
size information
---
test/integration/test-bug-602412-dequote-redirect | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect
index 6393f0c27..4901a32d7 100755
--- a/test/integration/test-bug-602412-dequote-redirect
+++ b/test/integration/test-bug-602412-dequote-redirect
@@ -20,11 +20,14 @@ testrun() {
testsuccess --nomsg aptget update
# check that I-M-S header is kept in redirections
+ local LOG='update.log'
+ # strip away the [ 304 B ] info
+ aptget update 2>&1 | sed -e 's/\ \[.*//' > $LOG
testequal "Hit $1 unstable InRelease
Hit $1 unstable/main Sources
Hit $1 unstable/main amd64 Packages
Hit $1 unstable/main Translation-en
-Reading package lists..." aptget update
+Reading package lists..." cat $LOG
msgtest 'Test redirection works in' 'package download'
testsuccess --nomsg aptget install unrelated --download-only -y
--
cgit v1.2.3
From b41713efc8f37d62f078bea850ef0a74e0af0103 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 7 May 2014 21:03:45 +0200
Subject: show progress in run-tests
---
test/integration/run-tests | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/run-tests b/test/integration/run-tests
index 79d5d1a29..d700cc3fc 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -36,11 +36,12 @@ else
CRESET=''
fi
+TOTAL="$(run-parts --list $DIR | grep '/test-' | wc -l)"
for testcase in $(run-parts --list $DIR | grep '/test-'); do
if [ "$MSGLEVEL" -le 2 ]; then
echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
else
- echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
+ echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}"
fi
if ! ${testcase}; then
FAIL=$((FAIL+1))
--
cgit v1.2.3
From 8c617819b179beef02a87daa2777115b4e3b3b48 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 7 May 2014 22:05:26 +0200
Subject: add BUILDDIRECTORY to PATH in the tests
---
test/integration/framework | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 3b900a960..7c5da3694 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -241,7 +241,8 @@ setupenvironment() {
gpg --quiet --check-trustdb --secret-keyring $SECRETKEYRING --keyring $SECRETKEYRING >/dev/null 2>&1
# cleanup the environment a bit
- export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
+ # prefer our apt binaries over the system apt binaries
+ export PATH="${BUILDDIRECTORY}:${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
export LC_ALL=C.UTF-8
unset LANGUAGE APT_CONFIG
unset GREP_OPTIONS DEB_BUILD_PROFILES
--
cgit v1.2.3
From 34de054cffeb8e64c09efd452a78271bb85d4831 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 7 May 2014 22:34:34 +0200
Subject: fix tests
---
test/integration/test-bug-683786-build-dep-on-virtual-packages | 4 ++--
test/integration/test-ubuntu-bug-346386-apt-get-update-paywall | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages
index 879d6a3bc..65862c572 100755
--- a/test/integration/test-bug-683786-build-dep-on-virtual-packages
+++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages
@@ -38,8 +38,8 @@ Building dependency tree...
The following NEW packages will be installed:
po-debconf
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
-Inst po-debconf (1 unstable, unstable [all])
-Conf po-debconf (1 unstable, unstable [all])' aptget build-dep dash -s
+Inst po-debconf (1 unstable [all])
+Conf po-debconf (1 unstable [all])' aptget build-dep dash -s
testequal 'Reading package lists...
Building dependency tree...
diff --git a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
index 7112d2b45..1a7db0adc 100755
--- a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
+++ b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
@@ -22,7 +22,7 @@ Config-Item: Acquire::http::DependOnSTDIN=0
600 Acquire URI
URI: http://localhost:8080/holygrail
Filename: knights-talking
-' | ${METHODSDIR}/http >/dev/null 2>&1 && msgpass || msgfail
+' | LD_LIBRARY_PATH=${BUILDDIRECTORY} ${METHODSDIR}/http >/dev/null 2>&1 && msgpass || msgfail
testfileequal knights-talking 'ni ni ni'
ensure_n_canary_strings_in_dir() {
--
cgit v1.2.3
From f7bf262e7bf35c19e14aad753a239ec94672d3da Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 8 May 2014 13:43:18 +0200
Subject: update test-apt-progress-fd
---
test/integration/test-apt-progress-fd | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
index 9d250e949..7ddf355f3 100755
--- a/test/integration/test-apt-progress-fd
+++ b/test/integration/test-apt-progress-fd
@@ -16,7 +16,7 @@ setupaptarchive
exec 3> apt-progress.log
testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
testequal "dlstatus:1:0:Retrieving file 1 of 1
-dlstatus:1:0:Retrieving file 1 of 1
+dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:0:Installing testing (amd64)
pmstatus:testing:20:Preparing testing (amd64)
@@ -31,7 +31,7 @@ pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
exec 3> apt-progress.log
testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
testequal "dlstatus:1:0:Retrieving file 1 of 1
-dlstatus:1:0:Retrieving file 1 of 1
+dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:20:Preparing testing (amd64)
pmstatus:testing:40:Unpacking testing (amd64)
@@ -56,7 +56,7 @@ testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
# and compare
testequal "dlstatus:1:0:Retrieving file 1 of 1
-dlstatus:1:0:Retrieving file 1 of 1
+dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing2:0:Installing testing2 (i386)
pmstatus:testing2:20:Preparing testing2 (i386)
--
cgit v1.2.3
From 4bcb5f4b531ccab5540e9a0554ce59b3724f7660 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 8 May 2014 14:30:18 +0200
Subject: Revert "fix test-bug-602412-dequote-redirect by removing the aptget
update size information"
This reverts commit 773642528b6d9858c2c68ada42705ea71c8db37e.
---
test/integration/test-bug-602412-dequote-redirect | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect
index 4901a32d7..6393f0c27 100755
--- a/test/integration/test-bug-602412-dequote-redirect
+++ b/test/integration/test-bug-602412-dequote-redirect
@@ -20,14 +20,11 @@ testrun() {
testsuccess --nomsg aptget update
# check that I-M-S header is kept in redirections
- local LOG='update.log'
- # strip away the [ 304 B ] info
- aptget update 2>&1 | sed -e 's/\ \[.*//' > $LOG
testequal "Hit $1 unstable InRelease
Hit $1 unstable/main Sources
Hit $1 unstable/main amd64 Packages
Hit $1 unstable/main Translation-en
-Reading package lists..." cat $LOG
+Reading package lists..." aptget update
msgtest 'Test redirection works in' 'package download'
testsuccess --nomsg aptget install unrelated --download-only -y
--
cgit v1.2.3
From c7cea1068fc639e65578dd8e0ad9478bb419cc0f Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 8 May 2014 18:51:24 +0200
Subject: fix apt-config test now that PATH changed in 8c617819
Git-Dch: Ignore
---
test/integration/test-kernel-helper-autoremove | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index c51caa758..22c36890b 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -9,7 +9,7 @@ configarchitecture 'amd64'
# the executed script would use the installed apt-config,
# which is outside of our control
msgtest 'Check that the installed apt-config supports' '--no-empty'
-if apt-config dump --no-empty >/dev/null 2>&1; then
+if /usr/bin/apt-config dump --no-empty >/dev/null 2>&1; then
msgpass
else
msgskip
--
cgit v1.2.3
From 2a64259c7305f55f0014f399b9bd0e62b469c32b Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 8 May 2014 18:52:51 +0200
Subject: make test independent from the actual Install-Size
Git-Dch: Ignore
---
test/integration/test-apt-ftparchive-cachedb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
index 147272a2c..0e1986bcd 100755
--- a/test/integration/test-apt-ftparchive-cachedb
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -5,7 +5,7 @@ ensure_correct_packages_file() {
testequal "Package: foo
Priority: optional
Section: others
-Installed-Size: 29
+$(dpkg-deb -I ./aptarchive/pool/main/foo_1_i386.deb | grep 'Installed-Size:' | sed 's#^ ##')
Maintainer: Joe Sixpack
Architecture: i386
Version: 1
@@ -25,7 +25,7 @@ usr/share/doc/foo/copyright others/foo" cat ./aptarchive/dists/test/Conte
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
mkdir -p aptarchive/dists/test/main/i18n/
mkdir -p aptarchive/dists/test/main/source/
--
cgit v1.2.3
From 0c8171d7c52a46a719382ee7ed67451213f608ec Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Fri, 9 May 2014 01:22:50 +0200
Subject: =?UTF-8?q?tests:=20be=20able=20to=20disable=20"Fetched=20?=
=?UTF-8?q?=E2=80=A6"=20statistics=20message?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The line contains everchanging execution statistics which is harmful for
testcases as they need to filter out such lines, but this is hard so we
can just add an option to disable them instead and be done.
Git-Dch: Ignore
---
test/integration/framework | 1 +
test/integration/test-bug-595691-empty-and-broken-archive-files | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index ab1274d9c..9cdc31e23 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -226,6 +226,7 @@ setupenvironment() {
fi
echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
echo 'quiet::NoUpdate "true";' >> aptconfig.conf
+ echo 'quiet::NoStatistic "true";' >> aptconfig.conf
echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files
index a05ed5fa6..8da0a52d2 100755
--- a/test/integration/test-bug-595691-empty-and-broken-archive-files
+++ b/test/integration/test-bug-595691-empty-and-broken-archive-files
@@ -13,7 +13,7 @@ setupflataptarchive
testaptgetupdate() {
rm -rf rootdir/var/lib/apt
aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
- sed -i -e '/^Fetched / d' -e '/Ign / d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
+ sed -i -e '/Ign / d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
GIVEN="$1"
shift
msgtest "Test for correctness of" "apt-get update with $*"
--
cgit v1.2.3
From f4c3850ea335545e297504941dc8c7a8f1c83358 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sun, 18 Aug 2013 23:17:05 +0200
Subject: add a simple container for HashStrings
APT supports more than just one HashString and even allows to enforce
the usage of a specific hash. This class is intended to help with
storage and passing around of the HashStrings.
Git-Dch: Ignore
---
test/libapt/hashsums_test.cc | 64 +++++++++++++++++++++++++++++++++++---------
1 file changed, 52 insertions(+), 12 deletions(-)
(limited to 'test')
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index c06d85e03..ac7d41582 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -207,16 +207,56 @@ TEST(HashSumsTest, FileBased)
}
fd.Close();
- {
- HashString sha2("SHA256", sha256.Value());
- EXPECT_TRUE(sha2.VerifyFile(__FILE__));
- }
- {
- HashString sha2("SHA512", sha512.Value());
- EXPECT_TRUE(sha2.VerifyFile(__FILE__));
- }
- {
- HashString sha2("SHA256:" + sha256.Value());
- EXPECT_TRUE(sha2.VerifyFile(__FILE__));
- }
+ HashString sha2file("SHA512", sha512.Value());
+ EXPECT_TRUE(sha2file.VerifyFile(__FILE__));
+ HashString sha2wrong("SHA512", "00000000000");
+ EXPECT_FALSE(sha2wrong.VerifyFile(__FILE__));
+ EXPECT_EQ(sha2file, sha2file);
+ EXPECT_TRUE(sha2file == sha2file);
+ EXPECT_NE(sha2file, sha2wrong);
+ EXPECT_TRUE(sha2file != sha2wrong);
+
+ HashString sha2big("SHA256", sha256.Value());
+ EXPECT_TRUE(sha2big.VerifyFile(__FILE__));
+ HashString sha2small("sha256:" + sha256.Value());
+ EXPECT_TRUE(sha2small.VerifyFile(__FILE__));
+ EXPECT_EQ(sha2big, sha2small);
+ EXPECT_TRUE(sha2big == sha2small);
+ EXPECT_FALSE(sha2big != sha2small);
+
+ HashStringList hashes;
+ EXPECT_TRUE(hashes.empty());
+ EXPECT_TRUE(hashes.push_back(sha2file));
+ EXPECT_FALSE(hashes.empty());
+ EXPECT_EQ(1, hashes.size());
+
+ HashStringList wrong;
+ EXPECT_TRUE(wrong.push_back(sha2wrong));
+ EXPECT_NE(wrong, hashes);
+ EXPECT_FALSE(wrong == hashes);
+ EXPECT_TRUE(wrong != hashes);
+
+ HashStringList similar;
+ EXPECT_TRUE(similar.push_back(sha2big));
+ EXPECT_NE(similar, hashes);
+ EXPECT_FALSE(similar == hashes);
+ EXPECT_TRUE(similar != hashes);
+
+ EXPECT_TRUE(hashes.push_back(sha2big));
+ EXPECT_EQ(2, hashes.size());
+ EXPECT_TRUE(hashes.push_back(sha2small));
+ EXPECT_EQ(2, hashes.size());
+ EXPECT_FALSE(hashes.push_back(sha2wrong));
+ EXPECT_EQ(2, hashes.size());
+ EXPECT_TRUE(hashes.VerifyFile(__FILE__));
+
+ EXPECT_EQ(similar, hashes);
+ EXPECT_TRUE(similar == hashes);
+ EXPECT_FALSE(similar != hashes);
+ similar.clear();
+ EXPECT_TRUE(similar.empty());
+ EXPECT_EQ(0, similar.size());
+ EXPECT_NE(similar, hashes);
+ EXPECT_FALSE(similar == hashes);
+ EXPECT_TRUE(similar != hashes);
}
--
cgit v1.2.3
From 1262d35895c930f3fa49d7b4182cdd7a4a841f74 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sun, 18 Aug 2013 23:27:24 +0200
Subject: use 'best' hash for source authentication
Collect all hashes we can get from the source record and put them into a
HashStringList so that 'apt-get source' can use it instead of using
always the MD5sum.
We therefore also deprecate the MD5 struct member in favor of the list.
While at it, the parsing of the Files is enhanced so that records which
miss "Files" (aka MD5 checksums) are still searched for other checksums
as they include just as much data, just not with a nice and catchy name.
LP: 1098738
---
test/integration/test-debsrc-hashes | 77 ------
.../test-ubuntu-bug-1098738-apt-get-source-md5sum | 260 +++++++++++++++++++++
2 files changed, 260 insertions(+), 77 deletions(-)
delete mode 100755 test/integration/test-debsrc-hashes
create mode 100755 test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
(limited to 'test')
diff --git a/test/integration/test-debsrc-hashes b/test/integration/test-debsrc-hashes
deleted file mode 100755
index 5e917232b..000000000
--- a/test/integration/test-debsrc-hashes
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-set -e
-
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
-
-setupenvironment
-configarchitecture "i386"
-
-# pkg-sha256-bad has a bad SHA sum, but good MD5 sum. If apt is
-# checking the best available hash (as it should), this will trigger
-# a hash mismatch.
-
-cat > aptarchive/Sources <
-Architecture: i386
-Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.tar.gz
-
-Package: pkg-sha256-ok
-Binary: pkg-sha256-ok
-Version: 1.0
-Maintainer: Joe Sixpack
-Architecture: i386
-Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.tar.gz
-Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.tar.gz
-Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.tar.gz
-
-Package: pkg-sha256-bad
-Binary: pkg-sha256-bad
-Version: 1.0
-Maintainer: Joe Sixpack
-Architecture: i386
-Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.tar.gz
-Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.tar.gz
-Checksums-Sha256:
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.dsc
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.tar.gz
-EOF
-
-# create fetchable files
-for x in "pkg-md5-ok" "pkg-sha256-ok" "pkg-sha256-bad"; do
- touch aptarchive/${x}_1.0.dsc
- touch aptarchive/${x}_1.0.tar.gz
-done
-
-testok() {
- msgtest "Test for hash ok of" "$*"
- $* 2>&1 | grep "Download complete" > /dev/null && msgpass || msgfail
-}
-
-testmismatch() {
- msgtest "Test for hash mismatch of" "$*"
- $* 2>&1 | grep "Hash Sum mismatch" > /dev/null && msgpass || msgfail
-}
-
-setupaptarchive
-changetowebserver
-aptget update -qq
-
-testok aptget source -d pkg-md5-ok
-testok aptget source -d pkg-sha256-ok
-testmismatch aptget source -d pkg-sha256-bad
diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
new file mode 100755
index 000000000..9bdc81264
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
@@ -0,0 +1,260 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'native'
+
+cat > aptarchive/Sources <
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.tar.gz
+
+Package: pkg-sha256-ok
+Binary: pkg-sha256-ok
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.tar.gz
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.tar.gz
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.tar.gz
+
+Package: pkg-sha256-bad
+Binary: pkg-sha256-bad
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.tar.gz
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.tar.gz
+Checksums-Sha256:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-sha256-bad_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-sha256-bad_1.0.tar.gz
+
+Package: pkg-no-md5
+Binary: pkg-no-md5
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-no-md5_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-no-md5_1.0.tar.gz
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-no-md5_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-no-md5_1.0.tar.gz
+
+Package: pkg-mixed-ok
+Binary: pkg-mixed-ok
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-mixed-ok_1.0.tar.gz
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-mixed-ok_1.0.dsc
+
+Package: pkg-mixed-sha1-bad
+Binary: pkg-mixed-sha1-bad
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Checksums-Sha1:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-mixed-sha1-bad_1.0.dsc
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-mixed-sha1-bad_1.0.tar.gz
+
+Package: pkg-mixed-sha2-bad
+Binary: pkg-mixed-sha2-bad
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-mixed-sha2-bad_1.0.dsc
+Checksums-Sha256:
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-mixed-sha2-bad_1.0.tar.gz
+
+Package: pkg-md5-disagree
+Binary: pkg-md5-disagree
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-disagree_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-disagree_1.0.tar.gz
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-md5-disagree_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-md5-disagree_1.0.tar.gz
+
+Package: pkg-md5-agree
+Binary: pkg-md5-agree
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.tar.gz
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.tar.gz
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.dsc
+
+Package: pkg-sha256-disagree
+Binary: pkg-sha256-disagree
+Version: 1.0
+Maintainer: Joe Sixpack
+Architecture: all
+Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-disagree_1.0.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-disagree_1.0.tar.gz
+Checksums-Sha1:
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-disagree_1.0.dsc
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-disagree_1.0.tar.gz
+Checksums-Sha256:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-disagree_1.0.dsc
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-disagree_1.0.tar.gz
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-sha256-disagree_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-sha256-disagree_1.0.tar.gz
+EOF
+
+# create fetchable files
+for x in 'pkg-md5-ok' 'pkg-sha256-ok' 'pkg-sha256-bad' 'pkg-no-md5' \
+ 'pkg-mixed-ok' 'pkg-mixed-sha1-bad' 'pkg-mixed-sha2-bad' \
+ 'pkg-md5-agree' 'pkg-md5-disagree' 'pkg-sha256-disagree'; do
+ touch aptarchive/${x}_1.0.dsc aptarchive/${x}_1.0.tar.gz
+done
+
+setupaptarchive
+changetowebserver
+testsuccess aptget update
+
+testok() {
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+ testequal "Reading package lists...
+Building dependency tree...
+Need to get 0 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc)
+Get:2 http://localhost:8080/ $1 1.0 (tar)
+Download complete and in download only mode" aptget source -d "$@"
+ msgtest 'Files were successfully downloaded for' "$1"
+ testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+}
+
+testkeep() {
+ touch ${1}_1.0.dsc ${1}_1.0.tar.gz
+ testequal "Reading package lists...
+Building dependency tree...
+Skipping already downloaded file '${1}_1.0.dsc'
+Skipping already downloaded file '${1}_1.0.tar.gz'
+Need to get 0 B of source archives.
+Download complete and in download only mode" aptget source -d "$@"
+ msgtest 'Files already downloaded are kept for' "$1"
+ testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+}
+
+testmismatch() {
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+ testequal "Reading package lists...
+Building dependency tree...
+Need to get 0 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc)
+Get:2 http://localhost:8080/ $1 1.0 (tar)
+E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch
+
+E: Failed to fetch http://localhost:8080/${1}_1.0.tar.gz Hash Sum mismatch
+
+E: Failed to fetch some archives." aptget source -d "$@"
+ msgtest 'Files were not download as they have hashsum mismatches for' "$1"
+ testfailure --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
+
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+ testequal "Reading package lists...
+Building dependency tree...
+Skipping download of file 'pkg-sha256-bad_1.0.dsc' as requested hashsum is not available for authentication
+Skipping download of file 'pkg-sha256-bad_1.0.tar.gz' as requested hashsum is not available for authentication
+Need to get 0 B of source archives.
+Download complete and in download only mode" aptget source -d "$@" -o Acquire::ForceHash=ROT26
+ msgtest 'Files were not download as hash is unavailable for' "$1"
+ testfailure --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
+
+ rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
+ testequal "Reading package lists...
+Building dependency tree...
+Need to get 0 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc)
+Get:2 http://localhost:8080/ $1 1.0 (tar)
+Download complete and in download only mode" aptget source --allow-unauthenticated -d "$@" -o Acquire::ForceHash=ROT26
+ msgtest 'Files were downloaded unauthenticated as user allowed it' "$1"
+ testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
+}
+
+testok pkg-md5-ok
+testkeep pkg-md5-ok
+testok pkg-sha256-ok
+testkeep pkg-sha256-ok
+
+# pkg-sha256-bad has a bad SHA sum, but good MD5 sum. If apt is
+# checking the best available hash (as it should), this will trigger
+# a hash mismatch.
+testmismatch pkg-sha256-bad
+testmismatch pkg-sha256-bad
+testok pkg-sha256-bad -o Acquire::ForceHash=MD5Sum
+
+# not having MD5 sum doesn't mean the file doesn't exist at all …
+testok pkg-no-md5
+testok pkg-no-md5 -o Acquire::ForceHash=SHA256
+testequal "Reading package lists...
+Building dependency tree...
+Skipping download of file 'pkg-no-md5_1.0.dsc' as requested hashsum is not available for authentication
+Skipping download of file 'pkg-no-md5_1.0.tar.gz' as requested hashsum is not available for authentication
+Need to get 0 B of source archives.
+Download complete and in download only mode" aptget source -d pkg-no-md5 -o Acquire::ForceHash=MD5Sum
+msgtest 'Files were not download as MD5 is not available for this package' 'pkg-no-md5'
+testfailure --nomsg test -e pkg-no-md5_1.0.dsc -a -e pkg-no-md5_1.0.tar.gz
+
+# deal with cases in which we haven't for all files the same checksum type
+# mostly pathologic as this shouldn't happen, but just to be sure
+testok pkg-mixed-ok
+testequal 'Reading package lists...
+Building dependency tree...
+Need to get 0 B of source archives.
+Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar)
+Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc)
+E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch
+
+E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha1-bad
+msgtest 'Only tar file is downloaded as the dsc has hashsum mismatch' 'pkg-mixed-sha1-bad'
+testsuccess --nomsg test ! -e pkg-mixed-sha1-bad_1.0.dsc -a -e pkg-mixed-sha1-bad_1.0.tar.gz
+testequal 'Reading package lists...
+Building dependency tree...
+Need to get 0 B of source archives.
+Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar)
+Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc)
+E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch
+
+E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha2-bad
+msgtest 'Only dsc file is downloaded as the tar has hashsum mismatch' 'pkg-mixed-sha2-bad'
+testsuccess --nomsg test -e pkg-mixed-sha2-bad_1.0.dsc -a ! -e pkg-mixed-sha2-bad_1.0.tar.gz
+
+# it gets even more pathologic: multiple entries for one file, some even disagreeing!
+testok pkg-md5-agree
+testequal 'Reading package lists...
+Building dependency tree...
+E: Error parsing checksum in Files of source package pkg-md5-disagree' aptget source -d pkg-md5-disagree
+testequal 'Reading package lists...
+Building dependency tree...
+E: Error parsing checksum in Checksums-SHA256 of source package pkg-sha256-disagree' aptget source -d pkg-sha256-disagree
--
cgit v1.2.3
From b3501edb7091ca3aa6c2d6d96dc667b8161dd2b9 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 19 Aug 2013 00:00:23 +0200
Subject: use HashStringList in the acquire system
It is not very extensible to have the supported Hashes hardcoded
everywhere and especially if it is part of virtual method names.
It is also possible that a method does not support the 'best' hash
(yet), so we might end up not being able to verify a file even though we
have a common subset of supported hashes. And those are just two of the
cases in which it is handy to have a more dynamic selection.
The downside is that this is a MAJOR API break, but the HashStringList
has a string constructor for compatibility, so with a bit of luck the
few frontends playing with the acquire system directly are okay.
---
test/integration/test-apt-sources-deb822 | 48 ++++++------
.../test-bug-722207-print-uris-even-if-very-quiet | 8 +-
test/integration/test-pdiff-usage | 6 --
.../test-ubuntu-bug-346386-apt-get-update-paywall | 2 +-
test/libapt/hashsums_test.cc | 85 ++++++++++++++++++++--
5 files changed, 106 insertions(+), 43 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index 5f54b7531..d8b2334ad 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -23,14 +23,14 @@ Description: summay
msgtest 'Test sources.list' 'old style'
echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
msgtest 'Test sources.list' 'simple deb822'
echo "$BASE" > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
@@ -39,29 +39,29 @@ msgtest 'Test deb822 with' 'two entries'
echo "$BASE" > $SOURCES
echo "" >> $SOURCES
echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
-'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
+'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris
# two suite entries
msgtest 'Test deb822 with' 'two Suite entries'
echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
-'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
+'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris
msgtest 'Test deb822' 'architecture option'
echo "$BASE" > $SOURCES
echo "Architectures: amd64 armel" >> $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
@@ -85,19 +85,19 @@ testempty aptget update --print-uris
# multiple URIs
msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work'
echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
-testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0
-'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
# multiple Type in one field
msgtest 'Test deb822 sources.list file which has' 'Multiple Types work'
echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 :
-'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
-'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
+testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0
+'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
+'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
# a Suite
@@ -107,6 +107,6 @@ Types: deb
URIs: http://emacs.naquadah.org
Suites: stable/
EOF
-testequal --nomsg "'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0 :
-'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0 :
+testequal --nomsg "'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0
+'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0
'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 " aptget update --print-uris
diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet
index f2d95da19..9a5685703 100755
--- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet
+++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet
@@ -16,10 +16,10 @@ setupaptarchive
APTARCHIVE=$(readlink -f ./aptarchive)
-testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget upgrade -qq --print-uris
-testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget dist-upgrade -qq --print-uris
-testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget install apt -qq --print-uris
-testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget download apt -qq --print-uris
+testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget upgrade -qq --print-uris
+testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget dist-upgrade -qq --print-uris
+testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget install apt -qq --print-uris
+testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget download apt -qq --print-uris
testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris
testequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index afe1ad443..74749d6ab 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -13,12 +13,6 @@ changetowebserver
PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
-echo '#!/bin/sh
-touch merge-was-used
-/usr/bin/diffindex-rred "$@"' > extrred
-chmod +x extrred
-echo 'Dir::Bin::rred "./extrred";' > rootdir/etc/apt/apt.conf.d/99rred
-
wasmergeused() {
msgtest 'Test for successful execution of' "$*"
local OUTPUT=$(mktemp)
diff --git a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
index 1a7db0adc..8e50843f3 100755
--- a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
+++ b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
@@ -22,7 +22,7 @@ Config-Item: Acquire::http::DependOnSTDIN=0
600 Acquire URI
URI: http://localhost:8080/holygrail
Filename: knights-talking
-' | LD_LIBRARY_PATH=${BUILDDIRECTORY} ${METHODSDIR}/http >/dev/null 2>&1 && msgpass || msgfail
+' | runapt ${METHODSDIR}/http >/dev/null 2>&1 && msgpass || msgfail
testfileequal knights-talking 'ni ni ni'
ensure_n_canary_strings_in_dir() {
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index ac7d41582..2159996ff 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -1,5 +1,6 @@
#include
+#include
#include
#include
#include
@@ -166,20 +167,26 @@ TEST(HashSumsTest, FileBased)
{
Hashes hashes;
hashes.AddFD(fd.Fd());
- EXPECT_EQ(md5.Value(), hashes.MD5.Result().Value());
- EXPECT_EQ(sha1.Value(), hashes.SHA1.Result().Value());
- EXPECT_EQ(sha256.Value(), hashes.SHA256.Result().Value());
- EXPECT_EQ(sha512.Value(), hashes.SHA512.Result().Value());
+ HashStringList list = hashes.GetHashStringList();
+ EXPECT_FALSE(list.empty());
+ EXPECT_EQ(4, list.size());
+ EXPECT_EQ(md5.Value(), list.find("MD5Sum")->HashValue());
+ EXPECT_EQ(sha1.Value(), list.find("SHA1")->HashValue());
+ EXPECT_EQ(sha256.Value(), list.find("SHA256")->HashValue());
+ EXPECT_EQ(sha512.Value(), list.find("SHA512")->HashValue());
}
unsigned long sz = fd.FileSize();
fd.Seek(0);
{
Hashes hashes;
hashes.AddFD(fd.Fd(), sz);
- EXPECT_EQ(md5.Value(), hashes.MD5.Result().Value());
- EXPECT_EQ(sha1.Value(), hashes.SHA1.Result().Value());
- EXPECT_EQ(sha256.Value(), hashes.SHA256.Result().Value());
- EXPECT_EQ(sha512.Value(), hashes.SHA512.Result().Value());
+ HashStringList list = hashes.GetHashStringList();
+ EXPECT_FALSE(list.empty());
+ EXPECT_EQ(4, list.size());
+ EXPECT_EQ(md5.Value(), list.find("MD5Sum")->HashValue());
+ EXPECT_EQ(sha1.Value(), list.find("SHA1")->HashValue());
+ EXPECT_EQ(sha256.Value(), list.find("SHA256")->HashValue());
+ EXPECT_EQ(sha512.Value(), list.find("SHA512")->HashValue());
}
fd.Seek(0);
{
@@ -260,3 +267,65 @@ TEST(HashSumsTest, FileBased)
EXPECT_FALSE(similar == hashes);
EXPECT_TRUE(similar != hashes);
}
+TEST(HashSumsTest, HashStringList)
+{
+ _config->Clear("Acquire::ForceHash");
+
+ HashStringList list;
+ EXPECT_TRUE(list.empty());
+ EXPECT_FALSE(list.usable());
+ EXPECT_EQ(0, list.size());
+ EXPECT_EQ(NULL, list.find(NULL));
+ EXPECT_EQ(NULL, list.find(""));
+ EXPECT_EQ(NULL, list.find("MD5Sum"));
+
+ HashStringList list2;
+ EXPECT_FALSE(list == list2);
+ EXPECT_TRUE(list != list2);
+
+ Hashes hashes;
+ hashes.Add("The quick brown fox jumps over the lazy dog");
+ list = hashes.GetHashStringList();
+ EXPECT_FALSE(list.empty());
+ EXPECT_TRUE(list.usable());
+ EXPECT_EQ(4, list.size());
+ EXPECT_TRUE(NULL != list.find(NULL));
+ EXPECT_TRUE(NULL != list.find(""));
+ EXPECT_TRUE(NULL != list.find("MD5Sum"));
+ EXPECT_TRUE(NULL == list.find("ROT26"));
+
+ _config->Set("Acquire::ForceHash", "MD5Sum");
+ EXPECT_FALSE(list.empty());
+ EXPECT_TRUE(list.usable());
+ EXPECT_EQ(4, list.size());
+ EXPECT_TRUE(NULL != list.find(NULL));
+ EXPECT_TRUE(NULL != list.find(""));
+ EXPECT_TRUE(NULL != list.find("MD5Sum"));
+ EXPECT_TRUE(NULL == list.find("ROT26"));
+
+ _config->Set("Acquire::ForceHash", "ROT26");
+ EXPECT_FALSE(list.empty());
+ EXPECT_FALSE(list.usable());
+ EXPECT_EQ(4, list.size());
+ EXPECT_TRUE(NULL == list.find(NULL));
+ EXPECT_TRUE(NULL == list.find(""));
+ EXPECT_TRUE(NULL != list.find("MD5Sum"));
+ EXPECT_TRUE(NULL == list.find("ROT26"));
+
+ _config->Clear("Acquire::ForceHash");
+
+ list2.push_back(*list.find("MD5Sum"));
+ EXPECT_TRUE(list == list2);
+ EXPECT_FALSE(list != list2);
+
+ // introduce a mismatch to the list
+ list2.push_back(HashString("SHA1", "cacecbd74968bc90ea3342767e6b94f46ddbcafc"));
+ EXPECT_FALSE(list == list2);
+ EXPECT_TRUE(list != list2);
+
+ _config->Set("Acquire::ForceHash", "MD5Sum");
+ EXPECT_TRUE(list == list2);
+ EXPECT_FALSE(list != list2);
+
+ _config->Clear("Acquire::ForceHash");
+}
--
cgit v1.2.3
From a311fb96b84757ef8628e6a754232614a53b7891 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sun, 27 Apr 2014 18:23:20 +0200
Subject: deal with hashes in ftparchive more dynamic as well
Now that libapts acquire system happily passes around hashes and can be
made to support new ones without an ABI break in the future, we can
free ftparchive from all the deprecation warnings the last commit
introduced for it.
The goal here isn't to preserve ABI as we have none to keep here, but to
help avoiding introduction problems of 'new' hashes later as bugs creep
into the copy&paste parts, so short/less of them is good.
---
test/integration/framework | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 9cdc31e23..4d0d07cc2 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -102,10 +102,10 @@ runapt() {
local CMD="$1"
shift
case $CMD in
- sh|aptitude|*/*) ;;
+ sh|aptitude|*/*|command) ;;
*) CMD="${BUILDDIRECTORY}/$CMD";;
esac
- MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${BUILDDIRECTORY} $CMD "$@"
+ MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${LIBRARYPATH} $CMD "$@"
}
aptconfig() { runapt apt-config "$@"; }
aptcache() { runapt apt-cache "$@"; }
@@ -127,11 +127,9 @@ dpkgcheckbuilddeps() {
command dpkg-checkbuilddeps --admindir=${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg "$@"
}
gdb() {
- echo "gdb: run »$*«"
- CMD="$1"
+ local CMD="$1"
shift
-
- APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${LIBRARYPATH} command gdb ${BUILDDIRECTORY}/$CMD --args ${BUILDDIRECTORY}/$CMD "$@"
+ runapt command gdb --quiet -ex run "${BUILDDIRECTORY}/$CMD" --args "${BUILDDIRECTORY}/$CMD" "$@"
}
gpg() {
# see apt-key for the whole trickery. Setup is done in setupenvironment
--
cgit v1.2.3
From 895417ef99bb1371d8970da1afe87c6d64382f67 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 28 Apr 2014 10:02:27 +0200
Subject: reenable pipelining via hashsum reordering support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now that methods have the expected hashes available they can check if
the response from the server is what they expected. Pipelining is one of
those areas in which servers can mess up by not supporting it properly,
which forced us to disable it for the time being. Now, we check if
we got a response out of order, which we can not only use to disable
pipelining automatically for the next requests, but we can fix it up
just like the server responded in proper order for the current requests.
To ensure that this little trick works pipelining is only attempt if we
have hashsums for all the files in the chain which in theory reduces the
use of pipelining usage even on the many servers which work properly,
but in practice only the InRelease file (or similar such) will be
requested without a hashsum – and as it is the only file requested in
that stage it can't be pipelined even if we wanted to.
Some minor annoyances remain: The display of the progress we have
doesn't reflect this change, so it looks like the same package gets
downloaded multiple times while others aren't at all. Further more,
partial files are not supported in this recovery as the received data
was appended to the wrong file, so the hashsum doesn't match.
Both seem to be minor enough to reenable pipelining by default until
further notice through to test if it really solves the problem.
This therefore reverts commit 8221431757c775ee875a061b184b5f6f2330f928.
---
test/integration/test-http-pipeline-messup | 43 ++++++++
.../test-ubuntu-bug-1098738-apt-get-source-md5sum | 116 +++++++++++----------
2 files changed, 102 insertions(+), 57 deletions(-)
create mode 100755 test/integration/test-http-pipeline-messup
(limited to 'test')
diff --git a/test/integration/test-http-pipeline-messup b/test/integration/test-http-pipeline-messup
new file mode 100755
index 000000000..9c59e1825
--- /dev/null
+++ b/test/integration/test-http-pipeline-messup
@@ -0,0 +1,43 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildsimplenativepackage 'pkga' 'all' '1.0' 'stable'
+buildsimplenativepackage 'pkgb' 'all' '1.0' 'stable'
+buildsimplenativepackage 'pkgc' 'all' '1.0' 'stable'
+buildsimplenativepackage 'pkgd' 'all' '1.0' 'stable'
+
+setupaptarchive --no-update
+
+# simulate (and be a predictable) pipeline mess-up by the server/proxy
+changetowebserver \
+ -o 'aptwebserver::overwrite::.*pkga.*::filename=/pool/pkgd_1.0_all.deb' \
+ -o 'aptwebserver::overwrite::.*pkgc.*::filename=/pool/pkgb_1.0_all.deb' \
+ -o 'aptwebserver::overwrite::.*pkgb.*::filename=/pool/pkgc_1.0_all.deb' \
+ -o 'aptwebserver::overwrite::.*pkgd.*::filename=/pool/pkga_1.0_all.deb'
+
+testsuccess aptget update -o Debug::Acquire::http=1 -o Debug::pkgAcquire::Worker=1
+
+# messup is bigger than pipeline: checks if fixup isn't trying to hard
+testfailure aptget download pkga pkgb pkgc pkgd "$@" -o Acquire::http::Pipeline-Depth=2
+testfailure test -f pkga_1.0_all.deb
+
+# ensure that pipeling is enabled for rest of this test
+echo 'Acquire::http::Pipeline-Depth 10;' > rootdir/etc/apt/apt.conf.d/99enable-pipeline
+
+# the output is a bit strange: it looks like it has downloaded pkga 4 times
+testsuccess aptget download pkga pkgb pkgc pkgd -o Debug::Acquire::http=1 -o Debug::pkgAcquire::Worker=1
+for pkg in 'pkga' 'pkgb' 'pkgc' 'pkgd'; do
+ testsuccess test -f ${pkg}_1.0_all.deb
+ testsuccess cmp incoming/${pkg}_1.0_all.deb ${pkg}_1.0_all.deb
+ rm -f ${pkg}_1.0_all.deb
+done
+
+# while hashes will pass (as none are available), sizes will not match, so failure
+# checks that no hashes means that pipeline depth is ignored as we can't fixup
+testfailure aptget download pkga pkgb pkgc pkgd "$@" --allow-unauthenticated -o Acquire::ForceHash=ROT26
diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
index 9bdc81264..8c9c9c767 100755
--- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
+++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
@@ -14,8 +14,8 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-md5-ok_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-md5-ok_1.0.tar.gz
Package: pkg-sha256-ok
Binary: pkg-sha256-ok
@@ -23,14 +23,14 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-sha256-ok_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-sha256-ok_1.0.tar.gz
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.tar.gz
+ 324f464e6151a92cf57b26ef95dcfcf2059a8c44 3 pkg-sha256-ok_1.0.dsc
+ 680254bad1d7ca0d65ec46aaa315d363abf6a50a 3 pkg-sha256-ok_1.0.tar.gz
Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.tar.gz
+ 943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a 3 pkg-sha256-ok_1.0.dsc
+ 90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb 3 pkg-sha256-ok_1.0.tar.gz
Package: pkg-sha256-bad
Binary: pkg-sha256-bad
@@ -38,14 +38,14 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-sha256-bad_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-sha256-bad_1.0.tar.gz
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.tar.gz
+ 324f464e6151a92cf57b26ef95dcfcf2059a8c44 3 pkg-sha256-bad_1.0.dsc
+ 680254bad1d7ca0d65ec46aaa315d363abf6a50a 3 pkg-sha256-bad_1.0.tar.gz
Checksums-Sha256:
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-sha256-bad_1.0.dsc
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-sha256-bad_1.0.tar.gz
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3 pkg-sha256-bad_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3 pkg-sha256-bad_1.0.tar.gz
Package: pkg-no-md5
Binary: pkg-no-md5
@@ -53,11 +53,11 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-no-md5_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-no-md5_1.0.tar.gz
+ 324f464e6151a92cf57b26ef95dcfcf2059a8c44 3 pkg-no-md5_1.0.dsc
+ 680254bad1d7ca0d65ec46aaa315d363abf6a50a 3 pkg-no-md5_1.0.tar.gz
Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-no-md5_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-no-md5_1.0.tar.gz
+ 943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a 3 pkg-no-md5_1.0.dsc
+ 90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb 3 pkg-no-md5_1.0.tar.gz
Package: pkg-mixed-ok
Binary: pkg-mixed-ok
@@ -65,9 +65,9 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-mixed-ok_1.0.tar.gz
+ 680254bad1d7ca0d65ec46aaa315d363abf6a50a 3 pkg-mixed-ok_1.0.tar.gz
Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-mixed-ok_1.0.dsc
+ 943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a 3 pkg-mixed-ok_1.0.dsc
Package: pkg-mixed-sha1-bad
Binary: pkg-mixed-sha1-bad
@@ -75,9 +75,9 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Checksums-Sha1:
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-mixed-sha1-bad_1.0.dsc
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3 pkg-mixed-sha1-bad_1.0.dsc
Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-mixed-sha1-bad_1.0.tar.gz
+ 90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb 3 pkg-mixed-sha1-bad_1.0.tar.gz
Package: pkg-mixed-sha2-bad
Binary: pkg-mixed-sha2-bad
@@ -85,9 +85,9 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-mixed-sha2-bad_1.0.dsc
+ 324f464e6151a92cf57b26ef95dcfcf2059a8c44 3 pkg-mixed-sha2-bad_1.0.dsc
Checksums-Sha256:
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-mixed-sha2-bad_1.0.tar.gz
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3 pkg-mixed-sha2-bad_1.0.tar.gz
Package: pkg-md5-disagree
Binary: pkg-md5-disagree
@@ -95,10 +95,10 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-disagree_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-disagree_1.0.tar.gz
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-md5-disagree_1.0.dsc
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-md5-disagree_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-md5-disagree_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-md5-disagree_1.0.tar.gz
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3 pkg-md5-disagree_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3 pkg-md5-disagree_1.0.tar.gz
Package: pkg-md5-agree
Binary: pkg-md5-agree
@@ -106,10 +106,10 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.tar.gz
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.tar.gz
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-agree_1.0.dsc
+ 9604ba9427a280db542279d9ed78400b 3 pkg-md5-agree_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-md5-agree_1.0.tar.gz
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-md5-agree_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-md5-agree_1.0.dsc
Package: pkg-sha256-disagree
Binary: pkg-sha256-disagree
@@ -117,23 +117,24 @@ Version: 1.0
Maintainer: Joe Sixpack
Architecture: all
Files:
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-disagree_1.0.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-disagree_1.0.tar.gz
+ 9604ba9427a280db542279d9ed78400b 3 pkg-sha256-disagree_1.0.dsc
+ db5570bf61464b46e2bde31ed61a7dc6 3 pkg-sha256-disagree_1.0.tar.gz
Checksums-Sha1:
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-disagree_1.0.dsc
- da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-disagree_1.0.tar.gz
+ 324f464e6151a92cf57b26ef95dcfcf2059a8c44 3 pkg-sha256-disagree_1.0.dsc
+ 680254bad1d7ca0d65ec46aaa315d363abf6a50a 3 pkg-sha256-disagree_1.0.tar.gz
Checksums-Sha256:
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-disagree_1.0.dsc
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-disagree_1.0.tar.gz
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 pkg-sha256-disagree_1.0.dsc
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 pkg-sha256-disagree_1.0.tar.gz
+ 943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a 3 pkg-sha256-disagree_1.0.dsc
+ 90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb 3 pkg-sha256-disagree_1.0.tar.gz
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3 pkg-sha256-disagree_1.0.dsc
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3 pkg-sha256-disagree_1.0.tar.gz
EOF
# create fetchable files
for x in 'pkg-md5-ok' 'pkg-sha256-ok' 'pkg-sha256-bad' 'pkg-no-md5' \
'pkg-mixed-ok' 'pkg-mixed-sha1-bad' 'pkg-mixed-sha2-bad' \
'pkg-md5-agree' 'pkg-md5-disagree' 'pkg-sha256-disagree'; do
- touch aptarchive/${x}_1.0.dsc aptarchive/${x}_1.0.tar.gz
+ echo -n 'dsc' > aptarchive/${x}_1.0.dsc
+ echo -n 'tar' > aptarchive/${x}_1.0.tar.gz
done
setupaptarchive
@@ -144,9 +145,9 @@ testok() {
rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
testequal "Reading package lists...
Building dependency tree...
-Need to get 0 B of source archives.
-Get:1 http://localhost:8080/ $1 1.0 (dsc)
-Get:2 http://localhost:8080/ $1 1.0 (tar)
+Need to get 6 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B]
+Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B]
Download complete and in download only mode" aptget source -d "$@"
msgtest 'Files were successfully downloaded for' "$1"
testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
@@ -154,7 +155,8 @@ Download complete and in download only mode" aptget source -d "$@"
}
testkeep() {
- touch ${1}_1.0.dsc ${1}_1.0.tar.gz
+ echo -n 'dsc' > ${1}_1.0.dsc
+ echo -n 'tar' > ${1}_1.0.tar.gz
testequal "Reading package lists...
Building dependency tree...
Skipping already downloaded file '${1}_1.0.dsc'
@@ -170,9 +172,9 @@ testmismatch() {
rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
testequal "Reading package lists...
Building dependency tree...
-Need to get 0 B of source archives.
-Get:1 http://localhost:8080/ $1 1.0 (dsc)
-Get:2 http://localhost:8080/ $1 1.0 (tar)
+Need to get 6 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B]
+Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B]
E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch
E: Failed to fetch http://localhost:8080/${1}_1.0.tar.gz Hash Sum mismatch
@@ -194,9 +196,9 @@ Download complete and in download only mode" aptget source -d "$@" -o Acquire::F
rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
testequal "Reading package lists...
Building dependency tree...
-Need to get 0 B of source archives.
-Get:1 http://localhost:8080/ $1 1.0 (dsc)
-Get:2 http://localhost:8080/ $1 1.0 (tar)
+Need to get 6 B of source archives.
+Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B]
+Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B]
Download complete and in download only mode" aptget source --allow-unauthenticated -d "$@" -o Acquire::ForceHash=ROT26
msgtest 'Files were downloaded unauthenticated as user allowed it' "$1"
testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
@@ -231,9 +233,9 @@ testfailure --nomsg test -e pkg-no-md5_1.0.dsc -a -e pkg-no-md5_1.0.tar.gz
testok pkg-mixed-ok
testequal 'Reading package lists...
Building dependency tree...
-Need to get 0 B of source archives.
-Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar)
-Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc)
+Need to get 6 B of source archives.
+Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar) [3 B]
+Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) [3 B]
E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch
E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha1-bad
@@ -241,9 +243,9 @@ msgtest 'Only tar file is downloaded as the dsc has hashsum mismatch' 'pkg-mixed
testsuccess --nomsg test ! -e pkg-mixed-sha1-bad_1.0.dsc -a -e pkg-mixed-sha1-bad_1.0.tar.gz
testequal 'Reading package lists...
Building dependency tree...
-Need to get 0 B of source archives.
-Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar)
-Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc)
+Need to get 6 B of source archives.
+Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) [3 B]
+Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc) [3 B]
E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch
E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha2-bad
--
cgit v1.2.3
From ffe3c68e494efc1c2c4d748fa9d69e150867e5c2 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sun, 18 Aug 2013 22:20:25 +0200
Subject: parse and retrieve multiple Descriptions in one record
It seems unlikely for now that proper archives will carry multiple
Description-* stanzas in the Packages (or Translation-*) file, but
sometimes apt eats its own output as shown by the usage of the CD team
and it would be interesting to let apt output multiple translations
e.g. in 'apt-cache show'.
---
test/integration/test-bug-712435-missing-descriptions | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions
index 53ecbbeb3..7a3518745 100755
--- a/test/integration/test-bug-712435-missing-descriptions
+++ b/test/integration/test-bug-712435-missing-descriptions
@@ -87,13 +87,10 @@ $DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
" aptcache show apt-normal
-# displaying the translated Description would be equally valid,
-# but we assume only one description is in a Packages file and
-# so we prefer "Description" over "Description-*" currently.
for variant in 'below' 'middle' 'top'; do
testequal "Package: apt-both-$variant
$PACKAGESTANZA
-$DESCRIPTION
+$TRANSDESCRIPTION
Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
" aptcache show apt-both-$variant
done
@@ -122,7 +119,7 @@ X-Some-Flag: yes
testequal "Package: apt-intermixed2
$PACKAGESTANZA
-$DESCRIPTION
+$TRANSDESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Some-Flag: yes
X-Foo-Flag: Something with a Description
@@ -131,7 +128,7 @@ X-Bar-Flag: no
testequal "Package: apt-intermixed3
$PACKAGESTANZA
-$DESCRIPTION
+$TRANSDESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Some-Flag: yes
X-Foo-Flag: Something with a Description
--
cgit v1.2.3
From 8710a36a01c0cb1648926792c2ad05185535558e Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 10 May 2014 11:24:44 +0200
Subject: improve pkgTagSection scanning and parsing
Removes the 256 fields limit, deals consistently with spaces littered
all over the place and is even a tiny bit faster than before.
Even comes with a bunch of new tests to validate these claims.
---
test/integration/test-apt-ftparchive-src-cachedb | 5 +
test/libapt/tagfile_test.cc | 179 +++++++++++++++++++++++
2 files changed, 184 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index 1af193632..c850c739f 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -177,6 +177,11 @@ assert_correct_sources_file
mkdir aptarchive/pool/invalid
printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
testequal "
+E: Could not find a record in the DSC 'aptarchive/pool/invalid/invalid_1.0.dsc'" aptftparchive sources aptarchive/pool/invalid
+rm -f aptarchive/pool/invalid/invalid_1.0.dsc
+
+printf "meep: yes" > aptarchive/pool/invalid/invalid_1.0.dsc
+testequal "
E: Could not find a Source entry in the DSC 'aptarchive/pool/invalid/invalid_1.0.dsc'" aptftparchive sources aptarchive/pool/invalid
rm -f aptarchive/pool/invalid/invalid_1.0.dsc
diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc
index 1bac75b55..df618ea16 100644
--- a/test/libapt/tagfile_test.cc
+++ b/test/libapt/tagfile_test.cc
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include
@@ -34,3 +35,181 @@ TEST(TagFileTest,SingleField)
// There is only one section in this tag file
EXPECT_FALSE(tfile.Step(section));
}
+
+TEST(TagFileTest,MultipleSections)
+{
+ FileFd fd;
+ createTemporaryFile("bigsection", fd, NULL, "Package: pkgA\n"
+ "Version: 1\n"
+ "Size: 100\n"
+ "Description: aaa\n"
+ " aaa\n"
+ "\n"
+ "Package: pkgB\n"
+ "Version: 1\n"
+ "Flag: no\n"
+ "Description: bbb\n"
+ "\n"
+ "Package: pkgC\n"
+ "Version: 2\n"
+ "Flag: yes\n"
+ "Description:\n"
+ " ccc\n"
+ );
+
+ pkgTagFile tfile(&fd);
+ pkgTagSection section;
+ EXPECT_FALSE(section.Exists("Version"));
+
+ EXPECT_TRUE(tfile.Step(section));
+ EXPECT_EQ(4, section.Count());
+ EXPECT_TRUE(section.Exists("Version"));
+ EXPECT_TRUE(section.Exists("Package"));
+ EXPECT_TRUE(section.Exists("Size"));
+ EXPECT_FALSE(section.Exists("Flag"));
+ EXPECT_TRUE(section.Exists("Description"));
+ EXPECT_EQ("pkgA", section.FindS("Package"));
+ EXPECT_EQ("1", section.FindS("Version"));
+ EXPECT_EQ(1, section.FindULL("Version"));
+ EXPECT_EQ(100, section.FindULL("Size"));
+ unsigned long Flags = 1;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(1, Flags);
+ Flags = 0;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(0, Flags);
+ EXPECT_EQ("aaa\n aaa", section.FindS("Description"));
+
+
+ EXPECT_TRUE(tfile.Step(section));
+ EXPECT_EQ(4, section.Count());
+ EXPECT_TRUE(section.Exists("Version"));
+ EXPECT_TRUE(section.Exists("Package"));
+ EXPECT_FALSE(section.Exists("Size"));
+ EXPECT_TRUE(section.Exists("Flag"));
+ EXPECT_TRUE(section.Exists("Description"));
+ EXPECT_EQ("pkgB", section.FindS("Package"));
+ EXPECT_EQ("1", section.FindS("Version"));
+ EXPECT_EQ(1, section.FindULL("Version"));
+ EXPECT_EQ(0, section.FindULL("Size"));
+ Flags = 1;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(0, Flags);
+ Flags = 0;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(0, Flags);
+ EXPECT_EQ("bbb", section.FindS("Description"));
+
+ EXPECT_TRUE(tfile.Step(section));
+ EXPECT_EQ(4, section.Count());
+ EXPECT_TRUE(section.Exists("Version"));
+ EXPECT_TRUE(section.Exists("Package"));
+ EXPECT_FALSE(section.Exists("Size"));
+ EXPECT_TRUE(section.Exists("Flag"));
+ EXPECT_TRUE(section.Exists("Description"));
+ EXPECT_EQ("pkgC", section.FindS("Package"));
+ EXPECT_EQ("2", section.FindS("Version"));
+ EXPECT_EQ(2, section.FindULL("Version"));
+ Flags = 0;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(1, Flags);
+ Flags = 1;
+ EXPECT_TRUE(section.FindFlag("Flag", Flags, 1));
+ EXPECT_EQ(1, Flags);
+ EXPECT_EQ("ccc", section.FindS("Description"));
+
+ // There is no section left in this tag file
+ EXPECT_FALSE(tfile.Step(section));
+}
+
+TEST(TagFileTest,BigSection)
+{
+ size_t const count = 500;
+ std::stringstream content;
+ for (size_t i = 0; i < count; ++i)
+ content << "Field-" << i << ": " << (2000 + i) << std::endl;
+
+ FileFd fd;
+ createTemporaryFile("bigsection", fd, NULL, content.str().c_str());
+
+ pkgTagFile tfile(&fd);
+ pkgTagSection section;
+ EXPECT_TRUE(tfile.Step(section));
+
+ EXPECT_EQ(count, section.Count());
+ for (size_t i = 0; i < count; ++i)
+ {
+ std::stringstream name;
+ name << "Field-" << i;
+ EXPECT_TRUE(section.Exists(name.str().c_str())) << name.str() << " does not exist";
+ EXPECT_EQ((2000 + i), section.FindULL(name.str().c_str()));
+ }
+
+ // There is only one section in this tag file
+ EXPECT_FALSE(tfile.Step(section));
+}
+
+TEST(TagFileTest, PickedUpFromPreviousCall)
+{
+ size_t const count = 500;
+ std::stringstream contentstream;
+ for (size_t i = 0; i < count; ++i)
+ contentstream << "Field-" << i << ": " << (2000 + i) << std::endl;
+ contentstream << std::endl << std::endl;
+ std::string content = contentstream.str();
+
+ pkgTagSection section;
+ EXPECT_FALSE(section.Scan(content.c_str(), content.size()/2));
+ EXPECT_NE(0, section.Count());
+ EXPECT_NE(count, section.Count());
+ EXPECT_TRUE(section.Scan(content.c_str(), content.size(), false));
+ EXPECT_EQ(count, section.Count());
+
+ for (size_t i = 0; i < count; ++i)
+ {
+ std::stringstream name;
+ name << "Field-" << i;
+ EXPECT_TRUE(section.Exists(name.str().c_str())) << name.str() << " does not exist";
+ EXPECT_EQ((2000 + i), section.FindULL(name.str().c_str()));
+ }
+}
+
+TEST(TagFileTest, SpacesEverywhere)
+{
+ std::string content =
+ "Package: pkgA\n"
+ "Package: pkgB\n"
+ "NoSpaces:yes\n"
+ "TagSpaces\t :yes\n"
+ "ValueSpaces: \tyes\n"
+ "BothSpaces \t:\t yes\n"
+ "TrailingSpaces: yes\t \n"
+ "Naming Space: yes\n"
+ "Naming Spaces: yes\n"
+ "Package : pkgC \n"
+ "Multi-Colon::yes:\n"
+ "\n\n";
+
+ pkgTagSection section;
+ EXPECT_TRUE(section.Scan(content.c_str(), content.size()));
+ EXPECT_TRUE(section.Exists("Package"));
+ EXPECT_TRUE(section.Exists("NoSpaces"));
+ EXPECT_TRUE(section.Exists("TagSpaces"));
+ EXPECT_TRUE(section.Exists("ValueSpaces"));
+ EXPECT_TRUE(section.Exists("BothSpaces"));
+ EXPECT_TRUE(section.Exists("TrailingSpaces"));
+ EXPECT_TRUE(section.Exists("Naming Space"));
+ EXPECT_TRUE(section.Exists("Naming Spaces"));
+ EXPECT_TRUE(section.Exists("Multi-Colon"));
+ EXPECT_EQ("pkgC", section.FindS("Package"));
+ EXPECT_EQ("yes", section.FindS("NoSpaces"));
+ EXPECT_EQ("yes", section.FindS("TagSpaces"));
+ EXPECT_EQ("yes", section.FindS("ValueSpaces"));
+ EXPECT_EQ("yes", section.FindS("BothSpaces"));
+ EXPECT_EQ("yes", section.FindS("TrailingSpaces"));
+ EXPECT_EQ("yes", section.FindS("Naming Space"));
+ EXPECT_EQ("yes", section.FindS("Naming Spaces"));
+ EXPECT_EQ(":yes:", section.FindS("Multi-Colon"));
+ // overridden values are still present, but not really accessible
+ EXPECT_EQ(11, section.Count());
+}
--
cgit v1.2.3
From 7a223b933cab0447438ca2e964576da39078eaf4 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 10 May 2014 12:50:00 +0200
Subject: invalid cache if architecture set doesn't match
The cache heavily depends on the architecture(s) it is build for,
especially if you move from single- to multiarch. Adding a new
architecture to dpkg therefore has to be detected and must invalidate
the cache so that we don't operate on incorrect data.
The incorrect data will prevent us from doing otherwise sensible
actions (it doesn't allow bad things to happen) and the recovery is
simple and automatic in most cases, so this hides pretty well and is
also not as serious as it might sound at first.
Closes: 745036
---
.../test-bug-745036-new-foreign-invalidates-cache | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100755 test/integration/test-bug-745036-new-foreign-invalidates-cache
(limited to 'test')
diff --git a/test/integration/test-bug-745036-new-foreign-invalidates-cache b/test/integration/test-bug-745036-new-foreign-invalidates-cache
new file mode 100755
index 000000000..490cbecdd
--- /dev/null
+++ b/test/integration/test-bug-745036-new-foreign-invalidates-cache
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'cool-foo' 'amd64' '1.0' 'Depends: foo'
+insertpackage 'unstable' 'foo' 'amd64' '1.0' 'Multi-Arch: foreign'
+insertinstalledpackage 'cool-foo' 'amd64' '1.0' 'Depends: foo'
+insertinstalledpackage 'foo' 'amd64' '1.0' 'Multi-Arch: foreign'
+
+setupaptarchive
+
+testsuccess aptget check -s
+
+configarchitecture 'amd64' 'i386'
+testequal 'E: The package cache was built for different architectures: amd64 vs amd64,i386' aptget check -s -o pkgCacheFile::Generate=false
+
+testsuccess aptget check -s
+
+insertinstalledpackage 'awesome-foo' 'i386' '1.0' 'Depends: foo'
+
+testsuccess aptget check -s
+
+testsuccess aptget update --no-download
+
+testsuccess aptget check -s
--
cgit v1.2.3
From b2db070b7b633e03674c0ae8765025c29a4d4490 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 10 May 2014 14:21:10 +0200
Subject: add an additional test for arch specific conflicts
In bugreport #747261 I confirmed with this testcase that apt actually
supports the requested architecture-specific conflicts already since
2012 with commit cef094c2ec8214b2783a2ac3aa70cf835381eae1.
The old test only does simulations which are handy to check apt,
this one builds 'real' packages to see if dpkg agrees with us.
Git-Dch: Ignore
---
.../test-bug-747261-arch-specific-conflicts | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100755 test/integration/test-bug-747261-arch-specific-conflicts
(limited to 'test')
diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts
new file mode 100755
index 000000000..bfb2d089f
--- /dev/null
+++ b/test/integration/test-bug-747261-arch-specific-conflicts
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'sparc' 'armel'
+
+buildsimplenativepackage 'libc6' 'amd64,sparc,armel' '1' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'libc6-i386' 'amd64' '1' 'stable' 'Conflicts: libc6:sparc'
+
+setupaptarchive
+
+testsuccess aptget install 'libc6:amd64' 'libc6:sparc' -y
+testdpkginstalled 'libc6:amd64' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386' 'libc6:armel'
+
+testsuccess aptget install libc6-i386 -y
+testdpkginstalled 'libc6:amd64' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc' 'libc6:armel'
+
+testsuccess aptget install libc6:armel -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc'
+
+testsuccess aptget install libc6:sparc -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386'
+
+testsuccess aptget purge 'libc6:*' 'libc6-i386' -y
+testdpkgnotinstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc' 'libc6-i386'
+
+# check that (the actually simpler) single arch is fine, too
+configarchitecture 'amd64'
+testfailure aptget install libc6:sparc -s
+testsuccess aptget install libc6 libc6-i386 -y
--
cgit v1.2.3
From 4f6d26b4d41474aa390329b7e9cb167eb70b2821 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 12 May 2014 21:25:43 +0200
Subject: (try to) fix travis-ci build failures
dpkg on Ubuntu 12.04 does not seem to support parsing arch-specific
dependencies, so we try to detect if we face such a dpkg in the test.
In the other test the order depends on libdb, which changes per arch, so
we just run it through our sorting binary and be happy (hopefully).
Git-Dch: Ignore
---
test/integration/framework | 3 ++-
test/integration/test-apt-ftparchive-src-cachedb | 10 +++++-----
test/integration/test-bug-747261-arch-specific-conflicts | 15 +++++++++++++++
3 files changed, 22 insertions(+), 6 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 4d0d07cc2..b469fd3f6 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -36,7 +36,7 @@ msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
msgtest() {
while [ -n "$1" ]; do
echo -n "${CINFO}$1${CCMD} "
- echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} "
+ echo -n "$(echo "$2" | sed -e 's#^apt\([cgfs]\)#apt-\1#')${CINFO} "
shift
if [ -n "$1" ]; then shift; else break; fi
done
@@ -114,6 +114,7 @@ aptget() { runapt apt-get "$@"; }
aptftparchive() { runapt apt-ftparchive "$@"; }
aptkey() { runapt apt-key "$@"; }
aptmark() { runapt apt-mark "$@"; }
+aptsortpkgs() { runapt apt-sortpkgs "$@"; }
apt() { runapt apt "$@"; }
apthelper() { runapt "${APTHELPERBINDIR}/apt-helper" "$@"; }
aptwebserver() { runapt "${APTWEBSERVERBINDIR}/aptwebserver" "$@"; }
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index c850c739f..e7b148530 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -3,9 +3,9 @@ set -e
assert_correct_sources_file() {
testequal "Package: bar
-Binary: bar
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: bar
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -24,9 +24,9 @@ Checksums-Sha512:
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
Package: foo
-Binary: foo
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: foo
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -43,7 +43,7 @@ Checksums-Sha256:
Checksums-Sha512:
3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
-" cat ./aptarchive/dists/test/main/source/Sources
+" aptsortpkgs ./aptarchive/dists/test/main/source/Sources
}
create_source_files() {
diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts
index bfb2d089f..be971b89e 100755
--- a/test/integration/test-bug-747261-arch-specific-conflicts
+++ b/test/integration/test-bug-747261-arch-specific-conflicts
@@ -6,6 +6,21 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'amd64' 'sparc' 'armel'
+msgtest 'Check that dpkg supports' 'arch-specific dependencies'
+set +e
+# this fails always, the question is just how it fails
+dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null 2>/dev/null >/dev/null
+RETURNCODE=$?
+set -e
+if [ "$RETURNCODE" != '1' ]; then
+ dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null || true
+ echo "Command had returncode: $RETURNCODE"
+ msgskip
+ exit 0
+else
+ msgpass
+fi
+
buildsimplenativepackage 'libc6' 'amd64,sparc,armel' '1' 'stable' 'Multi-Arch: same'
buildsimplenativepackage 'libc6-i386' 'amd64' '1' 'stable' 'Conflicts: libc6:sparc'
--
cgit v1.2.3
From bc1c9081e826c2c7f265f23d388ba868d5011f6a Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 15 May 2014 14:37:33 +0200
Subject: Never parse Version/Architecture tags in a Translation-$lang file
Version/Architecture information in a Translation-$lang file is
not allowed, so don't try to parse it. This is a fix for a bugreport
where a Translation-en file contained the content of the regular
Packages file (probably due to local FS corruption). This lead to
strange error messages on file download.
Thanks to Thomas Reusch for the report.
---
.../test-apt-translation-has-no-packages | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100755 test/integration/test-apt-translation-has-no-packages
(limited to 'test')
diff --git a/test/integration/test-apt-translation-has-no-packages b/test/integration/test-apt-translation-has-no-packages
new file mode 100755
index 000000000..bb2353a33
--- /dev/null
+++ b/test/integration/test-apt-translation-has-no-packages
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Due to corruption (local or network) a user might end up with a
+# Translation-$lang file on disk that is actually a Packages file. In this
+# case apt used to generate invalid package versions out of the
+# Translation-$lang file (i.e. apt-cache policy foo) would show a version
+# comming out of a Translation file. Downloading this versions fails as
+# there is no acquire method available for the package
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "amd64"
+
+if [ ! -x ${BUILDDIRECTORY}/apt ]; then
+ msgmsg "No ${BUILDDIRECTORY}/apt"
+ msgskip
+ exit 0
+fi
+
+buildsimplenativepackage 'foo' 'all' '1.0'
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# corrupt the Translation-en file to look like a regular Packages file
+rm rootdir/var/cache/apt/*.bin
+cp $APTARCHIVE/dists/unstable/main/binary-amd64/Packages \
+ rootdir/var/lib/apt/lists/*Translation-en
+
+# ensure that there is no Version for the package foo generated out of
+# the corrupted Translation-en file
+testequal "foo:
+ Installed: (none)
+ Candidate: 1.0
+ Version table:
+ 1.0 0
+ 500 file:$APTARCHIVE/ unstable/main amd64 Packages" aptcache policy foo
--
cgit v1.2.3
From 6f22aa086954064b2ee58cd11b50832b242d54ad Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 10 May 2014 14:21:10 +0200
Subject: add an additional test for arch specific conflicts
In bugreport #747261 I confirmed with this testcase that apt actually
supports the requested architecture-specific conflicts already since
2012 with commit cef094c2ec8214b2783a2ac3aa70cf835381eae1.
The old test only does simulations which are handy to check apt,
this one builds 'real' packages to see if dpkg agrees with us.
Git-Dch: Ignore
---
.../test-bug-747261-arch-specific-conflicts | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100755 test/integration/test-bug-747261-arch-specific-conflicts
(limited to 'test')
diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts
new file mode 100755
index 000000000..bfb2d089f
--- /dev/null
+++ b/test/integration/test-bug-747261-arch-specific-conflicts
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'sparc' 'armel'
+
+buildsimplenativepackage 'libc6' 'amd64,sparc,armel' '1' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'libc6-i386' 'amd64' '1' 'stable' 'Conflicts: libc6:sparc'
+
+setupaptarchive
+
+testsuccess aptget install 'libc6:amd64' 'libc6:sparc' -y
+testdpkginstalled 'libc6:amd64' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386' 'libc6:armel'
+
+testsuccess aptget install libc6-i386 -y
+testdpkginstalled 'libc6:amd64' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc' 'libc6:armel'
+
+testsuccess aptget install libc6:armel -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc'
+
+testsuccess aptget install libc6:sparc -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386'
+
+testsuccess aptget purge 'libc6:*' 'libc6-i386' -y
+testdpkgnotinstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc' 'libc6-i386'
+
+# check that (the actually simpler) single arch is fine, too
+configarchitecture 'amd64'
+testfailure aptget install libc6:sparc -s
+testsuccess aptget install libc6 libc6-i386 -y
--
cgit v1.2.3
From 8f418981337503ff7abedd872f788b51bcdbc886 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 22 Apr 2014 16:07:32 +0200
Subject: show upgradable packages after apt update
Closes: 748389
---
test/integration/test-apt-cli-update | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100755 test/integration/test-apt-cli-update
(limited to 'test')
diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update
new file mode 100755
index 000000000..8237bf03f
--- /dev/null
+++ b/test/integration/test-apt-cli-update
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '2.0'
+insertinstalledpackage 'foo' 'all' '1.0'
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+testequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q
--
cgit v1.2.3
From 50d98a1be2e15f44dea23a5d3840c79366a42fe0 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 22 May 2014 10:49:35 +0200
Subject: Implement simple by-hash for apt update
This implements a apt update schema that get the indexfiles by the
hash instead of the name. The rational is that updates to the archive
servers/mirrors are not atomic so the client may have the previous
version of the Release file when the server updates to a new
Release file and new Packages/Sources/Translations indexes. By
keeping the files around by their hash we can still get the previous
indexfile without a hashsum mismatch.
Enable with APT::Acquire::By-Hash=1
---
test/integration/test-apt-by-hash-update | 39 ++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100755 test/integration/test-apt-by-hash-update
(limited to 'test')
diff --git a/test/integration/test-apt-by-hash-update b/test/integration/test-apt-by-hash-update
new file mode 100755
index 000000000..6b3032ad6
--- /dev/null
+++ b/test/integration/test-apt-by-hash-update
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+
+setupaptarchive --no-update
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# make Packages *only* accessable by-hash for this test
+mkdir -p aptarchive/dists/unstable/main/binary-i386/by-hash
+(cd aptarchive/dists/unstable/main/binary-i386/by-hash &&
+ mv ../Packages* . &&
+ ln -s Packages.gz $(sha256sum Packages.gz|cut -f1 -d' ') )
+
+# add sources
+mkdir -p aptarchive/dists/unstable/main/source/by-hash
+(cd aptarchive/dists/unstable/main/source/by-hash &&
+ ln -s ../Sources.gz $(sha256sum ../Sources.gz|cut -f1 -d' ')
+)
+
+
+# ensure we do not know about "foo"
+testequal "Reading package lists...
+Building dependency tree...
+E: Unable to locate package foo" aptget install -q -s foo
+
+# ensure we can apt-get update by hash
+testsuccess aptget update -o APT::Acquire::By-Hash=1
+
+# ensure it keeps working
+testequal "Inst foo (1.0 unstable [all])
+Conf foo (1.0 unstable [all])" aptget install -qq -s foo
\ No newline at end of file
--
cgit v1.2.3
From a2fdb57ff93c1b1f35b796c3c99878ec3ae54a06 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 22 May 2014 17:36:09 +0200
Subject: Add APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to
Release file
The by-hash can be configured on a per-hostname basis and a Release
file can indicate that it has by-hash support via a new flag.
The location of the hash now matches the AptByHash spec
---
test/integration/test-apt-by-hash-update | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-by-hash-update b/test/integration/test-apt-by-hash-update
index 6b3032ad6..23282bf86 100755
--- a/test/integration/test-apt-by-hash-update
+++ b/test/integration/test-apt-by-hash-update
@@ -14,17 +14,19 @@ setupaptarchive --no-update
APTARCHIVE=$(readlink -f ./aptarchive)
# make Packages *only* accessable by-hash for this test
-mkdir -p aptarchive/dists/unstable/main/binary-i386/by-hash
-(cd aptarchive/dists/unstable/main/binary-i386/by-hash &&
- mv ../Packages* . &&
- ln -s Packages.gz $(sha256sum Packages.gz|cut -f1 -d' ') )
+mkdir -p aptarchive/dists/unstable/main/binary-i386/by-hash/SHA512
+(cd aptarchive/dists/unstable/main/binary-i386/by-hash/SHA512 &&
+ mv ../../Packages* . &&
+ ln -s Packages.gz $(sha512sum Packages.gz|cut -f1 -d' ') )
# add sources
-mkdir -p aptarchive/dists/unstable/main/source/by-hash
-(cd aptarchive/dists/unstable/main/source/by-hash &&
- ln -s ../Sources.gz $(sha256sum ../Sources.gz|cut -f1 -d' ')
+mkdir -p aptarchive/dists/unstable/main/source/by-hash/SHA512
+(cd aptarchive/dists/unstable/main/source/by-hash/SHA512 &&
+ ln -s ../../Sources.gz $(sha512sum ../../Sources.gz|cut -f1 -d' ')
)
+# we moved the Packages file away, normal update won't work
+testfailure aptget upate
# ensure we do not know about "foo"
testequal "Reading package lists...
@@ -34,6 +36,14 @@ E: Unable to locate package foo" aptget install -q -s foo
# ensure we can apt-get update by hash
testsuccess aptget update -o APT::Acquire::By-Hash=1
-# ensure it keeps working
+# ensure it works
testequal "Inst foo (1.0 unstable [all])
-Conf foo (1.0 unstable [all])" aptget install -qq -s foo
\ No newline at end of file
+Conf foo (1.0 unstable [all])" aptget install -qq -s foo
+
+# add magic string to Release file ...
+MAGIC="Acquire-By-Hash: true"
+sed -i "s#Suite: unstable#Suite: unstable\n$MAGIC#" aptarchive/dists/unstable/Release
+signreleasefiles
+# ... and verify that it fetches by hash now
+testsuccess aptget update
+
--
cgit v1.2.3
From a6fd378a9b2a541a18aeba722ecfedba9af567cb Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 8 May 2014 18:52:51 +0200
Subject: make test independent from the actual Install-Size
Git-Dch: Ignore
---
test/integration/test-apt-ftparchive-cachedb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
index 147272a2c..0e1986bcd 100755
--- a/test/integration/test-apt-ftparchive-cachedb
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -5,7 +5,7 @@ ensure_correct_packages_file() {
testequal "Package: foo
Priority: optional
Section: others
-Installed-Size: 29
+$(dpkg-deb -I ./aptarchive/pool/main/foo_1_i386.deb | grep 'Installed-Size:' | sed 's#^ ##')
Maintainer: Joe Sixpack
Architecture: i386
Version: 1
@@ -25,7 +25,7 @@ usr/share/doc/foo/copyright others/foo" cat ./aptarchive/dists/test/Conte
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
mkdir -p aptarchive/dists/test/main/i18n/
mkdir -p aptarchive/dists/test/main/source/
--
cgit v1.2.3
From 0eb4af9d3d0c524c7afdc684238aa263ac287449 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 17 May 2014 12:37:13 +0200
Subject: fix tight loop detection and temporary removes
As outlined in #748355 apt segfaulted if it encountered a loop between a
package pre-depending on a package conflicting with the previous as it
ended up in an endless loop trying to unpack 'the other package'.
In this specific case as an essential package is involved a lot of force
needs to be applied, but can also be caused by 'normal' tight loops and
highlights a problem in how we handle breaks which we want to avoid.
The fix comes in multiple entangled changes:
1. All Smart* calls are guarded with loop detection. Some already had it,
some had parts of it, some did it incorrect, and some didn't even try.
2. temporary removes to avoid a loop (which is done if a loop is
detected) prevent the unpack of this looping package (we tried to unpack
it to avoid the conflict/breaks, but due to a loop we couldn't, so we
remove/deconfigure it instead which means we can't unpack it now)
3. handle conflicts and breaks very similar instead of duplicating most
of the code. The only remaining difference is, as it should:
deconfigure is enough for breaks, for conflicts we need the big hammer
---
.../test-bug-618288-multiarch-same-lockstep | 19 ++++----
.../test-bug-673536-pre-depends-breaks-loop | 28 +++++++++---
test/integration/test-conflicts-loop | 6 ++-
test/integration/test-essential-force-loopbreak | 51 ++++++++++++++++++++++
4 files changed, 86 insertions(+), 18 deletions(-)
create mode 100755 test/integration/test-essential-force-loopbreak
(limited to 'test')
diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep
index e0305b64b..536124c2c 100755
--- a/test/integration/test-bug-618288-multiarch-same-lockstep
+++ b/test/integration/test-bug-618288-multiarch-same-lockstep
@@ -16,22 +16,23 @@ buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' ''
buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
setupaptarchive
-aptget dist-upgrade -s >output.apt 2>&1
+testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
# order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together
-LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)"
-LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' output.apt | cut -d: -f1)"
-LS_C_AMD="$(grep -o -n '^Conf libsame ' output.apt | cut -d: -f1)"
-LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' output.apt | cut -d: -f1)"
+OUTPUT=rootdir/tmp/testsuccess.output
+LS_U_AMD="$(grep -o -n '^Inst libsame ' $OUTPUT | cut -d: -f1)"
+LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' $OUTPUT | cut -d: -f1)"
+LS_C_AMD="$(grep -o -n '^Conf libsame ' $OUTPUT | cut -d: -f1)"
+LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' $OUTPUT | cut -d: -f1)"
-msgtest 'Test if libsame:amd64 unpack before configure'
+msgtest 'Test if' 'libsame:amd64 unpack before configure'
test "$LS_U_AMD" -lt "$LS_C_AMD" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack before configure'
+msgtest 'Test if' 'libsame:i386 unpack before configure'
test "$LS_U_INT" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:amd64 unpack is before libsame:i386 configure'
+msgtest 'Test if' 'libsame:amd64 unpack is before libsame:i386 configure'
test "$LS_U_AMD" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack is before libsame:amd64 configure'
+msgtest 'Test if' 'libsame:i386 unpack is before libsame:amd64 configure'
test "$LS_U_INT" -lt "$LS_C_AMD" && msgpass || msgfail
diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop
index f6a90b21f..21bd5e065 100755
--- a/test/integration/test-bug-673536-pre-depends-breaks-loop
+++ b/test/integration/test-bug-673536-pre-depends-breaks-loop
@@ -6,18 +6,32 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'native'
-buildsimplenativepackage 'basic' 'native' '1' 'stable'
+buildsimplenativepackage 'advanced' 'native' '1' 'stable'
+buildsimplenativepackage 'advanced' 'native' '2' 'unstable' 'Pre-Depends: basic'
buildsimplenativepackage 'basic' 'native' '2' 'unstable' 'Pre-Depends: common'
-buildsimplenativepackage 'common' 'native' '2' 'unstable' 'Breaks: basic (<= 1)'
+
+buildsimplenativepackage 'common' 'native' '2~conflict' 'unstable-conflict' 'Conflicts: advanced (<= 1)'
+buildsimplenativepackage 'common' 'native' '2~break' 'unstable-break' 'Conflicts: advanced (<= 1)'
setupaptarchive
# we check with 'real' packages here as the simulation reports a 'Conf broken'
# which is technical correct for the simulation, but testing errormsg is ugly
-testsuccess aptget install basic=1 -y
-testdpkginstalled basic
-testdpkgnotinstalled common
+cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
+
+testloopbreak() {
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ rm -f rootdir/var/lib/apt/extended_states
+
+
+ testsuccess aptget install advanced=1 -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled advanced
+ testdpkgnotinstalled basic common
+
+ testsuccess aptget dist-upgrade -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled advanced basic common
+}
-testsuccess aptget dist-upgrade -y
-testdpkginstalled basic common
+testloopbreak 'unstable-break'
+testloopbreak 'unstable-conflict'
diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop
index 4978fe1e8..a2c411aaf 100755
--- a/test/integration/test-conflicts-loop
+++ b/test/integration/test-conflicts-loop
@@ -20,11 +20,13 @@ Building dependency tree...
The following packages will be upgraded:
openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Remv openjdk-6-jre [6b16-1.8-0ubuntu1]
+Remv openjdk-6-jre-headless [6b16-1.8-0ubuntu1]
Remv openjdk-6-jre-lib [6b16-1.8-0ubuntu1]
-Inst openjdk-6-jre-headless [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Inst openjdk-6-jre [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Inst openjdk-6-jre-lib [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre-lib (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
+Inst openjdk-6-jre-headless [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre-headless (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])' aptget dist-upgrade -s -o APT::Immediate-Configure-All=true
+
+testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
new file mode 100755
index 000000000..842dce61c
--- /dev/null
+++ b/test/integration/test-essential-force-loopbreak
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'sysvinit' 'amd64' '1' 'Essential: yes'
+
+buildsimplenativepackage 'sysvinit' 'amd64' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
+Essential: yes'
+buildsimplenativepackage 'sysvinit-core' 'amd64' '2' 'sid'
+
+buildsimplenativepackage 'systemd-sysv' 'amd64' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
+Breaks: sysvinit-core'
+
+buildsimplenativepackage 'systemd-sysv' 'amd64' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
+
+setupaptarchive
+
+cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
+
+testforcebreak() {
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ rm -f rootdir/var/lib/apt/extended_states
+ testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ sysvinit
+The following NEW packages will be installed:
+ systemd-sysv
+The following packages will be upgraded:
+ sysvinit
+1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+E: This installation run will require temporarily removing the essential package sysvinit:amd64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
+E: Internal Error, Could not early remove sysvinit:amd64 (2)' aptget install systemd-sysv -t "$1" -s
+ # ensure that really nothing happens
+ testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled 'sysvinit'
+ testdpkgnotinstalled 'systemd-sysv'
+
+ # with enough force however …
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ testsuccess aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1 -o APT::Force-LoopBreak=1
+ testdpkginstalled 'sysvinit' 'systemd-sysv'
+}
+
+testforcebreak 'sid-conflict'
+testforcebreak 'sid-break'
--
cgit v1.2.3
From 28ba3f89659afe95fee4175d802febf895dc15a4 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 28 May 2014 09:24:58 +0200
Subject: Fix uninitialized value
Reported-By: scan-build
---
test/libapt/cdrom_test.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc
index 626ef538e..5cf3b353c 100644
--- a/test/libapt/cdrom_test.cc
+++ b/test/libapt/cdrom_test.cc
@@ -91,7 +91,7 @@ TEST(CDROMTest,ReduceSourcelist)
}
TEST(CDROMTest, FindMountPointForDevice)
{
- char * tempfile;
+ char * tempfile = NULL;
FileFd fd;
createTemporaryFile("mountpoints", fd, &tempfile,
"rootfs / rootfs rw 0 0\n"
--
cgit v1.2.3
From e1a69e71efc0679815f722480169f16bf02622ab Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 12 May 2014 21:25:43 +0200
Subject: (try to) fix travis-ci build failures
dpkg on Ubuntu 12.04 does not seem to support parsing arch-specific
dependencies, so we try to detect if we face such a dpkg in the test.
In the other test the order depends on libdb, which changes per arch, so
we just run it through our sorting binary and be happy (hopefully).
Git-Dch: Ignore
---
test/integration/framework | 3 ++-
test/integration/test-apt-ftparchive-src-cachedb | 10 +++++-----
test/integration/test-bug-747261-arch-specific-conflicts | 15 +++++++++++++++
3 files changed, 22 insertions(+), 6 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index eda3cebad..4f0a69994 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -36,7 +36,7 @@ msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
msgtest() {
while [ -n "$1" ]; do
echo -n "${CINFO}$1${CCMD} "
- echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} "
+ echo -n "$(echo "$2" | sed -e 's#^apt\([cgfs]\)#apt-\1#')${CINFO} "
shift
if [ -n "$1" ]; then shift; else break; fi
done
@@ -114,6 +114,7 @@ aptget() { runapt apt-get "$@"; }
aptftparchive() { runapt apt-ftparchive "$@"; }
aptkey() { runapt apt-key "$@"; }
aptmark() { runapt apt-mark "$@"; }
+aptsortpkgs() { runapt apt-sortpkgs "$@"; }
apt() { runapt apt "$@"; }
apthelper() { runapt "${APTHELPERBINDIR}/apt-helper" "$@"; }
aptwebserver() { runapt "${APTWEBSERVERBINDIR}/aptwebserver" "$@"; }
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index 1af193632..adcca6217 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -3,9 +3,9 @@ set -e
assert_correct_sources_file() {
testequal "Package: bar
-Binary: bar
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: bar
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -24,9 +24,9 @@ Checksums-Sha512:
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
Package: foo
-Binary: foo
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: foo
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -43,7 +43,7 @@ Checksums-Sha256:
Checksums-Sha512:
3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
-" cat ./aptarchive/dists/test/main/source/Sources
+" aptsortpkgs ./aptarchive/dists/test/main/source/Sources
}
create_source_files() {
diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts
index bfb2d089f..be971b89e 100755
--- a/test/integration/test-bug-747261-arch-specific-conflicts
+++ b/test/integration/test-bug-747261-arch-specific-conflicts
@@ -6,6 +6,21 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'amd64' 'sparc' 'armel'
+msgtest 'Check that dpkg supports' 'arch-specific dependencies'
+set +e
+# this fails always, the question is just how it fails
+dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null 2>/dev/null >/dev/null
+RETURNCODE=$?
+set -e
+if [ "$RETURNCODE" != '1' ]; then
+ dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null || true
+ echo "Command had returncode: $RETURNCODE"
+ msgskip
+ exit 0
+else
+ msgpass
+fi
+
buildsimplenativepackage 'libc6' 'amd64,sparc,armel' '1' 'stable' 'Multi-Arch: same'
buildsimplenativepackage 'libc6-i386' 'amd64' '1' 'stable' 'Conflicts: libc6:sparc'
--
cgit v1.2.3
From 1f6cf9e79742ea8e328ef2225b2f5217a9440216 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Fri, 30 May 2014 18:01:47 +0200
Subject: support parsing EDSP requests Architecture{,s} stanza
Adds also a small testcase for EDSP
Git-Dch: Ignore
---
test/integration/framework | 6 ++
.../test-external-dependency-solver-protocol | 65 ++++++++++++++++++++++
2 files changed, 71 insertions(+)
create mode 100755 test/integration/test-external-dependency-solver-protocol
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 4f0a69994..7959699fd 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -194,6 +194,12 @@ setupenvironment() {
touch var/lib/dpkg/available
mkdir -p usr/lib/apt
ln -s ${METHODSDIR} usr/lib/apt/methods
+ if [ "$BUILDDIRECTORY" = "$LIBRARYPATH" ]; then
+ mkdir -p usr/lib/apt/solvers
+ ln -s "${BUILDDIRECTORY}/apt-dump-solver" usr/lib/apt/solvers/dump
+ ln -s "${BUILDDIRECTORY}/apt-internal-solver" usr/lib/apt/solvers/apt
+ echo "Dir::Bin::Solvers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/solvers\";" > etc/apt/apt.conf.d/externalsolver.conf
+ fi
# use the autoremove from the BUILDDIRECTORY if its there, otherwise
# system
if [ -e ${BUILDDIRECTORY}/../../debian/apt.conf.autoremove ]; then
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
new file mode 100755
index 000000000..129565993
--- /dev/null
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -0,0 +1,65 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'cool' 'all' '1'
+insertinstalledpackage 'stuff' 'all' '1'
+
+insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff'
+insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
+
+insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
+insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
+insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
+
+setupaptarchive
+
+rm -f /tmp/dump.edsp
+testequal 'Reading package lists...
+Building dependency tree...
+Execute external solver...
+The solver encountered an error of type: ERR_JUST_DUMPING
+The following information might help you to understand what is wrong:
+I am too dumb, i can just dump!
+Please use one of my friends instead!
+
+E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
+testsuccess test -s /tmp/dump.edsp
+rm -f /tmp/dump.edsp
+
+#FIXME: this should be unstable, but we don't support pinning yet
+testequal 'Reading package lists...
+Building dependency tree...
+Execute external solver...
+The following NEW packages will be installed:
+ coolstuff
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
+Inst coolstuff (3 experimental [amd64])
+Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s
+
+testsuccess aptget install awesomecoolstuff:i386 -s
+testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
+
+rm -f /tmp/dump.edsp
+testfailure aptget install --solver dump awesomecoolstuff:i386 -s
+testsuccess test -s /tmp/dump.edsp
+
+configarchitecture 'armel'
+msgtest 'Test direct calling is okay for' 'apt-internal-solver'
+cat /tmp/dump.edsp | runapt apt-internal-solver > solver.result 2>&1 || true
+if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
+ msgpass
+else
+ cat solver.result
+ msgfail
+fi
+rm -f /tmp/dump.edsp
+
+testfailure aptget install --solver apt awesomecoolstuff:i386 -s
--
cgit v1.2.3
From 91a6f32eec508465e7ffafa6b3fef3bb59c719c0 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Fri, 30 May 2014 19:18:25 +0200
Subject: show current/total testcase statistic also in concise mode
Git-Dch: Ignore
---
test/integration/run-tests | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/run-tests b/test/integration/run-tests
index d700cc3fc..d39daeee5 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -39,7 +39,7 @@ fi
TOTAL="$(run-parts --list $DIR | grep '/test-' | wc -l)"
for testcase in $(run-parts --list $DIR | grep '/test-'); do
if [ "$MSGLEVEL" -le 2 ]; then
- echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
+ echo -n "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
else
echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}"
fi
--
cgit v1.2.3
From d91e3cfa1992599c088673ef68bcdfd4d0aedc85 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Fri, 30 May 2014 23:15:28 +0200
Subject: use 'native' instead of 'amd64' as pkg arch
Git-Dch: Ignore
---
test/integration/test-essential-force-loopbreak | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
index 842dce61c..d60c6cbd5 100755
--- a/test/integration/test-essential-force-loopbreak
+++ b/test/integration/test-essential-force-loopbreak
@@ -5,18 +5,18 @@ TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture 'amd64'
+configarchitecture 'native'
-insertinstalledpackage 'sysvinit' 'amd64' '1' 'Essential: yes'
+insertinstalledpackage 'sysvinit' 'native' '1' 'Essential: yes'
-buildsimplenativepackage 'sysvinit' 'amd64' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
+buildsimplenativepackage 'sysvinit' 'native' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
Essential: yes'
-buildsimplenativepackage 'sysvinit-core' 'amd64' '2' 'sid'
+buildsimplenativepackage 'sysvinit-core' 'native' '2' 'sid'
-buildsimplenativepackage 'systemd-sysv' 'amd64' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
+buildsimplenativepackage 'systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
Breaks: sysvinit-core'
-buildsimplenativepackage 'systemd-sysv' 'amd64' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
+buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
setupaptarchive
@@ -25,7 +25,7 @@ cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
testforcebreak() {
cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
rm -f rootdir/var/lib/apt/extended_states
- testequal 'Reading package lists...
+ testequal "Reading package lists...
Building dependency tree...
The following extra packages will be installed:
sysvinit
@@ -34,8 +34,8 @@ The following NEW packages will be installed:
The following packages will be upgraded:
sysvinit
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
-E: This installation run will require temporarily removing the essential package sysvinit:amd64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
-E: Internal Error, Could not early remove sysvinit:amd64 (2)' aptget install systemd-sysv -t "$1" -s
+E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
+E: Internal Error, Could not early remove sysvinit:amd64 (2)" aptget install systemd-sysv -t "$1" -s
# ensure that really nothing happens
testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1
testdpkginstalled 'sysvinit'
--
cgit v1.2.3
From a3f1d60cb75ab83f63a52a43c056a4752c8fdeb2 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 30 May 2014 14:47:56 +0200
Subject: Show unauthenticated warning for source packages as well
This will show the same unauthenticated warning for source packages
as for binary packages and will not download a source package if
it is unauthenticated. This can be overridden with
--allow-unauthenticated
Closes: #749795
---
test/integration/test-apt-get-source-authenticated | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100755 test/integration/test-apt-get-source-authenticated
(limited to 'test')
diff --git a/test/integration/test-apt-get-source-authenticated b/test/integration/test-apt-get-source-authenticated
new file mode 100755
index 000000000..2cee13923
--- /dev/null
+++ b/test/integration/test-apt-get-source-authenticated
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Regression test for debian bug #749795. Ensure that we fail with
+# a error if apt-get source foo will download a source that comes
+# from a unauthenticated repository
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+# a "normal" package with source and binary
+buildsimplenativepackage 'foo' 'all' '2.0'
+
+setupaptarchive --no-update
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+rm -f $APTARCHIVE/dists/unstable/*Release*
+
+# update without authenticated InRelease file
+testsuccess aptget update
+
+# this all should fail
+testfailure aptget install -y foo
+testfailure aptget source foo
+
+# allow overriding the warning
+testsuccess aptget source --allow-unauthenticated foo
--
cgit v1.2.3
From 243b2a381f4a12939d91084ecf100ee6d3dcb007 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 4 Jun 2014 12:39:36 +0200
Subject: Add compat mode for old (32bit FileSize) CacheDB (LP: #1274466)
---
test/integration/cachedb-lp1274466-old-format.db | Bin 0 -> 8192 bytes
test/integration/deb-lp1274466-cachedb.deb | Bin 0 -> 1270 bytes
.../test-apt-ftparchive-cachedb-lp1274466 | 51 +++++++++++++++++++++
3 files changed, 51 insertions(+)
create mode 100644 test/integration/cachedb-lp1274466-old-format.db
create mode 100644 test/integration/deb-lp1274466-cachedb.deb
create mode 100755 test/integration/test-apt-ftparchive-cachedb-lp1274466
(limited to 'test')
diff --git a/test/integration/cachedb-lp1274466-old-format.db b/test/integration/cachedb-lp1274466-old-format.db
new file mode 100644
index 000000000..88da5f1ee
Binary files /dev/null and b/test/integration/cachedb-lp1274466-old-format.db differ
diff --git a/test/integration/deb-lp1274466-cachedb.deb b/test/integration/deb-lp1274466-cachedb.deb
new file mode 100644
index 000000000..43d7ee6f1
Binary files /dev/null and b/test/integration/deb-lp1274466-cachedb.deb differ
diff --git a/test/integration/test-apt-ftparchive-cachedb-lp1274466 b/test/integration/test-apt-ftparchive-cachedb-lp1274466
new file mode 100755
index 000000000..211740a53
--- /dev/null
+++ b/test/integration/test-apt-ftparchive-cachedb-lp1274466
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+
+#
+# main()
+#
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+# gather the db and the deb, ensure mtime is not modfied as its saved in the DB
+cp -p $TESTDIR/deb-lp1274466-cachedb.deb foo_1_i386.deb
+cp $TESTDIR/cachedb-lp1274466-old-format.db old-format.db
+
+# verify that the format is different
+testsuccess aptftparchive --db new-format.db packages .
+db_dump new-format.db > new-format.dump
+db_dump old-format.db > old-format.dump
+testfailure diff -u old-format.dump new-format.dump
+
+# ensure the new format as the sha512
+testsuccess grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c new-format.dump
+# but the old format does not
+testfailure grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c old-format.dump
+
+# regression test for corruption with previous generation of cachedb
+testequal "Package: foo
+Priority: optional
+Section: others
+Installed-Size: 29
+Maintainer: Joe Sixpack
+Architecture: i386
+Version: 1
+Filename: ./foo_1_i386.deb
+Size: 1270
+MD5sum: 85d0e908c1a897700e2c5dea72d7e3c0
+SHA1: 858b09169032b7925a0e463f46b6634243fc40ce
+SHA256: 3750a2c9c6b5beee7f307564be3d51d3ec7cbb78fa4f0b47f84a7c41477bff59
+SHA512: 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c
+Description: an autogenerated dummy foo=1/test
+ If you find such a package installed on your system,
+ something went horribly wrong! They are autogenerated
+ und used only by testcases and surf no other propose…
+" aptftparchive --db old-format.db packages .
+
+# ensure that the db is updated
+db_dump old-format.db > old-format.dump
+testsuccess diff -u old-format.dump new-format.dump
+
--
cgit v1.2.3
From e41d3d7e25754f858b6dfe4dd841f4749f7f3ab1 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 7 Jun 2014 22:46:37 +0200
Subject: do not revert candidate for protected packages
In commit 21b3eac8 I promoted the check for installable dependencies to
a pre-install check, which also reverts to a known good candidate (the
installed version) if it fails. This revert was done even for user
requested candidate switches which disabled our Broken detection so that
install requests which are impossible to satisfy do not fail anymore,
but print an (incomplete) solution proposal and then exit successfully.
Closes: 745046
---
.../test-bug-745046-candidate-propagation-fails | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100755 test/integration/test-bug-745046-candidate-propagation-fails
(limited to 'test')
diff --git a/test/integration/test-bug-745046-candidate-propagation-fails b/test/integration/test-bug-745046-candidate-propagation-fails
new file mode 100755
index 000000000..e4aa67a72
--- /dev/null
+++ b/test/integration/test-bug-745046-candidate-propagation-fails
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'gedit' 'amd64' '1'
+
+insertpackage 'unstable' 'gedit' 'amd64' '1'
+insertpackage 'experimental' 'gedit' 'amd64' '2' 'Depends: common (>= 2)'
+
+setupaptarchive
+
+testequal "Reading package lists...
+Building dependency tree...
+Selected version '2' (experimental [amd64]) for 'gedit'
+Some packages could not be installed. This may mean that you have
+requested an impossible situation or if you are using the unstable
+distribution that some required packages have not yet been created
+or been moved out of Incoming.
+The following information may help to resolve the situation:
+
+The following packages have unmet dependencies:
+ gedit : Depends: common (>= 2) but it is not installable
+E: Unable to correct problems, you have held broken packages." aptget install gedit/experimental -sq=0
+
+insertinstalledpackage 'common' 'amd64' '2'
+
+testequal "Reading package lists...
+Building dependency tree...
+Selected version '2' (experimental [amd64]) for 'gedit'
+The following packages will be upgraded:
+ gedit
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst gedit [1] (2 experimental [amd64])
+Conf gedit (2 experimental [amd64])" aptget install gedit/experimental -sq=0
--
cgit v1.2.3
From 4dde2b4285fc6288e44e915a0d7bc0faac114a2e Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 10 Jun 2014 14:12:12 +0200
Subject: support Acquire::GzipIndexes in dumpavail
Closes: 742835
---
test/integration/test-compressed-indexes | 2 ++
1 file changed, 2 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 67ca0ba27..6671dd75a 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -67,6 +67,8 @@ testrun() {
msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc
msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0
rm -rf testpkg-1.0
+ testequal "$(aptcache show testpkg -o Acquire::Languages=none)
+" aptcache dumpavail
}
echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressindex
--
cgit v1.2.3
From ea606ec43a364a8e471fd9502d79fe2dfeb6e4ba Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 10 Jun 2014 15:21:30 +0200
Subject: fix test/integration/test-apt-ftparchive-cachedb-lp1274466 in travis
---
test/integration/test-apt-ftparchive-cachedb-lp1274466 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-apt-ftparchive-cachedb-lp1274466 b/test/integration/test-apt-ftparchive-cachedb-lp1274466
index 211740a53..2a28d6ef0 100755
--- a/test/integration/test-apt-ftparchive-cachedb-lp1274466
+++ b/test/integration/test-apt-ftparchive-cachedb-lp1274466
@@ -12,7 +12,7 @@ configarchitecture "i386"
# gather the db and the deb, ensure mtime is not modfied as its saved in the DB
cp -p $TESTDIR/deb-lp1274466-cachedb.deb foo_1_i386.deb
-cp $TESTDIR/cachedb-lp1274466-old-format.db old-format.db
+cp -p $TESTDIR/cachedb-lp1274466-old-format.db old-format.db
# verify that the format is different
testsuccess aptftparchive --db new-format.db packages .
@@ -45,7 +45,7 @@ Description: an autogenerated dummy foo=1/test
und used only by testcases and surf no other propose…
" aptftparchive --db old-format.db packages .
-# ensure that the db is updated
-db_dump old-format.db > old-format.dump
-testsuccess diff -u old-format.dump new-format.dump
+# ensure that the db is updated and contains the new sha512
+testsuccess grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c old-format.dump
+
--
cgit v1.2.3
From 686b484b407fdbef47d9f2064284a567b72417fe Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 11 Jun 2014 14:50:48 +0200
Subject: fix autopkgtest tests
---
test/integration/framework | 2 ++
test/integration/test-external-dependency-solver-protocol | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 7959699fd..6c9e8bd57 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -120,6 +120,7 @@ apthelper() { runapt "${APTHELPERBINDIR}/apt-helper" "$@"; }
aptwebserver() { runapt "${APTWEBSERVERBINDIR}/aptwebserver" "$@"; }
aptitude() { runapt aptitude "$@"; }
aptextracttemplates() { runapt apt-extracttemplates "$@"; }
+aptinternalsolver() { runapt "${APTINTERNALSOLVERBINDIR}/apt-internal-solver" "$@"; }
dpkg() {
command dpkg --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log "$@"
@@ -181,6 +182,7 @@ setupenvironment() {
METHODSDIR=${APT_INTEGRATION_TESTS_METHODS_DIR:-"${BUILDDIRECTORY}/methods"}
APTHELPERBINDIR=${APT_INTEGRATION_TESTS_LIBEXEC_DIR:-"${BUILDDIRECTORY}"}
APTWEBSERVERBINDIR=${APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR:-"${BUILDDIRECTORY}"}
+ APTINTERNALSOLVERBINDIR=${APT_INTEGRATION_TESTS_INTERNAL_SOLVER_DIR:-"${BUILDDIRECTORY}"}
test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first"
# -----
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 129565993..09230d383 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -53,7 +53,7 @@ testsuccess test -s /tmp/dump.edsp
configarchitecture 'armel'
msgtest 'Test direct calling is okay for' 'apt-internal-solver'
-cat /tmp/dump.edsp | runapt apt-internal-solver > solver.result 2>&1 || true
+cat /tmp/dump.edsp | aptinternalsolver > solver.result 2>&1 || true
if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
msgpass
else
--
cgit v1.2.3
From 3082603f0ef76876810cb8c6d02d03ba67ec8c6b Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 11 Jun 2014 18:17:45 +0200
Subject: fix test-apt-ftparchive-cachedb-lp1274466 and apt-internal-solver
tests
---
test/integration/framework | 4 ++--
test/integration/test-apt-ftparchive-cachedb-lp1274466 | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index 6c9e8bd57..a687dcb35 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -120,7 +120,7 @@ apthelper() { runapt "${APTHELPERBINDIR}/apt-helper" "$@"; }
aptwebserver() { runapt "${APTWEBSERVERBINDIR}/aptwebserver" "$@"; }
aptitude() { runapt aptitude "$@"; }
aptextracttemplates() { runapt apt-extracttemplates "$@"; }
-aptinternalsolver() { runapt "${APTINTERNALSOLVERBINDIR}/apt-internal-solver" "$@"; }
+aptinternalsolver() { runapt "${APTINTERNALSOLVER}" "$@"; }
dpkg() {
command dpkg --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log "$@"
@@ -182,7 +182,7 @@ setupenvironment() {
METHODSDIR=${APT_INTEGRATION_TESTS_METHODS_DIR:-"${BUILDDIRECTORY}/methods"}
APTHELPERBINDIR=${APT_INTEGRATION_TESTS_LIBEXEC_DIR:-"${BUILDDIRECTORY}"}
APTWEBSERVERBINDIR=${APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR:-"${BUILDDIRECTORY}"}
- APTINTERNALSOLVERBINDIR=${APT_INTEGRATION_TESTS_INTERNAL_SOLVER_DIR:-"${BUILDDIRECTORY}"}
+ APTINTERNALSOLVER=${APT_INTEGRATION_TESTS_INTERNAL_SOLVER:-"${BUILDDIRECTORY}/apt-internal-solver"}
test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first"
# -----
diff --git a/test/integration/test-apt-ftparchive-cachedb-lp1274466 b/test/integration/test-apt-ftparchive-cachedb-lp1274466
index 2a28d6ef0..579ae33a6 100755
--- a/test/integration/test-apt-ftparchive-cachedb-lp1274466
+++ b/test/integration/test-apt-ftparchive-cachedb-lp1274466
@@ -46,6 +46,8 @@ Description: an autogenerated dummy foo=1/test
" aptftparchive --db old-format.db packages .
# ensure that the db is updated and contains the new sha512
+db_dump old-format.db > old-format.dump
+
testsuccess grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c old-format.dump
--
cgit v1.2.3
From eb197ed71b1535f3c1715c8a751485ef927b51b7 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 12 Jun 2014 10:09:24 +0200
Subject: test/integration/test-essential-force-loopbreak: fix on non-amd64
systems
---
test/integration/test-essential-force-loopbreak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'test')
diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
index d60c6cbd5..ac8fc6d28 100755
--- a/test/integration/test-essential-force-loopbreak
+++ b/test/integration/test-essential-force-loopbreak
@@ -35,7 +35,7 @@ The following packages will be upgraded:
sysvinit
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
-E: Internal Error, Could not early remove sysvinit:amd64 (2)" aptget install systemd-sysv -t "$1" -s
+E: Internal Error, Could not early remove sysvinit:$(dpkg --print-architecture) (2)" aptget install systemd-sysv -t "$1" -s
# ensure that really nothing happens
testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1
testdpkginstalled 'sysvinit'
--
cgit v1.2.3
From 224dc038412459a5f64d4e7a16845847b7797a67 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 17 Jun 2014 16:55:19 +0200
Subject: fix SubstVar to be usable as a replace_all method
The name suggests that it is supposed to substitute a variable with a
value, but we tend to use it in a more liberal replace_all() fashion,
but this breaks if either of the parameters is empty or more importantly
if two "variable" occurrences follow each other directly.
---
test/libapt/strutil_test.cc | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
(limited to 'test')
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index bc004fd66..e9b778c6b 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -70,3 +70,38 @@ TEST(StrUtilTest,EndsWith)
EXPECT_FALSE(Endswith("abcd", "x"));
EXPECT_FALSE(Endswith("abcd", "abcndefg"));
}
+TEST(StrUtilTest,SubstVar)
+{
+ EXPECT_EQ("", SubstVar("", "fails", "passes"));
+ EXPECT_EQ("test ", SubstVar("test fails", "fails", ""));
+ EXPECT_EQ("test passes", SubstVar("test passes", "", "fails"));
+
+ EXPECT_EQ("test passes", SubstVar("test passes", "fails", "passes"));
+ EXPECT_EQ("test passes", SubstVar("test fails", "fails", "passes"));
+
+ EXPECT_EQ("starts with", SubstVar("beginnt with", "beginnt", "starts"));
+ EXPECT_EQ("beginnt with", SubstVar("starts with", "starts", "beginnt"));
+ EXPECT_EQ("is in middle", SubstVar("is in der middle", "in der", "in"));
+ EXPECT_EQ("is in der middle", SubstVar("is in middle", "in", "in der"));
+ EXPECT_EQ("does end", SubstVar("does enden", "enden", "end"));
+ EXPECT_EQ("does enden", SubstVar("does end", "end", "enden"));
+
+ EXPECT_EQ("abc", SubstVar("abc", "d", "a"));
+ EXPECT_EQ("abc", SubstVar("abd", "d", "c"));
+ EXPECT_EQ("abc", SubstVar("adc", "d", "b"));
+ EXPECT_EQ("abc", SubstVar("dbc", "d", "a"));
+
+ EXPECT_EQ("b", SubstVar("b", "aa", "a"));
+ EXPECT_EQ("bb", SubstVar("bb", "aa", "a"));
+ EXPECT_EQ("bbb", SubstVar("bbb", "aa", "a"));
+
+ EXPECT_EQ("aa", SubstVar("aaaa", "aa", "a"));
+ EXPECT_EQ("aaaa", SubstVar("aa", "a", "aa"));
+ EXPECT_EQ("aaaa", SubstVar("aaaa", "a", "a"));
+ EXPECT_EQ("a a a a ", SubstVar("aaaa", "a", "a "));
+
+ EXPECT_EQ(" bb bb bb bb ", SubstVar(" a a a a ", "a", "bb"));
+ EXPECT_EQ(" bb bb bb bb ", SubstVar(" aaa aaa aaa aaa ", "aaa", "bb"));
+ EXPECT_EQ(" bb a bb a bb a bb ", SubstVar(" aaa a aaa a aaa a aaa ", "aaa", "bb"));
+
+}
--
cgit v1.2.3
From 172947cd7dc5c88c94c6ad269dc6c6be002ee958 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 17 Jun 2014 19:05:53 +0200
Subject: do not call resolver twice on (dist-)upgrade
---
test/integration/test-external-dependency-solver-protocol | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 09230d383..07d2441b6 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -51,6 +51,12 @@ rm -f /tmp/dump.edsp
testfailure aptget install --solver dump awesomecoolstuff:i386 -s
testsuccess test -s /tmp/dump.edsp
+testsuccess aptget dist-upgrade -s
+testsuccess aptget dist-upgrade -s --solver apt
+
+testsuccess aptget upgrade -s
+testsuccess aptget upgrade -s --solver apt
+
configarchitecture 'armel'
msgtest 'Test direct calling is okay for' 'apt-internal-solver'
cat /tmp/dump.edsp | aptinternalsolver > solver.result 2>&1 || true
--
cgit v1.2.3
From 4f445ff78220568e0fcfa373ba1b06e0ad13e63d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michele=20Orr=C3=B9?=
Date: Mon, 7 Jul 2014 20:43:45 +0200
Subject: use exit instead of incorrect return in test wrapper
bash as sh doesn't like it, too.
Git-Dch: Ignore
---
test/integration/test-dpkg-assert-multi-arch | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch
index 177d7489b..e6be6ac7d 100755
--- a/test/integration/test-dpkg-assert-multi-arch
+++ b/test/integration/test-dpkg-assert-multi-arch
@@ -32,7 +32,7 @@ echo '#! /bin/sh
if echo "$*" | grep -q -- "--assert-multi-arch"; then
echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
- return 2;
+ exit 2;
fi
return $*' > ./dpkg-wrapper
chmod +x ./dpkg-wrapper
@@ -68,9 +68,10 @@ touch rootdir/var/lib/dpkg/status
echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
echo '#! /bin/sh
if echo "$*" | grep -q -- "--assert-multi-arch"; then
- return 0;
-fi
-return $*' > ./dpkg-wrapper
+ exit 0
+else
+ exit 1
+fi' > ./dpkg-wrapper
testqualifier 'native-pkg' 'native-pkg:amd64'
testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
--
cgit v1.2.3
From eb191ca3584816533e82cd6b8cd1f133ae28149a Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 7 Jul 2014 20:45:28 +0200
Subject: properly handle (currently unused) dpkg pass-through
Git-Dch: ignore
---
test/integration/test-dpkg-assert-multi-arch | 29 +++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
(limited to 'test')
diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch
index e6be6ac7d..b3fbbf0eb 100755
--- a/test/integration/test-dpkg-assert-multi-arch
+++ b/test/integration/test-dpkg-assert-multi-arch
@@ -26,15 +26,17 @@ testqualifier() {
fi
}
-# non-multiarch or "ubuntus" old multiarchified dpkg
+msgmsg 'non-multiarch or "ubuntus" old multiarchified dpkg'
echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
-echo '#! /bin/sh
-if echo "$*" | grep -q -- "--assert-multi-arch"; then
+cat > ./dpkg-wrapper <&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
- exit 2;
+ exit 2
fi
-return $*' > ./dpkg-wrapper
+exec "\$@"
+EOF
chmod +x ./dpkg-wrapper
testqualifier 'native-pkg' 'native-pkg'
@@ -61,17 +63,18 @@ testqualifier 'all-foreign-pkg-' 'all-foreign-pkg'
testqualifier 'always-all-pkg-' 'always-all-pkg'
testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg'
-# multiarch dpkg (new interface version)
-
+msgmsg 'multiarch dpkg (new interface version)'
rm rootdir/var/lib/dpkg/status
touch rootdir/var/lib/dpkg/status
echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
-echo '#! /bin/sh
-if echo "$*" | grep -q -- "--assert-multi-arch"; then
- exit 0
-else
- exit 1
-fi' > ./dpkg-wrapper
+cat > ./dpkg-wrapper <
Date: Mon, 7 Jul 2014 20:48:16 +0200
Subject: use printf instead of echo in testing framework
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The behaviour of echo "\tA\t" differs between dash/zsh which interprets
the \t as tab and bash which prints it literally. Similar things happen
for other escape sequences – without the -e flag.
Switching to printf makes this more painless^Wportable, so that the
tests are also working correctly with bash as sh.
(commit message by committer, patch otherwise unmodified)
---
test/integration/framework | 58 +++++++++++++++++++++++-----------------------
test/integration/run-tests | 4 ++--
2 files changed, 31 insertions(+), 31 deletions(-)
(limited to 'test')
diff --git a/test/integration/framework b/test/integration/framework
index a687dcb35..3bbf440c8 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -23,30 +23,30 @@ if [ "$MSGCOLOR" != 'NO' ]; then
CCMD="\033[1;35m" # pink
fi
-msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; }
-msgwarn() { echo "${CWARNING}W: $1${CNORMAL}" >&2; }
-msgmsg() { echo "${CMSG}$1${CNORMAL}"; }
-msginfo() { echo "${CINFO}I: $1${CNORMAL}"; }
-msgdebug() { echo "${CDEBUG}D: $1${CNORMAL}"; }
-msgdone() { echo "${CDONE}DONE${CNORMAL}"; }
-msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; }
-msgnmsg() { echo -n "${CMSG}$1${CNORMAL}"; }
-msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}"; }
-msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
+msgdie() { printf "${CERROR}E: $1${CNORMAL}\n" >&2; exit 1; }
+msgwarn() { printf "${CWARNING}W: $1${CNORMAL}\n" >&2; }
+msgmsg() { printf "${CMSG}$1${CNORMAL}\n"; }
+msginfo() { printf "${CINFO}I: $1${CNORMAL}\n"; }
+msgdebug() { printf "${CDEBUG}D: $1${CNORMAL}\n"; }
+msgdone() { printf "${CDONE}DONE${CNORMAL}\n"; }
+msgnwarn() { printf "${CWARNING}W: $1${CNORMAL}" >&2; }
+msgnmsg() { printf "${CMSG}$1${CNORMAL}"; }
+msgninfo() { printf "${CINFO}I: $1${CNORMAL}"; }
+msgndebug() { printf "${CDEBUG}D: $1${CNORMAL}"; }
msgtest() {
while [ -n "$1" ]; do
- echo -n "${CINFO}$1${CCMD} "
- echo -n "$(echo "$2" | sed -e 's#^apt\([cgfs]\)#apt-\1#')${CINFO} "
+ printf "${CINFO}$1${CCMD} "
+ printf -- "$(echo "$2" | sed -e 's#^apt\([cgfs]\)#apt-\1#')${CINFO} "
shift
if [ -n "$1" ]; then shift; else break; fi
done
- echo -n "…${CNORMAL} "
+ printf "…${CNORMAL} "
}
-msgpass() { echo "${CPASS}PASS${CNORMAL}"; }
-msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
+msgpass() { printf "${CPASS}PASS${CNORMAL}\n"; }
+msgskip() { printf "${CWARNING}SKIP${CNORMAL}\n" >&2; }
msgfail() {
- if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2;
- else echo "${CFAIL}FAIL${CNORMAL}" >&2; fi
+ if [ $# -gt 0 ]; then printf "${CFAIL}FAIL: $*${CNORMAL}\n" >&2;
+ else printf "${CFAIL}FAIL${CNORMAL}\n" >&2; fi
EXIT_CODE=$((EXIT_CODE+1));
}
@@ -63,12 +63,12 @@ if [ $MSGLEVEL -le 2 ]; then
msgmsg() { true; }
msgnmsg() { true; }
msgtest() { true; }
- msgpass() { echo -n " ${CPASS}P${CNORMAL}"; }
- msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
+ msgpass() { printf " ${CPASS}P${CNORMAL}"; }
+ msgskip() { printf " ${CWARNING}S${CNORMAL}" >&2; }
if [ -n "$CFAIL" ]; then
- msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
+ msgfail() { printf " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
else
- msgfail() { echo -n " ###FAILED###" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
+ msgfail() { printf " ###FAILED###" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
fi
fi
if [ $MSGLEVEL -le 3 ]; then
@@ -87,7 +87,7 @@ msgdone() {
[ "$1" = "die" -a $MSGLEVEL -le 0 ]; then
true;
else
- echo "${CDONE}DONE${CNORMAL}";
+ printf "${CDONE}DONE${CNORMAL}\n";
fi
}
getaptconfig() {
@@ -155,7 +155,7 @@ exitwithstatus() {
shellsetedetector() {
local exit_status=$?
if [ "$exit_status" != '0' ]; then
- echo >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}"
+ printf >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}\n"
if [ "$EXIT_CODE" = '0' ]; then
EXIT_CODE="$exit_status"
fi
@@ -328,12 +328,12 @@ configdpkg() {
configcompression() {
while [ -n "$1" ]; do
case "$1" in
- '.') echo ".\t.\tcat";;
- 'gz') echo "gzip\tgz\tgzip";;
- 'bz2') echo "bzip2\tbz2\tbzip2";;
- 'lzma') echo "lzma\tlzma\txz --format=lzma";;
- 'xz') echo "xz\txz\txz";;
- *) echo "$1\t$1\t$1";;
+ '.') printf ".\t.\tcat\n";;
+ 'gz') printf "gzip\tgz\tgzip\n";;
+ 'bz2') printf "bzip2\tbz2\tbzip2\n";;
+ 'lzma') printf "lzma\tlzma\txz --format=lzma\n";;
+ 'xz') printf "xz\txz\txz\n";;
+ *) printf "$1\t$1\t$1\n";;
esac
shift
done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf
diff --git a/test/integration/run-tests b/test/integration/run-tests
index d39daeee5..9dd550aa2 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -39,9 +39,9 @@ fi
TOTAL="$(run-parts --list $DIR | grep '/test-' | wc -l)"
for testcase in $(run-parts --list $DIR | grep '/test-'); do
if [ "$MSGLEVEL" -le 2 ]; then
- echo -n "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
+ printf "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
else
- echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}"
+ printf "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}\n"
fi
if ! ${testcase}; then
FAIL=$((FAIL+1))
--
cgit v1.2.3
From a034d8528bc98e9caf12e024a0d5eeb25f87a500 Mon Sep 17 00:00:00 2001
From: Guillem Jover
Date: Wed, 2 Jul 2014 04:10:37 +0200
Subject: build: Convert from DebianDoc SGML to DocBook XML
---
test/Makefile | 2 +-
test/libapt/parsedepends_test.cc | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'test')
diff --git a/test/Makefile b/test/Makefile
index 74bffccb7..35a0a51e3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -7,7 +7,7 @@ ifndef NOISY
endif
.PHONY: startup headers library clean veryclean all binary program doc test update-po
-startup all clean veryclean binary program dirs test update-po manpages debiandoc:
+startup all clean veryclean binary program dirs test update-po manpages docbook:
$(MAKE) -C libapt $@
$(MAKE) -C interactive-helper $@
diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc
index 1e0afb66c..52eac8232 100644
--- a/test/libapt/parsedepends_test.cc
+++ b/test/libapt/parsedepends_test.cc
@@ -23,7 +23,7 @@ static void parseDependency(bool const StripMultiArch, bool const ParseArchFlag
"libdb-dev:any, "
"gettext:native (<= 0.12), "
"libcurl4-gnutls-dev:native | libcurl3-gnutls-dev (>> 7.15.5), "
- "debiandoc-sgml, "
+ "docbook-xml, "
"apt (>= 0.7.25), "
"not-for-me [ !amd64 ], "
"only-for-me [ amd64 ], "
@@ -82,7 +82,7 @@ static void parseDependency(bool const StripMultiArch, bool const ParseArchFlag
EXPECT_EQ(Null | pkgCache::Dep::Greater, Op);
Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList);
- EXPECT_EQ("debiandoc-sgml", Package);
+ EXPECT_EQ("docbook-xml", Package);
EXPECT_EQ("", Version);
EXPECT_EQ(Null | pkgCache::Dep::NoOp, Op);
--
cgit v1.2.3
From a5bb5e1e747ceb7b5a9defb6b1a8d9282a6e0957 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 8 Jul 2014 15:11:14 +0200
Subject: Only allow "apt-get build-dep path" when path starts with ./ or /
This avoid the subtle problem that someone might have a directory
with the same package name as the build-depends he/she is trying
to fetch. Also print a note that the specific file/dir is used.
---
test/integration/test-apt-get-build-dep | 3 +++
test/libapt/strutil_test.cc | 9 +++++++++
2 files changed, 12 insertions(+)
(limited to 'test')
diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep
index f71beae9c..87ec6e54d 100755
--- a/test/integration/test-apt-get-build-dep
+++ b/test/integration/test-apt-get-build-dep
@@ -34,6 +34,7 @@ EOF
testequal "Reading package lists...
Building dependency tree...
+Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
The following NEW packages will be installed:
build-essential debhelper
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
@@ -76,6 +77,7 @@ EOF
testequal "Reading package lists...
Building dependency tree...
+Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
The following NEW packages will be installed:
build-essential debhelper
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
@@ -117,6 +119,7 @@ EOF
testequal "Reading package lists...
Building dependency tree...
+Note, using directory './foo-1.0' to get the build dependencies
The following NEW packages will be installed:
build-essential debhelper
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index e9b778c6b..1c2f0abac 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -70,6 +70,15 @@ TEST(StrUtilTest,EndsWith)
EXPECT_FALSE(Endswith("abcd", "x"));
EXPECT_FALSE(Endswith("abcd", "abcndefg"));
}
+TEST(StrUtilTest,StartWith)
+{
+ using APT::String::Startswith;
+ EXPECT_TRUE(Startswith("abcd", "a"));
+ EXPECT_TRUE(Startswith("abcd", "ab"));
+ EXPECT_TRUE(Startswith("abcd", "abcd"));
+ EXPECT_FALSE(Startswith("abcd", "x"));
+ EXPECT_FALSE(Startswith("abcd", "abcndefg"));
+}
TEST(StrUtilTest,SubstVar)
{
EXPECT_EQ("", SubstVar("", "fails", "passes"));
--
cgit v1.2.3
From 08be0ca32ad69e9ebf28fe26aa85990700c81cf6 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 16 Jul 2014 13:57:50 +0200
Subject: StringToBool: only act if the entire string is consumed by strtol()
StringToBool uses strtol() internally to check if the argument is
a number. This function stops when it does not find any more numbers.
So a string like "0ad" (which is a valid packagename) is interpreted
as a "0". The code now checks that the entire string is consumed
not just a part of it. Thanks to Johannes Schauer for raising this
issue.
---
test/libapt/commandline_test.cc | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
(limited to 'test')
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
index 26e80bfde..e403a28c8 100644
--- a/test/libapt/commandline_test.cc
+++ b/test/libapt/commandline_test.cc
@@ -56,3 +56,32 @@ TEST(CommandLineTest,Parsing)
EXPECT_TRUE(c.FindB("Test::Worked", false));
EXPECT_FALSE(c.FindB("Test::Zero", false));
}
+
+TEST(CommandLineTest, BoolParsing)
+{
+ CommandLine::Args Args[] = {
+ { 't', 0, "Test::Worked", 0 },
+ {0,0,0,0}
+ };
+ ::Configuration c;
+ CommandLine CmdL(Args, &c);
+
+ // the commandline parser used to use strtol() on the argument
+ // to check if the argument is a boolean expression - that
+ // stopped after the "0". this test ensures that we always check
+ // that the entire string was consumed by strtol
+ {
+ char const * argv[] = { "show", "-t", "0ad" };
+ bool res = CmdL.Parse(sizeof(argv)/sizeof(char*), argv);
+ EXPECT_TRUE(res);
+ ASSERT_EQ(std::string(CmdL.FileList[0]), "0ad");
+ }
+
+ {
+ char const * argv[] = { "show", "-t", "0", "ad" };
+ bool res = CmdL.Parse(sizeof(argv)/sizeof(char*), argv);
+ EXPECT_TRUE(res);
+ ASSERT_EQ(std::string(CmdL.FileList[0]), "ad");
+ }
+
+}
--
cgit v1.2.3
From 9c3e15ab5f8b5864c43a08065a6bc8cf376fd138 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 16 Jul 2014 15:48:05 +0200
Subject: Do not crash for apt-get install /dev/null
Thanks to Jakub Wilk for the bugreport.
Closes: #754904
---
test/integration/test-apt-get-install-deb | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100755 test/integration/test-apt-get-install-deb
(limited to 'test')
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb
new file mode 100755
index 000000000..700009da5
--- /dev/null
+++ b/test/integration/test-apt-get-install-deb
@@ -0,0 +1,30 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+# regression test for #754904
+testequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null
+
+# and ensure we fail for invalid debs
+cat > foo.deb <
Date: Fri, 18 Jul 2014 23:41:29 +0200
Subject: add pkgAcquire::TransactionHasError()
---
test/integration/test-apt-update-transactions | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100755 test/integration/test-apt-update-transactions
(limited to 'test')
diff --git a/test/integration/test-apt-update-transactions b/test/integration/test-apt-update-transactions
new file mode 100755
index 000000000..ee8d20dbf
--- /dev/null
+++ b/test/integration/test-apt-update-transactions
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+
+setupaptarchive --no-update
+changetowebserver
+
+# break package file
+cat > aptarchive/dists/unstable/main/binary-i386/Packages <
Date: Mon, 21 Jul 2014 11:19:37 +0200
Subject: Download Release first, then Release.gpg
The old way of handling this was that pkgAcqMetaIndex was responsible
to check/move both Release and Release.gpg in place. This breaks
the assumption of the transaction that each pkgAcquire::Item has
a single File that its responsible for.
---
test/integration/test-apt-update-transactions | 1 +
1 file changed, 1 insertion(+)
(limited to 'test')
diff --git a/test/integration/test-apt-update-transactions b/test/integration/test-apt-update-transactions
index ee8d20dbf..247334991 100755
--- a/test/integration/test-apt-update-transactions
+++ b/test/integration/test-apt-update-transactions
@@ -21,3 +21,4 @@ compressfile aptarchive/dists/unstable/main/binary-i386/Packages '+1hour'
# ensure that a update will only succeed entirely or not at all
testfailure aptget update
testequal "partial" ls rootdir/var/lib/apt/lists
+
--
cgit v1.2.3
From 2f58969150b0daec1de407f61385ccf5b2065aa3 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Tue, 29 Jul 2014 15:01:13 +0200
Subject: Fix SmartConfigure to ignore ordering of packages that are already
valid
With the change of SmartConfigure() in git commit 42d51f the ordering
code was trying to re-order dependencies, even when at this point in
time this was not needed. Now it will first check all targets of the
given dependency and only if there is not a good one try to reorder
and unpack/configure as needed.
Closes: LP: #1347721
---
.../Packages-bug-lp1347721-dpkg-ordering | 445 +++++
.../integration/status-bug-lp1347721-dpkg-ordering | 1942 ++++++++++++++++++++
test/integration/test-bug-lp1347721-dpkg-ordering | 11 +
3 files changed, 2398 insertions(+)
create mode 100644 test/integration/Packages-bug-lp1347721-dpkg-ordering
create mode 100644 test/integration/status-bug-lp1347721-dpkg-ordering
create mode 100755 test/integration/test-bug-lp1347721-dpkg-ordering
(limited to 'test')
diff --git a/test/integration/Packages-bug-lp1347721-dpkg-ordering b/test/integration/Packages-bug-lp1347721-dpkg-ordering
new file mode 100644
index 000000000..ea96b387c
--- /dev/null
+++ b/test/integration/Packages-bug-lp1347721-dpkg-ordering
@@ -0,0 +1,445 @@
+Package: init
+xEssential: yes
+Priority: required
+Section: metapackages
+Installed-Size: 29
+Maintainer: Ubuntu Developers
+Original-Maintainer: pkg-systemd-maintainers
+Architecture: i386
+Source: init-system-helpers
+Version: 1.20
+Pre-Depends: sysvinit-core | systemd-sysv | upstart
+Filename: pool/main/i/init-system-helpers/init_1.20_i386.deb
+Size: 3494
+MD5sum: a388b6f4f6ed0d01b3d459cfad6582fe
+SHA1: d0eb6414a6bb48bb886fcc19962f6a7f302977f3
+SHA256: 9f299b2bf18d6e4534f3a73cca97ef93850e1b5fa38f8519da7c2b825d581f4c
+Description: System-V-like init utilities - metapackage
+Description-md5: e52554c23609041bfbca72fe27a132f9
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+
+Package: libudev1
+Priority: required
+Section: libs
+Installed-Size: 132
+Maintainer: Ubuntu Developers
+Original-Maintainer: Debian systemd Maintainers
+Architecture: i386
+Source: systemd
+Version: 208-6ubuntu2
+Depends: libc6 (>= 2.17), libselinux1 (>= 1.32)
+Pre-Depends: multiarch-support
+Filename: pool/main/s/systemd/libudev1_208-6ubuntu2_i386.deb
+Size: 36008
+MD5sum: b03338c052438a95919b9db4d6f9493e
+SHA1: a85242bfc653255b5fa73d0fbec92815dc9c09fc
+SHA256: d66d7948703b33bd617e16a1b9ac6f24ca564312890b1f9218330f638080a307
+Description: libudev shared library
+Multi-Arch: same
+Homepage: http://www.freedesktop.org/wiki/Software/systemd
+Description-md5: ace5b83d7b48187416c90173a93255b6
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: udev
+Priority: required
+Section: admin
+Installed-Size: 5879
+Maintainer: Ubuntu Developers
+Original-Maintainer: Debian systemd Maintainers
+Architecture: i386
+Source: systemd
+Version: 208-6ubuntu2
+Depends: libacl1 (>= 2.2.51-8), libblkid1 (>= 2.19.1), libc6 (>= 2.17), libkmod2 (>= 5~), libselinux1 (>= 2.0.65), libudev1 (= 208-6ubuntu2), lsb-base (>= 4.1+Debian11ubuntu7), util-linux (>= 2.16), procps
+Pre-Depends: debconf (>= 1.4.69) | debconf-2.0
+Breaks: consolekit (<< 0.4.6-1)
+Filename: pool/main/s/systemd/udev_208-6ubuntu2_i386.deb
+Size: 799582
+MD5sum: 814bb3babdbe76994ce536384ca31f88
+SHA1: bbb662c89f2b1ff4fd450d1523cc21b5b1c339bc
+SHA256: e444350214c5c121b2ca8031f76c53809f95ebb5c4cec4cf4595c7520ac09529
+Description: /dev/ and hotplug management daemon
+Multi-Arch: foreign
+Homepage: http://www.freedesktop.org/wiki/Software/systemd
+Description-md5: e875ddb09f46f1f7672af537f0c875ca
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: initscripts
+Priority: required
+Section: admin
+Installed-Size: 246
+Maintainer: Ubuntu Core Developers
+Original-Maintainer: Debian sysvinit maintainers
+Architecture: i386
+Source: sysvinit
+Version: 2.88dsf-41ubuntu16
+Replaces: libc0.1, libc0.3, libc6, libc6.1
+Depends: libc6 (>= 2.4), mount (>= 2.11x-1), debianutils (>= 4), lsb-base (>= 4.1+Debian11ubuntu7), sysvinit-utils (>= 2.86.ds1-64), sysv-rc | file-rc, coreutils (>= 5.93), passwd, init, mountall (>= 2.28)
+Recommends: psmisc, e2fsprogs
+Conflicts: libdevmapper1.02.1 (<< 2:1.02.24-1)
+Breaks: aide (<< 0.15.1-5), atm-tools (<< 1:2.5.1-1.3), bootchart (<< 0.10~svn407-3.3), console-common (<< 0.7.86), cruft (<< 0.9.16), eepc-acpi-scripts (<< 1.1.12), fcheck (<< 2.7.59-16), hostapd (<< 1:0.7.3-3), hostname (<< 2.95ubuntu1~boot2), ifupdown (<< 0.6.8ubuntu27), libpam-mount (<< 2.13-1), ltsp-client-core (<< 5.2.16-1), mdadm (<< 3.2.2-1), nbd-client (<< 1:2.9.23-1), nfs-common (<< 1:1.2.5-3), portmap (<< 6.0.0-2), readahead-fedora (<< 2:1.5.6-3), resolvconf (<< 1.49), rpcbind (<< 0.2.0-7), rsyslog (<< 5.8.2-2), selinux-policy-default (<= 2:0.2.20100524-9), splashy (<< 0.3.13-5.1+b1), sysklogd (<< 1.5-6.2), udev (<< 146-2~boot6), upstart (<< 0.6.3-2~boot4), wpasupplicant (<< 0.7.3-4), xymon (<< 4.3.0~beta2.dfsg-9)
+Filename: pool/main/s/sysvinit/initscripts_2.88dsf-41ubuntu16_i386.deb
+Size: 35150
+MD5sum: e78f1e7816f03ded97eacd469505ea45
+SHA1: 81f88f9258c680e9983316d75baff7572ecec75c
+SHA256: 996e4d86486cbe12a7b7852ec1a9fe459dbf0afab51dc13bd701b6d970fdc14a
+Description: scripts for initializing and shutting down the system
+Multi-Arch: foreign
+Homepage: http://savannah.nongnu.org/projects/sysvinit
+Description-md5: db9003c179cd2a623493209da58ea2ea
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: libc6
+Priority: required
+Section: libs
+Installed-Size: 9284
+Maintainer: Ubuntu Developers
+Original-Maintainer: GNU Libc Maintainers
+Architecture: i386
+Source: glibc
+Version: 2.19-4ubuntu1
+Replaces: libc6-i386, libc6-xen
+Provides: glibc-2.19-1, libc6-i686, libc6-xen
+Depends: libgcc1
+Suggests: glibc-doc, debconf | debconf-2.0, locales
+Conflicts: libc6-xen, prelink (<= 0.0.20090311-1), tzdata (<< 2007k-1), tzdata-etch
+Breaks: hurd (<< 1:0.5.git20140203-1), libtirpc1 (<< 0.2.3), nscd (<< 2.19)
+Filename: pool/main/g/glibc/libc6_2.19-4ubuntu1_i386.deb
+Size: 4012440
+MD5sum: 946665711bb0294bd2c7729b3174ba8b
+SHA1: 063e268e0d1e368e218d450a4bd2af7608b5e38e
+SHA256: 0e33f5c3b6da3a6ec52fb0274abfa0da5489808feb220b6e6640432cb84f948f
+Description: GNU C Library: Shared libraries
+Multi-Arch: same
+Homepage: http://www.gnu.org/software/libc/libc.html
+Description-md5: fc3001b0b90a1c8e6690b283a619d57f
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: libmount1
+Priority: required
+Section: libs
+Installed-Size: 253
+Maintainer: Ubuntu Developers
+Original-Maintainer: LaMont Jones
+Architecture: i386
+Source: util-linux
+Version: 2.20.1-5.1ubuntu21
+Depends: libblkid1 (>= 2.17.2), libc6 (>= 2.8), libselinux1 (>= 1.32)
+Pre-Depends: multiarch-support
+Filename: pool/main/u/util-linux/libmount1_2.20.1-5.1ubuntu21_i386.deb
+Size: 60156
+MD5sum: d17af590ad06ac914a1024d54184cee6
+SHA1: 6eb2a281c409bd5181ce6b871795f8e4609565bc
+SHA256: 78ce54b9f644c365b95a7230e1e50762d628c9d0d3549211017a98d4cb5013c4
+Description: block device id library
+Multi-Arch: same
+Homepage: http://userweb.kernel.org/~kzak/util-linux/
+Description-md5: 8f605597a2fb2fd7bffd09db537dd040
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: libplymouth4
+Priority: required
+Section: libs
+Installed-Size: 315
+Maintainer: Ubuntu Developers
+Architecture: i386
+Source: plymouth
+Version: 0.9.0-0ubuntu2
+Replaces: plymouth (<< 0.7.0+git20090207-0ubuntu0.1~ppa4)
+Depends: libc6 (>= 2.9), libpng12-0 (>= 1.2.13-4), libudev1 (>= 183)
+Pre-Depends: multiarch-support
+Breaks: casper (= 1.227), mountall (<< 2.8)
+Filename: pool/main/p/plymouth/libplymouth4_0.9.0-0ubuntu2_i386.deb
+Size: 85024
+MD5sum: 8d9e7001ba371bd802956de1e81d1997
+SHA1: 749bdaee4d8bd4c2383c703eb244caa473180d35
+SHA256: 59bd4492b6e71eee5c13ba9c63da12ece49c43106829556722ca503867ce7251
+Description: graphical boot animation and logger - shared libraries
+Multi-Arch: same
+Description-md5: 29e2ed45f3e127c38b58dae52061cc33
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: libprocps3
+Priority: required
+Section: libs
+Installed-Size: 133
+Maintainer: Ubuntu Developers
+Original-Maintainer: Craig Small
+Architecture: i386
+Source: procps
+Version: 1:3.3.9-1ubuntu5
+Replaces: procps (<< 1:3.3.2-1)
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Filename: pool/main/p/procps/libprocps3_3.3.9-1ubuntu5_i386.deb
+Size: 30078
+MD5sum: 0df60f591dfe64ed23bb1f3a1546c0ce
+SHA1: db672ec37e88574bf1a1d5484d80cfd4ff04f9f6
+SHA256: b5df28501805a6833dc78e049159a7c560af6f24f18f51459bd8890c31e0fdc6
+Description: library for accessing process information from /proc
+Multi-Arch: same
+Homepage: http://gitorious.org/procps
+Description-md5: 195f4a1a493350f6f0732a65b3cda83f
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: libudev1
+Priority: required
+Section: libs
+Installed-Size: 131
+Maintainer: Ubuntu Developers
+Original-Maintainer: Debian systemd Maintainers
+Architecture: i386
+Source: systemd
+Version: 204-14ubuntu2
+Depends: libc6 (>= 2.17), libcgmanager0, libdbus-1-3 (>= 1.0.2), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0)
+Pre-Depends: multiarch-support
+Filename: pool/main/s/systemd/libudev1_204-14ubuntu2_i386.deb
+Size: 35518
+MD5sum: a606f9e4aab028b9ab658b6e8a09d5fb
+SHA1: ef28d377e6cc8f1e98dd9cd8c40edda90e2eed20
+SHA256: c02c85725f64b6c804235329166bf66e40da948d96123336ec55e13e1654720f
+Description: libudev shared library
+Multi-Arch: same
+Homepage: http://www.freedesktop.org/wiki/Software/systemd
+Description-md5: ace5b83d7b48187416c90173a93255b6
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: lsb-base
+Priority: required
+Section: misc
+Installed-Size: 83
+Maintainer: Ubuntu Developers
+Original-Maintainer: Debian LSB Team
+Architecture: all
+Source: lsb
+Version: 4.1+Debian11ubuntu8
+Replaces: upstart (<< 1.12.1-0ubuntu8)
+Breaks: upstart (<< 1.12.1-0ubuntu8)
+Filename: pool/main/l/lsb/lsb-base_4.1+Debian11ubuntu8_all.deb
+Size: 13094
+MD5sum: 9ec51f910e6d8e86bfb489b71b237e66
+SHA1: 8091ba9ffc03999a3db1e2e0ee7d32ac5139a942
+SHA256: be8d24447147aa997b79353eaf8732b3d0967118c011b47476c841667eb15f7e
+Description: Linux Standard Base 4.1 init script functionality
+Multi-Arch: foreign
+Homepage: http://www.linuxfoundation.org/collaborate/workgroups/lsb
+Description-md5: 4ebb3d88f9f483751e70c55779c52d01
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: mount
+Essential: yes
+Priority: required
+Section: admin
+Installed-Size: 410
+Maintainer: Ubuntu Developers
+Original-Maintainer: LaMont Jones
+Architecture: i386
+Source: util-linux
+Version: 2.20.1-5.1ubuntu21
+Pre-Depends: libblkid1 (>= 2.20.1), libc6 (>= 2.8), libmount1 (>= 2.20.1), libselinux1 (>= 2.0.15)
+Suggests: nfs-common (>= 1:1.1.0-13)
+Filename: pool/main/u/util-linux/mount_2.20.1-5.1ubuntu21_i386.deb
+Size: 112598
+MD5sum: bdff5dbfbf17e2be281d64e2e7a4912b
+SHA1: 1ed4abb0d5de8a09c704ac2d33de123015e5318a
+SHA256: d2f023c763f7b6e91f3cd14073bfc5af7e7bfe3922fc5ca681d8038c80323f9e
+Description: Tools for mounting and manipulating filesystems
+Multi-Arch: foreign
+Homepage: http://userweb.kernel.org/~kzak/util-linux/
+Description-md5: 46eb8e09a600d5eb98b6b40428349102
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: mountall
+Priority: required
+Section: admin
+Installed-Size: 248
+Maintainer: Ubuntu Developers
+Original-Maintainer: Steve Langasek
+Architecture: i386
+Version: 2.54build1
+Replaces: upstart (<< 0.6.3-2)
+Depends: makedev, udev, plymouth, coreutils (>= 7.1), libc6 (>= 2.9), libdbus-1-3 (>= 1.2.16), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0), libplymouth4 (>= 0.8.1-3), libudev1 (>= 183)
+Pre-Depends: dpkg (>= 1.15.7.2)
+Breaks: initscripts (<< 2.88dsf-24), policycoreutils (<< 2.0.69-2ubuntu4), usplash (<< 0.5.47)
+Filename: pool/main/m/mountall/mountall_2.54build1_i386.deb
+Size: 54166
+MD5sum: a208d9dc5aef018087d5e00cea7f6c92
+SHA1: 13686aa81ebef6c3009ff618708d76bc68ff94e8
+SHA256: dee359411cd7cfad19581f380af6275d46a6c5ecf55f512523b75adaa4734d03
+Description: filesystem mounting tool
+Multi-Arch: foreign
+Description-md5: b5b5a27fc0e8063ef1226a39fb8ecf70
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: procps
+Priority: required
+Section: admin
+Installed-Size: 634
+Maintainer: Ubuntu Developers
+Original-Maintainer: Craig Small
+Architecture: i386
+Version: 1:3.3.9-1ubuntu5
+Provides: watch
+Depends: libc6 (>= 2.15), libncurses5 (>= 5.5-5~), libncursesw5 (>= 5.6+20070908), libprocps3, libtinfo5, lsb-base (>= 4.1+Debian11ubuntu7), initscripts
+Recommends: psmisc
+Conflicts: pgrep (<< 3.3-5), w-bassman (<< 1.0-3)
+Breaks: guymager (<= 0.5.9-1), open-vm-tools (<= 2011.12.20-562307-1), xmem (<= 1.20-27.1)
+Filename: pool/main/p/procps/procps_3.3.9-1ubuntu5_i386.deb
+Size: 203368
+MD5sum: 17be371891f077e04075c6eb0af06b3c
+SHA1: a5c6171b5a6430aa9436e42f0e64226dd2e7a665
+SHA256: 41e03fd2d05161c402d9a5d2b5feecb30a42f8919eb43712ebdd4340433803c1
+Description: /proc file system utilities
+Multi-Arch: foreign
+Homepage: http://gitorious.org/procps
+Description-md5: 943f3288c1aaa379fca73a3ff1a35278
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: sysv-rc
+Priority: required
+Section: admin
+Installed-Size: 224
+Maintainer: Ubuntu Core Developers
+Original-Maintainer: Debian sysvinit maintainers
+Architecture: all
+Source: sysvinit
+Version: 2.88dsf-41ubuntu16
+Replaces: file-rc
+Depends: debconf (>= 0.5) | debconf-2.0, sysvinit-utils (>= 2.86.ds1-62), insserv (>> 1.12.0-10)
+Recommends: lsb-base (>= 3.2-14)
+Suggests: sysv-rc-conf, bum
+Conflicts: file-rc
+Breaks: initscripts (<< 2.88dsf-41ubuntu14)
+Filename: pool/main/s/sysvinit/sysv-rc_2.88dsf-41ubuntu16_all.deb
+Size: 37784
+MD5sum: e57bc9887432f76266d7bf741cf9d813
+SHA1: 446d24cc86bdb7a779856c00f9dea966227a00e2
+SHA256: 072d2745b9c966d63cba5abf52357374e7a043b3cc1bbde0b8ccf68f82e45f60
+Description: System-V-like runlevel change mechanism
+Multi-Arch: foreign
+Homepage: http://savannah.nongnu.org/projects/sysvinit
+Description-md5: 195f2d617082a23f37cee0f50784eef9
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: sysvinit-utils
+Priority: required
+Section: admin
+Installed-Size: 236
+Maintainer: Ubuntu Core Developers
+Original-Maintainer: Debian sysvinit maintainers
+Architecture: i386
+Source: sysvinit
+Version: 2.88dsf-41ubuntu16
+Replaces: last, sysvinit (<= 2.86.ds1-65)
+Depends: libc6 (>= 2.15), libselinux1 (>= 1.32), lsb-base (>= 4.1+Debian11ubuntu7)
+Recommends: upstart (>= 0.6.3-4)
+Suggests: bootlogd, sash
+Conflicts: chkconfig (<< 11.0-79.1-2), last, sysvconfig
+Breaks: upstart (<< 1.5-0ubuntu5)
+Filename: pool/main/s/sysvinit/sysvinit-utils_2.88dsf-41ubuntu16_i386.deb
+Size: 49652
+MD5sum: e1340ba69c7a5f0cf1a84b3f68993570
+SHA1: 7cbd535c1c010c2e84cb454562fb6632fb366ddc
+SHA256: 576c2bcfbf56871acd68576f07fd18b6bfccd8a5db6dfa04bcf62183f43e77a0
+Description: System-V-like utilities
+Multi-Arch: foreign
+Homepage: http://savannah.nongnu.org/projects/sysvinit
+Description-md5: 1d2bc4c9c32104729144c7578ecd30bd
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: udev
+Priority: required
+Section: admin
+Installed-Size: 5123
+Maintainer: Ubuntu Developers
+Original-Maintainer: Debian systemd Maintainers
+Architecture: i386
+Source: systemd
+Version: 204-14ubuntu2
+Depends: libacl1 (>= 2.2.51-8), libblkid1 (>= 2.19.1), libc6 (>= 2.17), libcgmanager0, libdbus-1-3 (>= 1.0.2), libkmod2 (>= 5~), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0), libselinux1 (>= 2.0.65), libudev1 (= 204-14ubuntu2), lsb-base (>= 4.1+Debian11ubuntu7), util-linux (>= 2.16), procps
+Pre-Depends: debconf (>= 1.4.69) | debconf-2.0
+Breaks: consolekit (<< 0.4.6-1)
+Filename: pool/main/s/systemd/udev_204-14ubuntu2_i386.deb
+Size: 739026
+MD5sum: a85b035885e1b316354f6e5d0b8eeb69
+SHA1: 970405e4c8838c3cf17d1834c8917705d977879e
+SHA256: 05fbd7f4b502fde9752b84b49364fe633b8377bcd996ec16462e0bc94adc9fcf
+Description: /dev/ and hotplug management daemon
+Multi-Arch: foreign
+Homepage: http://www.freedesktop.org/wiki/Software/systemd
+Description-md5: e875ddb09f46f1f7672af537f0c875ca
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
+Package: upstart
+Priority: required
+Section: admin
+Installed-Size: 1721
+Maintainer: James Hunt
+Architecture: i386
+Version: 1.13.1-0ubuntu1
+Replaces: startup-tasks, system-services, sysvinit, upstart-compat-sysv, upstart-job
+Provides: startup-tasks, system-services, upstart-compat-sysv, upstart-job
+Depends: libc6 (>= 2.15), libcgmanager0, libdbus-1-3 (>= 1.2.16), libjson-c2 (>= 0.10), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0), libudev1 (>= 183), sysvinit-utils, initscripts, mountall, ifupdown (>= 0.6.10ubuntu5), libjson0 (>= 0.10-1.1ubuntu1), debianutils (>= 4)
+Suggests: python3, graphviz, bash-completion, upstart-monitor
+Conflicts: lxcguest, startup-tasks, system-services, sysvinit, upstart-compat-sysv, upstart-job
+Breaks: friendly-recovery (<< 0.2.13), libc6 (<< 2.12.1-0ubuntu12)
+Filename: pool/main/u/upstart/upstart_1.13.1-0ubuntu1_i386.deb
+Size: 388978
+MD5sum: 2ebf7fb1083b581707e445fee808e120
+SHA1: 901424ec0d304ca8d10a25321a55d1d69bd8e82d
+SHA256: c42fb117e90770c7163c9f4770e75e9c0d6a00d41c4b3afc2afebfa65ede80f8
+Description: event-based init daemon
+Multi-Arch: foreign
+Homepage: http://upstart.ubuntu.com/
+Orig-Maintainer: Steve Langasek
+Description-md5: b776ec43b708c13dd0c2ab824471f478
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Origin: Ubuntu
+Supported: 9m
+Task: minimal
+
diff --git a/test/integration/status-bug-lp1347721-dpkg-ordering b/test/integration/status-bug-lp1347721-dpkg-ordering
new file mode 100644
index 000000000..62e545c55
--- /dev/null
+++ b/test/integration/status-bug-lp1347721-dpkg-ordering
@@ -0,0 +1,1942 @@
+Package: libustr-1.0-1
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 261
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: ustr
+Version: 1.0.4-3ubuntu2
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Description: Micro string library: shared library
+ ustr (Micro string library) is a string API for C. It has tiny overhead over
+ just plain strdup(), is much safer, is easier to use, is faster for many
+ operations, can be used with read-only or automatically allocated data. You
+ don't even need to link to the library to use it (so there are no
+ dependencies).
+ .
+ This package contains the shared library for ustr.
+Homepage: http://www.and.org/ustr/
+Original-Maintainer: Vaclav Ovsik
+
+Package: debconf
+Status: install ok installed
+Priority: important
+Section: admin
+Installed-Size: 609
+Maintainer: Colin Watson
+Architecture: all
+Multi-Arch: foreign
+Version: 1.5.53ubuntu1
+Replaces: debconf-tiny
+Provides: debconf-2.0
+Pre-Depends: perl-base (>= 5.6.1-4)
+Recommends: apt-utils (>= 0.5.1), debconf-i18n
+Suggests: debconf-doc, debconf-utils, whiptail | dialog | gnome-utils, libterm-readline-gnu-perl, libgtk2-perl (>= 1:1.130), libnet-ldap-perl, perl, libqtgui4-perl, libqtcore4-perl
+Conflicts: apt (<< 0.3.12.1), cdebconf (<< 0.96), debconf-tiny, debconf-utils (<< 1.3.22), dialog (<< 0.9b-20020814-1), menu (<= 2.1.3-1), whiptail (<< 0.51.4-11), whiptail-utf8 (<= 0.50.17-13)
+Conffiles:
+ /etc/debconf.conf 8c0619be413824f1fc7698cee0f23811
+ /etc/apt/apt.conf.d/70debconf 7e9d09d5801a42b4926b736b8eeabb73
+ /etc/bash_completion.d/debconf 8fa1862734fbe54d7178aaaa419f5a11
+Description: Debian configuration management system
+ Debconf is a configuration management system for debian packages. Packages
+ use Debconf to ask questions when they are installed.
+Original-Maintainer: Debconf Developers
+
+Package: iproute2
+Status: install ok installed
+Priority: important
+Section: net
+Installed-Size: 1184
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 3.14.0-1
+Replaces: iproute
+Provides: arpd
+Depends: libc6 (>= 2.14), libdb5.3
+Recommends: libatm1 (>= 2.4.1-17~), libxtables10
+Suggests: iproute2-doc
+Conflicts: arpd, iproute (<< 20130000-1)
+Conffiles:
+ /etc/iproute2/rt_realms 7137bdf40e8d58c87ac7e3bba503767f
+ /etc/iproute2/rt_protos 95ce0b4b5b79f5a8a45941fb418a904c
+ /etc/iproute2/rt_dsfield 4264d5c7c8298300185aa04e1a736934
+ /etc/iproute2/rt_scopes 6298b8df09e9bda23ea7da49021ca457
+ /etc/iproute2/ematch_map b91e7f9b26918449bade9573f8871d61
+ /etc/iproute2/group 3aea2c0e0dd75e13a5f8f48f2936915f
+ /etc/iproute2/rt_tables a1313318d6778fe6b8c680248ef5a463
+Description: networking and traffic control tools
+ The iproute2 suite is a collection of utilities for networking and
+ traffic control.
+ .
+ These tools communicate with the Linux kernel via the (rt)netlink
+ interface, providing advanced features not available through the
+ legacy net-tools commands 'ifconfig' and 'route'.
+Original-Maintainer: Debian iproute2 Maintainers
+Homepage: http://www.linux-foundation.org/en/Net:Iproute2
+
+Package: coreutils
+Essential: yes
+Status: install ok installed
+Priority: required
+Section: utils
+Installed-Size: 6124
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 8.21-1ubuntu5
+Replaces: mktemp, timeout
+Pre-Depends: libacl1 (>= 2.2.51-8), libattr1 (>= 1:2.4.46-8), libc6 (>= 2.17), libselinux1 (>= 1.32)
+Conflicts: timeout
+Description: GNU core utilities
+ This package contains the basic file, shell and text manipulation
+ utilities which are expected to exist on every operating system.
+ .
+ Specifically, this package includes:
+ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
+ csplit cut date dd df dir dircolors dirname du echo env expand expr
+ factor false flock fmt fold groups head hostid id install join link ln
+ logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od
+ paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir runcon
+ sha*sum seq shred sleep sort split stat stty sum sync tac tail tee test
+ timeout touch tr true truncate tsort tty uname unexpand uniq unlink
+ users vdir wc who whoami yes
+Homepage: http://gnu.org/software/coreutils
+Original-Maintainer: Michael Stone
+
+Package: debianutils
+Essential: yes
+Status: install ok installed
+Priority: required
+Section: utils
+Installed-Size: 273
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 4.4
+Replaces: manpages-pl (<< 1:0.5)
+Depends: sensible-utils
+Pre-Depends: libc6 (>= 2.15)
+Description: Miscellaneous utilities specific to Debian
+ This package provides a number of small utilities which are used
+ primarily by the installation scripts of Debian packages, although
+ you may use them directly.
+ .
+ The specific utilities included are:
+ add-shell installkernel ischroot remove-shell run-parts savelog
+ tempfile which
+Original-Maintainer: Clint Adams
+
+Package: initramfs-tools
+Status: install ok installed
+Priority: optional
+Section: utils
+Installed-Size: 365
+Maintainer: Ubuntu Kernel Team
+Architecture: all
+Multi-Arch: foreign
+Version: 0.103ubuntu4
+Provides: linux-initramfs-tool
+Depends: initramfs-tools-bin (>= 0.103ubuntu4), initramfs-tools-bin (<< 0.103ubuntu4.1~), klibc-utils (>= 2.0-1~), busybox-initramfs (>= 1:1.13.3-1ubuntu5), cpio, module-init-tools, udev (>= 147~-5), findutils (>= 4.2.24), util-linux (>> 2.15~rc1)
+Suggests: bash-completion
+Breaks: cryptsetup (<< 2:1.1.0-2.1), elilo (<< 3.12-3.1~), lilo (<< 22.8-8.2~), mountall (<< 2.0~), s390-tools (<< 1.8.3-2~)
+Conflicts: usplash (<< 0.5.50)
+Conffiles:
+ /etc/bash_completion.d/initramfs-tools 7eeb7184772f3658e7cf446945c096b1
+ /etc/initramfs-tools/update-initramfs.conf e2026d4603e7161efaccca519aeb1297
+ /etc/initramfs-tools/initramfs.conf 8801535d9bec98754eea6a172f956d42
+ /etc/kernel/postrm.d/initramfs-tools e22d1ab0d7a7a1b66ae6d71ea4f21938
+ /etc/kernel/postinst.d/initramfs-tools fe7713b9a74a10ed71d1e7dd93afc209
+Description: tools for generating an initramfs
+ This package contains tools to create and boot an initramfs for packaged 2.6
+ Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the
+ kernel unpacks that archive into RAM, mounts and uses it as initial root file
+ system. The mounting of the real root file system occurs in early user space.
+ klibc provides utilities to setup root. Having the root on MD, LVM2, LUKS or
+ NFS is also supported.
+ Any boot loader with initrd support is able to load an initramfs archive.
+Original-Maintainer: Debian kernel team
+
+Package: makedev
+Status: install ok installed
+Priority: extra
+Section: admin
+Installed-Size: 125
+Maintainer: Ubuntu Developers
+Architecture: all
+Multi-Arch: foreign
+Version: 2.3.1-93ubuntu1
+Depends: base-passwd (>= 3.0.4)
+Conflicts: udev (<= 0.024-7)
+Description: creates device files in /dev
+ The MAKEDEV executable is used to create device files, often in /dev.
+ .
+ Device files are special files through which applications can interact
+ with hardware.
+ .
+ This package is not necessary for most modern Linux systems, where the udev
+ subsystem provides a more dynamic mechanism for device file management.
+Original-Maintainer: Debian QA Group
+
+Package: libdbus-1-3
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 398
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: dbus
+Version: 1.6.18-0ubuntu4
+Depends: libc6 (>= 2.10)
+Pre-Depends: multiarch-support
+Recommends: dbus
+Breaks: kde-window-manager (<< 4:4.4.5-9), kdebase-workspace-bin (<< 4:4.4.5-9)
+Description: simple interprocess messaging system (library)
+ D-Bus is a message bus, used for sending messages between applications.
+ Conceptually, it fits somewhere in between raw sockets and CORBA in
+ terms of complexity.
+ .
+ D-Bus supports broadcast messages, asynchronous messages (thus
+ decreasing latency), authentication, and more. It is designed to be
+ low-overhead; messages are sent using a binary protocol, not using
+ XML. D-Bus also supports a method call mapping for its messages, but
+ it is not required; this makes using the system quite simple.
+ .
+ It comes with several bindings, including GLib, Python, Qt and Java.
+ .
+ The daemon can be found in the dbus package.
+Homepage: http://dbus.freedesktop.org/
+Original-Maintainer: Utopia Maintenance Team
+
+Package: module-init-tools
+Status: install ok installed
+Priority: extra
+Section: admin
+Installed-Size: 31
+Maintainer: Ubuntu Developers
+Architecture: all
+Multi-Arch: foreign
+Source: kmod
+Version: 16-2ubuntu3
+Depends: libkmod2, kmod
+Pre-Depends: dpkg (>= 1.15.7.2)
+Description: transitional dummy package (module-init-tools to kmod)
+ This dummy package is provided to support the transition from
+ module-init-tools to kmod and should be removed afterwards.
+Original-Maintainer: Marco d'Itri
+
+Package: libuuid1
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 107
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: util-linux
+Version: 2.20.1-5.1ubuntu20
+Replaces: e2fsprogs (<< 1.34-1)
+Depends: passwd, libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Recommends: uuid-runtime
+Description: Universally Unique ID library
+ The libuuid library generates and parses 128-bit universally unique
+ ids (UUIDs). A UUID is an identifier that is unique across both
+ space and time, with respect to the space of all UUIDs. A UUID can
+ be used for multiple purposes, from tagging objects with an extremely
+ short lifetime, to reliably identifying very persistent objects
+ across a network.
+ .
+ See RFC 4122 for more information.
+Homepage: http://userweb.kernel.org/~kzak/util-linux/
+Original-Maintainer: LaMont Jones
+
+Package: lsb-base
+Status: install ok installed
+Priority: required
+Section: misc
+Installed-Size: 82
+Maintainer: Ubuntu Developers
+Architecture: all
+Multi-Arch: foreign
+Source: lsb
+Version: 4.1+Debian11ubuntu6
+Description: Linux Standard Base 4.1 init script functionality
+ The Linux Standard Base (http://www.linuxbase.org/) is a standard
+ core system that third-party applications written for Linux can
+ depend upon.
+ .
+ This package only includes the init-functions shell library, which
+ may be used by other packages' initialization scripts for console
+ logging and other purposes.
+Homepage: http://www.linuxfoundation.org/collaborate/workgroups/lsb
+Original-Maintainer: Debian LSB Team
+
+Package: procps
+Status: install ok installed
+Priority: important
+Section: admin
+Installed-Size: 637
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 1:3.3.9-1ubuntu2
+Provides: watch
+Depends: libc6 (>= 2.15), libncurses5 (>= 5.5-5~), libncursesw5 (>= 5.6+20070908), libprocps3, libtinfo5, lsb-base (>= 3.0-10), initscripts
+Recommends: psmisc
+Breaks: guymager (<= 0.5.9-1), open-vm-tools (<= 2011.12.20-562307-1), xmem (<= 1.20-27.1)
+Conflicts: pgrep (<< 3.3-5), w-bassman (<< 1.0-3)
+Conffiles:
+ /etc/sysctl.d/10-console-messages.conf 154f6f5c5810d10bb303fb6a8e907c6a
+ /etc/sysctl.d/README c20074b9b11a5202758c69d7bcb6996f
+ /etc/sysctl.d/10-magic-sysrq.conf b3059f2835f17c97265433fdfdee358f
+ /etc/sysctl.d/10-kernel-hardening.conf 5c1388f00011a287cdeba60208c674e1
+ /etc/sysctl.d/10-link-restrictions.conf 8568316f2baa8db06554dab91f93a161
+ /etc/sysctl.d/10-zeropage.conf 8d7193abcc4dfedaf519dd03016a5e59
+ /etc/sysctl.d/10-network-security.conf 4ac7258f5336e7eeaf448c05ab668d3c
+ /etc/sysctl.d/10-ptrace.conf 47f40494b2fc698e15549e0a4a79e81c
+ /etc/sysctl.d/10-ipv6-privacy.conf e9473d12b4a7069d6a3ca8b694511ddf
+ /etc/sysctl.conf 76c1d8285c578d5e827c3e07b9738112
+ /etc/init.d/procps 021482ebab1024f5ed76e650e5191e8f
+ /etc/init/procps.conf 96170a339d08797dc90d69b01d6bf610
+Description: /proc file system utilities
+ This package provides command line and full screen utilities for browsing
+ procfs, a "pseudo" file system dynamically generated by the kernel to
+ provide information about the status of entries in its process table
+ (such as whether the process is running, stopped, or a "zombie").
+ .
+ It contains free, kill, pkill, pgrep, pmap, ps, pwdx, skill, slabtop,
+ snice, sysctl, tload, top, uptime, vmstat, w, and watch.
+Homepage: http://gitorious.org/procps
+Original-Maintainer: Craig Small
+
+Package: libpam0g
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 219
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: pam
+Version: 1.1.8-1ubuntu2
+Replaces: libpam0g-util
+Depends: libaudit1 (>= 1:2.2.1), libc6 (>= 2.8), debconf (>= 0.5) | debconf-2.0
+Pre-Depends: multiarch-support
+Suggests: libpam-doc
+Description: Pluggable Authentication Modules library
+ Contains the shared library for Linux-PAM, a library that enables the
+ local system administrator to choose how applications authenticate users.
+ In other words, without rewriting or recompiling a PAM-aware application,
+ it is possible to switch between the authentication mechanism(s) it uses.
+ One may entirely upgrade the local authentication system without touching
+ the applications themselves.
+Homepage: http://pam.sourceforge.net/
+Original-Maintainer: Steve Langasek
+
+Package: sensible-utils
+Status: install ok installed
+Priority: required
+Section: utils
+Installed-Size: 110
+Maintainer: Ubuntu Developers
+Architecture: all
+Multi-Arch: foreign
+Version: 0.0.9
+Replaces: debianutils (<= 2.32.3), manpages-pl (<= 20060617-3~)
+Description: Utilities for sensible alternative selection
+ This package provides a number of small utilities which are used
+ by programs to sensibly select and spawn an appropriate browser,
+ editor, or pager.
+ .
+ The specific utilities included are: sensible-browser sensible-editor
+ sensible-pager
+Original-Maintainer: Anibal Monsalve Salazar
+
+Package: perl-base
+Essential: yes
+Status: install ok installed
+Priority: required
+Section: perl
+Installed-Size: 4780
+Maintainer: Ubuntu Developers
+Architecture: i386
+Source: perl
+Version: 5.18.2-2ubuntu1
+Replaces: libperl5.8 (<< 5.8.0-20), libscalar-list-utils-perl, libsocket-perl, libxsloader-perl, perl (<< 5.10.1-12), perl-modules (<< 5.10.1-1)
+Provides: libscalar-list-utils-perl, libsocket-perl, libxsloader-perl, perl5-base, perlapi-5.18.1, perlapi-5.18.2
+Pre-Depends: libc6 (>= 2.11), dpkg (>= 1.14.20)
+Suggests: perl
+Breaks: autoconf2.13 (<< 2.13-45), libcommon-sense-perl (<< 3.72-2~), libfile-spec-perl (<< 3.4000), libmarc-charset-perl (<< 1.2), libsocket-perl (<< 2.009), libxsloader-perl (<< 0.16)
+Conflicts: defoma (<< 0.11.12), doc-base (<< 0.10.3), libscalar-list-utils-perl, mono-gac (<< 2.10.8.1-3), safe-rm (<< 0.8), update-inetd (<< 4.41)
+Description: minimal Perl system
+ Perl is a scripting language used in many system scripts and utilities.
+ .
+ This package provides a Perl interpreter and the small subset of the
+ standard run-time library required to perform basic tasks. For a full
+ Perl installation, install "perl" (and its dependencies, "perl-modules"
+ and "perl-doc").
+Original-Maintainer: Niko Tyni
+Homepage: http://dev.perl.org/perl5/
+
+Package: sysv-rc
+Status: install ok installed
+Priority: required
+Section: admin
+Installed-Size: 221
+Maintainer: Ubuntu Core Developers
+Architecture: all
+Multi-Arch: foreign
+Source: sysvinit
+Version: 2.88dsf-41ubuntu6
+Replaces: file-rc
+Depends: debconf (>= 0.5) | debconf-2.0, sysvinit-utils (>= 2.86.ds1-62), insserv (>> 1.12.0-10)
+Recommends: lsb-base (>= 3.2-14)
+Suggests: sysv-rc-conf, bum
+Breaks: initscripts (<< 2.86.ds1-63)
+Conflicts: file-rc
+Description: System-V-like runlevel change mechanism
+ This package provides support for the System-V like system
+ for booting, changing runlevels, and shutting down,
+ configured through symbolic links in /etc/rc?.d/.
+Homepage: http://savannah.nongnu.org/projects/sysvinit
+Original-Maintainer: Debian sysvinit maintainers
+
+Package: libprocps3
+Status: install ok installed
+Priority: important
+Section: libs
+Installed-Size: 129
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: procps
+Version: 1:3.3.9-1ubuntu2
+Replaces: procps (<< 1:3.3.2-1)
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Description: library for accessing process information from /proc
+ The libprocps library is a way of accessing information out of the /proc
+ filesystem.
+ .
+ This package contains the shared libraries necessary to run programs
+ compilied with libprocps.
+Homepage: http://gitorious.org/procps
+Original-Maintainer: Craig Small
+
+Package: libjson-c2
+Status: install ok installed
+Priority: extra
+Section: libs
+Installed-Size: 82
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: json-c
+Version: 0.11-4ubuntu1
+Depends: libc6 (>= 2.8)
+Pre-Depends: multiarch-support
+Description: JSON manipulation library - shared library
+ This library allows you to easily construct JSON objects in C,
+ output them as JSON formatted strings and parse JSON formatted
+ strings back into the C representation of JSON objects.
+Homepage: https://github.com/json-c/json-c/wiki
+Original-Maintainer: fabien boucher
+
+Package: libdrm2
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 105
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: libdrm
+Version: 2.4.53-1
+Depends: libc6 (>= 2.17)
+Pre-Depends: multiarch-support
+Description: Userspace interface to kernel DRM services -- runtime
+ This library implements the userspace interface to the kernel DRM
+ services. DRM stands for "Direct Rendering Manager", which is the
+ kernelspace portion of the "Direct Rendering Infrastructure" (DRI).
+ The DRI is currently used on Linux to provide hardware-accelerated
+ OpenGL drivers.
+ .
+ This package provides the runtime environment for libdrm.
+Original-Maintainer: Debian X Strike Force
+
+Package: libsepol1
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 322
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: libsepol
+Version: 2.2-1
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Description: SELinux library for manipulating binary security policies
+ Security-enhanced Linux is a patch of the Linux kernel and a number
+ of utilities with enhanced security functionality designed to add
+ mandatory access controls to Linux. The Security-enhanced Linux
+ kernel contains new architectural components originally developed to
+ improve the security of the Flask operating system. These
+ architectural components provide general support for the enforcement
+ of many kinds of mandatory access control policies, including those
+ based on the concepts of Type Enforcement®, Role-based Access
+ Control, and Multi-level Security.
+ .
+ libsepol provides an API for the manipulation of SELinux binary policies.
+ It is used by checkpolicy (the policy compiler) and similar tools, as well
+ as by programs like load_policy that need to perform specific transformations
+ on binary policies such as customizing policy boolean settings.
+Original-Maintainer: Debian SELinux maintainers
+Homepage: http://userspace.selinuxproject.org/
+
+Package: libpam-modules
+Status: install ok installed
+Priority: required
+Section: admin
+Installed-Size: 764
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: pam
+Version: 1.1.8-1ubuntu2
+Replaces: libpam-umask, libpam0g-util
+Provides: libpam-mkhomedir, libpam-motd, libpam-umask
+Pre-Depends: libaudit1 (>= 1:2.2.1), libc6 (>= 2.15), libdb5.3, libpam0g (>= 1.1.3-2), libselinux1 (>= 2.1.9), debconf (>= 0.5) | debconf-2.0, libpam-modules-bin (= 1.1.8-1ubuntu2)
+Conflicts: libpam-mkhomedir, libpam-motd, libpam-umask
+Conffiles:
+ /etc/security/limits.conf 11c27ba00b7bd6a255f33126f75c5005
+ /etc/security/group.conf f1e26e8db6f7abd2d697d7dad3422c36
+ /etc/security/access.conf 13ec4d189f0ed9acf3433977a53d446b
+ /etc/security/pam_env.conf ddee4a931170dc21b4e0b9bb28e02a7b
+ /etc/security/namespace.init b46b23d64860d1557d2a8f44b231fd54
+ /etc/security/time.conf 06e05c6079e839c8833ac7c3abfde192
+ /etc/security/sepermit.conf d41c74654734a5c069a37bfc02f0a6d4
+ /etc/security/namespace.conf 6424c99a62ddf4b7d3ca713bb06ded89
+Description: Pluggable Authentication Modules for PAM
+ This package completes the set of modules for PAM. It includes the
+ pam_unix.so module as well as some specialty modules.
+Homepage: http://pam.sourceforge.net/
+Original-Maintainer: Steve Langasek
+
+Package: tzdata
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 1599
+Maintainer: Ubuntu Developers
+Architecture: all
+Multi-Arch: foreign
+Version: 2014b-1
+Replaces: libc0.1, libc0.3, libc6, libc6.1
+Provides: tzdata-jessie
+Depends: debconf (>= 0.5) | debconf-2.0
+Description: time zone and daylight-saving time data
+ This package contains data required for the implementation of
+ standard local time for many representative locations around the
+ globe. It is updated periodically to reflect changes made by
+ political bodies to time zone boundaries, UTC offsets, and
+ daylight-saving rules.
+Original-Maintainer: GNU Libc Maintainers
+Homepage: http://www.iana.org/time-zones
+
+Package: libudev1
+Status: install ok installed
+Priority: important
+Section: libs
+Installed-Size: 129
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: systemd
+Version: 204-10ubuntu1
+Depends: libc6 (>= 2.17), libcgmanager0, libdbus-1-3 (>= 1.0.2), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0)
+Pre-Depends: multiarch-support
+Description: libudev shared library
+ This library provides access to udev device information.
+Homepage: http://www.freedesktop.org/wiki/Software/systemd
+Original-Maintainer: Debian systemd Maintainers
+
+Package: ifupdown
+Status: install ok installed
+Priority: important
+Section: admin
+Installed-Size: 229
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 0.7.48.1ubuntu1
+Replaces: netbase (<< 5.0)
+Depends: iproute2 | iproute (>= 20071016-1), libc6 (>= 2.7), sysv-rc (>= 2.88dsf-24) | file-rc (>= 0.8.16), lsb-base (>= 4.1+Debian3), initscripts (>= 2.88dsf-25), adduser
+Recommends: isc-dhcp-client | dhcp-client
+Suggests: ppp, rdnssd, net-tools
+Breaks: dhcp3-client (<< 4.0), netbase (<< 5.0)
+Conffiles:
+ /etc/network/if-up.d/upstart dfbcde4fd4a3a2553930605e03e160ab
+ /etc/network/if-down.d/upstart 1a0205ddbc1446782a8d4d818e97d8a5
+ /etc/init/network-interface-container.conf 4daa570594afc50940f140a7731d20d1
+ /etc/init/networking.conf c50811e19bcd596d99b0467b40cfbb8b
+ /etc/init/network-interface.conf aae12345eba8e946579b06798b1752c1
+ /etc/init/network-interface-security.conf feb6b4b52fe24c44ff1bc68addf245d6
+ /etc/init.d/networking 2c8c3be8b90f99de7edf0f883ebe39f3
+ /etc/default/networking 35cd4a2713981c9239ce4532c1bfc1c7
+Description: high level tools to configure network interfaces
+ This package provides the tools ifup and ifdown which may be used to
+ configure (or, respectively, deconfigure) network interfaces based on
+ interface definitions in the file /etc/network/interfaces.
+Original-Maintainer: Andrew Shadura
+
+Package: libsemanage1
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 261
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: libsemanage
+Version: 2.2-1ubuntu1
+Depends: libsemanage-common (= 2.2-1ubuntu1), libaudit1 (>= 1:2.2.1), libbz2-1.0, libc6 (>= 2.8), libselinux1 (>= 2.1.12), libsepol1 (>= 2.1.4), libustr-1.0-1 (>= 1.0.4)
+Pre-Depends: multiarch-support
+Description: SELinux policy management library
+ This package provides the shared libraries for SELinux policy management.
+ It uses libsepol for binary policy manipulation and libselinux for
+ interacting with the SELinux system. It also exec's helper programs
+ for loading policy and for checking whether the file_contexts
+ configuration is valid (load_policy and setfiles from
+ policycoreutils) presently, although this may change at least for the
+ bootstrapping case
+ .
+ Security-enhanced Linux is a patch of the Linux kernel and a
+ number of utilities with enhanced security functionality designed to
+ add mandatory access controls to Linux. The Security-enhanced Linux
+ kernel contains new architectural components originally developed to
+ improve the security of the Flask operating system. These
+ architectural components provide general support for the enforcement
+ of many kinds of mandatory access control policies, including those
+ based on the concepts of Type Enforcement, Role-based Access
+ Control, and Multi-level Security.
+Original-Maintainer: Debian SELinux maintainers
+Homepage: http://userspace.selinuxproject.org/
+
+Package: mountall
+Status: install ok installed
+Priority: required
+Section: admin
+Installed-Size: 248
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 2.53
+Replaces: upstart (<< 0.6.3-2)
+Depends: makedev, udev, plymouth, coreutils (>= 7.1), libc6 (>= 2.9), libdbus-1-3 (>= 1.2.16), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0), libplymouth2 (>= 0.8.1-3), libudev1 (>= 183)
+Pre-Depends: dpkg (>= 1.15.7.2)
+Breaks: initscripts (<< 2.88dsf-24), policycoreutils (<< 2.0.69-2ubuntu4), usplash (<< 0.5.47)
+Conffiles:
+ /etc/init/checkroot.sh.conf 3ea7f6ba450f431fd239e2b53a805216
+ /etc/init/mounted-dev.conf cf7bea42235e77168c996d774f059c44
+ /etc/init/mounted-tmp.conf 289fa57d726885147a41b2b1f3695a29
+ /etc/init/mountdevsubfs.sh.conf dd33cb414bca17d97140d7f8671207f2
+ /etc/init/mountall-net.conf feff70cd7006f6763e24263d381940f3
+ /etc/init/mountall-shell.conf aa05af89db3de044d1cd7f6971b46d9f
+ /etc/init/mountall.sh.conf ee258840aad52477434cc22e34efcc50
+ /etc/init/bootmisc.sh.conf d1a51c54dcfe6f3f5265246888ba4161
+ /etc/init/mountnfs.sh.conf 760a5b57cbd0d1e2c65ba6db9297a586
+ /etc/init/mounted-proc.conf 07198659bd06c1442a35882b2fae05fc
+ /etc/init/mountnfs-bootclean.sh.conf 0b6f3f9e9f8757efee57f6a4839d7dff
+ /etc/init/mountall.conf ac0fbaa98e705e52f59ca9e4d39751ad
+ /etc/init/mountall-bootclean.sh.conf d1899239aa60ea903f43a3ac58c5c238
+ /etc/init/mtab.sh.conf 27aece82dbe70232d734d1dadfe87518
+ /etc/init/mountkernfs.sh.conf 2e7449097b6cf88cba915edc1c339ec4
+ /etc/init/mounted-var.conf 02f90856c91a46e9cbed1c35b92fec6c
+ /etc/init/mountall-reboot.conf 43e3c229085a13005b0681a49b2bef51
+ /etc/init/checkroot-bootclean.sh.conf e02a473c76e4a2bfc1efb4c367495052
+ /etc/init/checkfs.sh.conf 2e928476ccb2ecefe9ee87e2f83d34da
+ /etc/init/mounted-debugfs.conf 462c8aab0d9d4e6e496b1e2be5910edc
+ /etc/init/mounted-run.conf a26db58c801e0f6ec8738a5838aa53ed
+ /etc/dbus-1/system.d/Mountall.Server.conf 91b1414af1257d2ef089f84a3e5c1ed1
+Description: filesystem mounting tool
+ mountall mounts filesystems when the underlying block devices are
+ ready, or when network interfaces come up, checking the filesystems
+ first.
+Original-Maintainer: Steve Langasek
+
+Package: kmod
+Status: install ok installed
+Priority: important
+Section: admin
+Installed-Size: 285
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 16-2ubuntu3
+Replaces: module-init-tools (<< 4)
+Depends: libc6 (>= 2.17), libkmod2, sysv-rc (>= 2.88dsf-24) | file-rc (>= 0.8.16), lsb-base (>= 3.0-6)
+Breaks: module-init-tools (<< 4)
+Conffiles:
+ /etc/init/kmod.conf 2686532745c8b71d6d3df91c3a53aef3
+ /etc/modprobe.d/blacklist-framebuffer.conf 097e2142ae3e4dd2911eda7844ce0c18
+ /etc/modprobe.d/blacklist-rare-network.conf 8fb4b96124e461f53adceba9ca91f09a
+ /etc/modprobe.d/blacklist.conf bc6754fa320733c6d239a4bb0148ffd7
+ /etc/modprobe.d/iwlwifi.conf f27bc645e93e20c8e532325d190ac8ee
+ /etc/modprobe.d/blacklist-ath_pci.conf d1da9bb08c2b0f56f3be93fd0e37946b
+ /etc/modprobe.d/mlx4.conf b2a0bedb7461daeb0138270639581bbf
+ /etc/modprobe.d/blacklist-firewire.conf 9cc07a17e8e64f9cd35ff59c29debe69
+ /etc/modprobe.d/blacklist-watchdog.conf 55327f9270c8a6257a833c4d127a39e1
+ /etc/init.d/kmod e6d43abead3714ceb8aca68dd77e1dad
+ /etc/depmod.d/ubuntu.conf 7c8439ef36b12e5f226b5dbfa20b8c2d
+Description: tools for managing Linux kernel modules
+ This package contains a set of programs for loading, inserting, and
+ removing kernel modules for Linux.
+ It replaces module-init-tools.
+Original-Maintainer: Marco d'Itri
+
+Package: libkmod2
+Status: install ok installed
+Priority: important
+Section: libs
+Installed-Size: 138
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: kmod
+Version: 16-2ubuntu3
+Depends: libc6 (>= 2.17)
+Pre-Depends: multiarch-support
+Description: libkmod shared library
+ This library provides an API for insertion, removal, configuration and
+ listing of kernel modules.
+Original-Maintainer: Marco d'Itri
+
+Package: tar
+Essential: yes
+Status: install ok installed
+Priority: required
+Section: utils
+Installed-Size: 760
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Version: 1.27.1-2
+Replaces: cpio (<< 2.4.2-39)
+Pre-Depends: libacl1 (>= 2.2.51-8), libc6 (>= 2.17), libselinux1 (>= 1.32)
+Suggests: bzip2, ncompress, xz-utils, tar-scripts
+Breaks: dpkg-dev (<< 1.14.26)
+Conflicts: cpio (<= 2.4.2-38)
+Conffiles:
+ /etc/rmt 3c58b7cd13da1085eff0acc6a00f43c7
+Description: GNU version of the tar archiving utility
+ Tar is a program for packaging a set of files as a single archive in tar
+ format. The function it performs is conceptually similar to cpio, and to
+ things like PKZIP in the DOS world. It is heavily used by the Debian package
+ management system, and is useful for performing system backups and exchanging
+ sets of files with others.
+Original-Maintainer: Bdale Garbee
+
+Package: libmount1
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 249
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: util-linux
+Version: 2.20.1-5.1ubuntu20
+Depends: libblkid1 (>= 2.17.2), libc6 (>= 2.8), libselinux1 (>= 1.32)
+Pre-Depends: multiarch-support
+Description: block device id library
+ The device mounting library, used by mount and mount helpers.
+Homepage: http://userweb.kernel.org/~kzak/util-linux/
+Original-Maintainer: LaMont Jones
+
+Package: zlib1g
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 170
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: zlib
+Version: 1:1.2.8.dfsg-1ubuntu1
+Provides: libz1
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Breaks: libxml2 (<< 2.7.6.dfsg-2), texlive-binaries (<< 2009-12)
+Conflicts: zlib1 (<= 1:1.0.4-7)
+Description: compression library - runtime
+ zlib is a library implementing the deflate compression method found
+ in gzip and PKZIP. This package includes the shared library.
+Homepage: http://zlib.net/
+Original-Maintainer: Mark Brown
+
+Package: adduser
+Status: install ok installed
+Priority: important
+Section: admin
+Installed-Size: 644
+Maintainer: Ubuntu Core Developers
+Architecture: all
+Multi-Arch: foreign
+Version: 3.113+nmu3ubuntu3
+Replaces: manpages-it (<< 0.3.4-2), manpages-pl (<= 20051117-1)
+Depends: perl-base (>= 5.6.0), passwd (>= 1:4.0.12), debconf | debconf-2.0
+Suggests: liblocale-gettext-perl, perl-modules, ecryptfs-utils (>= 67-1)
+Conffiles:
+ /etc/deluser.conf 773fb95e98a27947de4a95abb3d3f2a2
+Description: add and remove users and groups
+ This package includes the 'adduser' and 'deluser' commands for creating
+ and removing users.
+ .
+ - 'adduser' creates new users and groups and adds existing users to
+ existing groups;
+ - 'deluser' removes users and groups and removes users from a given
+ group.
+ .
+ Adding users with 'adduser' is much easier than adding them manually.
+ Adduser will choose appropriate UID and GID values, create a home
+ directory, copy skeletal user configuration, and automate setting
+ initial values for the user's password, real name and so on.
+ .
+ Deluser can back up and remove users' home directories
+ and mail spool or all the files they own on the system.
+ .
+ A custom script can be executed after each of the commands.
+ .
+ Development mailing list:
+ http://lists.alioth.debian.org/mailman/listinfo/adduser-devel/
+Homepage: http://alioth.debian.org/projects/adduser/
+Original-Maintainer: Debian Adduser Developers
+
+Package: libgcc1
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 154
+Maintainer: Ubuntu Core developers
+Architecture: i386
+Multi-Arch: same
+Source: gcc-4.9 (4.9.0-1ubuntu3)
+Version: 1:4.9.0-1ubuntu3
+Depends: gcc-4.9-base (= 4.9.0-1ubuntu3), libc6 (>= 2.2.4)
+Pre-Depends: multiarch-support
+Breaks: gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2)
+Description: GCC support library
+ Shared version of the support library, a library of internal subroutines
+ that GCC uses to overcome shortcomings of particular machines, or
+ special needs for some languages.
+Homepage: http://gcc.gnu.org/
+Original-Maintainer: Debian GCC Maintainers
+
+Package: libdebconfclient0
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 85
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: cdebconf
+Version: 0.190ubuntu1
+Depends: libc6 (>= 2.4)
+Pre-Depends: multiarch-support
+Description: Debian Configuration Management System (C-implementation library)
+ Debconf is a configuration management system for Debian packages. It is
+ used by some packages to prompt you for information before they are
+ installed. This is a reimplementation of the original debconf version
+ in C.
+ .
+ This is the libraries needed by libdebconfclient-dev and cdebconf.
+Original-Maintainer: Debian Install System Team
+
+Package: libklibc
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 133
+Maintainer: Ubuntu Developers
+Architecture: i386
+Source: klibc
+Version: 2.0.3-0ubuntu1
+Description: minimal libc subset for use with initramfs
+ klibc is intended to be a minimalistic libc subset for use with
+ initramfs. It is deliberately written for small size, minimal
+ entanglement, and portability, not speed. It is definitely a work in
+ progress, and a lot of things are still missing.
+Homepage: http://git.kernel.org/?p=libs/klibc/klibc.git;a=summary
+Original-Maintainer: maximilian attems
+
+Package: libcgmanager0
+Status: install ok installed
+Priority: optional
+Section: admin
+Installed-Size: 152
+Maintainer: Serge Hallyn
+Architecture: i386
+Multi-Arch: same
+Source: cgmanager
+Version: 0.25-0ubuntu4
+Depends: libc6 (>= 2.1.3), libdbus-1-3 (>= 1.0.2)
+Description: Central cgroup manager daemon (client library)
+ cgmanager provides a central cgroup manager daemon and a
+ per-namespace manager proxy, allowing users and programs
+ to administrate cgroups through D-Bus requests.
+ .
+ This package contains the shared library.
+Homepage: http://cgmanager.linuxcontainers.org/
+
+Package: mount
+Essential: yes
+Status: install ok installed
+Priority: required
+Section: admin
+Installed-Size: 410
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: foreign
+Source: util-linux
+Version: 2.20.1-5.1ubuntu20
+Pre-Depends: libblkid1 (>= 2.20.1), libc6 (>= 2.8), libmount1 (>= 2.20.1), libselinux1 (>= 2.0.15)
+Suggests: nfs-common (>= 1:1.1.0-13)
+Description: Tools for mounting and manipulating filesystems
+ This package provides the mount(8), umount(8), swapon(8),
+ swapoff(8), and losetup(8) commands.
+Homepage: http://userweb.kernel.org/~kzak/util-linux/
+Original-Maintainer: LaMont Jones
+
+Package: libncurses5
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 292
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: ncurses
+Version: 5.9+20140118-1ubuntu1
+Depends: libtinfo5 (= 5.9+20140118-1ubuntu1), libc6 (>= 2.15)
+Pre-Depends: multiarch-support, libtinfo5 (>= 5.9-3)
+Recommends: libgpm2
+Description: shared libraries for terminal handling
+ The ncurses library routines are a terminal-independent method of
+ updating character screens with reasonable optimization.
+ .
+ This package contains the shared libraries necessary to run programs
+ compiled with ncurses.
+Homepage: http://invisible-island.net/ncurses/
+Original-Maintainer: Craig Small
+
+Package: libplymouth2
+Status: install ok installed
+Priority: optional
+Section: libs
+Installed-Size: 298
+Maintainer: Ubuntu Developers
+Architecture: i386
+Multi-Arch: same
+Source: plymouth
+Version: 0.8.8-0ubuntu17
+Replaces: plymouth (<< 0.7.0+git20090207-0ubuntu0.1~ppa4)
+Depends: libc6 (>= 2.8), libpng12-0 (>= 1.2.13-4)
+Pre-Depends: multiarch-support
+Breaks: casper (= 1.227), mountall (<< 2.8)
+Description: graphical boot animation and logger - shared libraries
+ Plymouth is an application that runs very early in the boot process
+ (even before the root filesystem is mounted!) that provides a graphical
+ boot animation while the boot process happens in the background.
+ .
+ This package contains the shared libraries.
+
+Package: gcc-4.9-base
+Status: install ok installed
+Priority: required
+Section: libs
+Installed-Size: 213
+Maintainer: Ubuntu Core developers
+Architecture: i386
+Multi-Arch: same
+Source: gcc-4.9
+Version: 4.9.0-1ubuntu3
+Breaks: dehydra (<= 0.9.hg20110609-2), gcc-4.4-base (<< 4.4.7), gcj-4.4-base (<< 4.4.6-9~), gcj-4.6-base (<< 4.6.1-4~), gnat-4.4-base (<< 4.4.6-3~), gnat-4.6 (<< 4.6.1-5~)
+Description: GCC, the GNU Compiler Collection (base package)
+ This package contains files common to all languages and libraries
+ contained in the GNU Compiler Collection (GCC).
+Homepage: http://gcc.gnu.org/
+Original-Maintainer: Debian GCC Maintainers