Run memcached in another port for the DEP8 test

Closes: #1034128

UPDATE: I implemented the below in another PR: !2 (merged)

Another alternative is to just shutdown the system-wide memcached before running the test, like this:

diff --git a/debian/tests/control b/debian/tests/control
index 5e88e76..b05bd51 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -8,3 +8,4 @@ Depends:
  python3-pytest-xprocess,
  python3-redis,
  redis-server,
+Restrictions: needs-sudo
diff --git a/debian/tests/upstream b/debian/tests/upstream
index a3c654d..99b07be 100755
--- a/debian/tests/upstream
+++ b/debian/tests/upstream
@@ -6,6 +6,10 @@ pyvers=$(py3versions -r 2>/dev/null)
 cp -a tests "$AUTOPKGTEST_TMP"
 cd "$AUTOPKGTEST_TMP"
 
+sudo systemctl stop memcached.service
+
+trap "sudo systemctl restart memcached.service" EXIT
+
 for py in ${pyvers}; do
     echo "=== $py ==="
     $py -m pytest
Edited by Andreas Hasenack

Merge request reports

Loading