summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-01-29 09:53:10 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2015-01-29 09:53:10 (GMT)
commita51f26f61c37687e962bbe8fd7234927b5d10fc0 (patch)
tree712cae2877747749bfc1ecbffd449e1d9511ebec
parent8c96708a5206d4ae658d1f1d9c8f02124630d25d (diff)
Add setup-commands/ro-apt-update
Shortcut for temporarily mounting a readonly root file system writable and run apt-get. This allows tests to download/unpack test dependencies on older images whose apt indexes are out of date. LP: #1408350
-rw-r--r--debian/changelog4
-rw-r--r--setup-commands/ro-apt-update13
2 files changed, 17 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 133a1b9..e513482 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,10 @@ autopkgtest (3.9.4) UNRELEASED; urgency=medium
* ssh-setup/adb: Guard adb wait-for-device with a 5 min timeout.
(LP: #1414939)
* README.running-tests.rst: Fix mis-spelled ro-apt setup command.
+ * Add setup-commands/ro-apt-update: Shortcut for temporarily mounting a
+ readonly root file system writable and run apt-get. This allows tests to
+ download/unpack test dependencies on older images whose apt indexes are
+ out of date. (LP: #1408350)
-- Martin Pitt <mpitt@debian.org> Tue, 27 Jan 2015 13:07:32 +0100
diff --git a/setup-commands/ro-apt-update b/setup-commands/ro-apt-update
new file mode 100644
index 0000000..0c0403a
--- /dev/null
+++ b/setup-commands/ro-apt-update
@@ -0,0 +1,13 @@
+# This script is is part of autopkgtest
+# Copyright (C) 2015 Canonical Ltd.
+# Author: Martin Pitt <martin.pitt@ubuntu.com>
+#
+# --setup-commands script for temporarily making the root file system writable,
+# run apt-get update, and make the root fs readable again. This allows tests to
+# download/unpack test dependencies on older images whose apt indexes are out
+# of date.
+
+mount -o remount,rw /
+apt-get update || (sleep 15; apt-get update)
+mount -o remount,ro /
+