summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-06-29 17:31:06 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2020-06-29 17:32:17 +0200
commitddd8fc3d28cd8e668868158049ced7fa3c8c71b8 (patch)
treeac3241a7d46070a3be4f7d09dd913fd3855dea3f /test
parentb5faca7a90e1aa25adb8ee69b979d1f4bd7e8d78 (diff)
Add basic support for the Protected field
This will be mapped to Important for the time being.
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-dpkg-protected20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/test-dpkg-protected b/test/integration/test-dpkg-protected
new file mode 100755
index 000000000..3d0994d89
--- /dev/null
+++ b/test/integration/test-dpkg-protected
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'protected-package' 'native' '1' 'Protected: yes'
+
+setupaptarchive
+
+
+if dpkg --assert-protected-field 2>/dev/null; then
+ testsuccess aptget remove protected-package "$@" -o Debug::pkgDpkgPm=1 -y --allow-remove-essential
+ cp rootdir/tmp/testsuccess.output rootdir/tmp/output
+ testsuccess grep -- '--force-remove-protected' rootdir/tmp/output
+else
+ msgskip "dpkg does not support protected field"
+fi