summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-07-10 12:01:46 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-07-10 12:01:46 +0200
commitda3ebfe79d570c3aeb5f0a407cfec7996f44420c (patch)
tree9fc075d7f598ef76d1175483be221b6b73dc2072
parent90d1d54ef2a68bd443815f26e9e2b578a1d7c419 (diff)
add failing regression test for bug #346386
-rw-r--r--test/integration/framework9
-rwxr-xr-xtest/integration/test-ubuntu-bug34638619
-rw-r--r--test/interactive-helper/aptwebserver.cc8
3 files changed, 31 insertions, 5 deletions
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;
}