diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2018-12-03 17:39:03 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-01-14 14:35:10 +0100 |
commit | feed3ec105cd6be7b5d23da14c6cfca8572ee725 (patch) | |
tree | 225d5105a0a37db4940b6fa9f23384d97571af77 /test/integration/test-authentication-basic | |
parent | 67fdc0cf55f4e91905b16e0f582ce70999997c8d (diff) |
Add support for /etc/apt/auth.conf.d/*.conf (netrcparts)
This allows us to install matching auth files for sources.list.d
files, for example; very useful.
This converts aptmethod's authfd from one FileFd to a vector of
pointers to FileFd, as FileFd cannot be copied, and move operators
are hard.
(cherry picked from commit bbfcc05c1978decd28df9681fd73e2a7d9a8c2a5)
LP: #1811120
(cherry picked from commit 5629f35ecb7956b180364ebaf57e79f35885344e)
Diffstat (limited to 'test/integration/test-authentication-basic')
-rwxr-xr-x | test/integration/test-authentication-basic | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic index 011f205af..211c73e35 100755 --- a/test/integration/test-authentication-basic +++ b/test/integration/test-authentication-basic @@ -53,7 +53,8 @@ Conf foo (1 unstable [all])' aptget install foo -s } authfile() { - local AUTHCONF='rootdir/etc/apt/auth.conf' + local AUTHCONF="${2:-rootdir/etc/apt/auth.conf}" + mkdir -p "$(dirname "$AUTHCONF")" rm -f "$AUTHCONF" printf '%s' "$1" > "$AUTHCONF" chmod 600 "$AUTHCONF" @@ -85,6 +86,16 @@ machine localhost login star@irc password hunter2' testauthsuccess "$1" + + # delete file, make sure it fails; add auth.conf.d snippet, works again. + rm rootdir/etc/apt/auth.conf + testauthfailure "$1" + + authfile 'machine localhost +login star@irc +password hunter2' rootdir/etc/apt/auth.conf.d/myauth.conf + testauthsuccess "$1" + rm rootdir/etc/apt/auth.conf.d/myauth.conf } msgmsg 'server basic auth' |