summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-01-25 17:14:49 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2018-02-19 15:56:09 +0100
commit887e331abb6ac0a850e5d53de55f43c9ebdee5a2 (patch)
tree4c0a90ad39c784584d7319f40a8ed7818326a4be /test
parentbda3bce0197fe64819626f9ab116f72f80ce63c5 (diff)
add apt-helper drop-privs command…
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-helper7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/test-apt-helper b/test/integration/test-apt-helper
index fda28968f..ae1ca7456 100755
--- a/test/integration/test-apt-helper
+++ b/test/integration/test-apt-helper
@@ -123,3 +123,10 @@ testfailureequal 'E: Must specify at least one SRV record' apthelper srv-lookup
testfailureequal 'E: GetSrvRec failed for localhost' apthelper -q=1 srv-lookup 'localhost'
testfailureequal "E: GetSrvRec failed for localhost:${APTHTTPPORT}" apthelper -q=1 srv-lookup "localhost:${APTHTTPPORT}"
testfailureequal "E: GetSrvRec failed for localhost:${APTHTTPSPORT}" apthelper -q=1 srv-lookup "localhost:${APTHTTPSPORT}"
+
+msgmsg 'apt-helper' 'drop-privs'
+testfailureequal "E: No command given to run without privileges" apthelper drop-privs
+testsuccess apthelper -- drop-privs true
+testsuccess apthelper drop-privs -- true
+DATE="$(date -u +'%Y-%m-%d')"
+testsuccessequal "$DATE" apthelper drop-privs -- date -u -d "$DATE" +'%Y-%m-%d'