]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-authentication-basic
fix testcase expecting incorrect remove log from dpkg
[apt.git] / test / integration / test-authentication-basic
index b27c80e90409a6f11eeb70574d3754cbc42f1b83..3bfd076ce1a77478045eab98e8715ff38a1a35ae 100755 (executable)
@@ -1,17 +1,16 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 
 setupenvironment
 configarchitecture 'i386'
 
 insertpackage 'unstable' 'foo' 'all' '1'
 setupaptarchive --no-update
-exit
 
-changetohttpswebserver --authorization="$(printf '%s' 'star:hunter2' | base64 )"
+changetohttpswebserver --authorization="$(printf '%s' 'star@irc:hunter2' | base64 )"
 
 echo 'See, when YOU type hunter2, it shows to us as *******' > aptarchive/bash
 
@@ -31,7 +30,7 @@ testauthsuccess() {
        # lets see if got/retains acceptable permissions
        if [ -n "$AUTHCONF" ]; then
                if [ "$(id -u)" = '0' ]; then
-                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "_apt:root:600"
+                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "_apt:$(id -gn):600"
                else
                        testfilestats "$AUTHCONF" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:600"
                fi
@@ -62,7 +61,7 @@ runtest() {
 
        # good auth
        authfile 'machine localhost
-login star
+login star@irc
 password hunter2'
        testauthsuccess "$1"
 
@@ -78,7 +77,7 @@ login debian
 password jessie
 
 machine localhost
-login star
+login star@irc
 password hunter2'
        testauthsuccess "$1"
 }
@@ -86,6 +85,9 @@ password hunter2'
 msgmsg 'server basic auth'
 rewritesourceslist "http://localhost:${APTHTTPPORT}"
 runtest "http://localhost:${APTHTTPPORT}"
+rewritesourceslist "http://star%40irc:hunter2@localhost:${APTHTTPPORT}"
+authfile ''
+testauthsuccess "http://star%40irc:hunter2@localhost:${APTHTTPPORT}"
 rewritesourceslist "https://localhost:${APTHTTPSPORT}"
 runtest "https://localhost:${APTHTTPSPORT}"
 rewritesourceslist "http://localhost:${APTHTTPPORT}"