X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d61960d9244340956a27f4ca46aecd15cc75e18b..4ff5e237d5685be187a75c563b86e80ea3e7cc01:/test/integration/test-authentication-basic?ds=inline

diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic
index 7e74726be..3bfd076ce 100755
--- a/test/integration/test-authentication-basic
+++ b/test/integration/test-authentication-basic
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 
 setupenvironment
 configarchitecture 'i386'
@@ -10,7 +10,7 @@ configarchitecture 'i386'
 insertpackage 'unstable' 'foo' 'all' '1'
 setupaptarchive --no-update
 
-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
 
@@ -30,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
@@ -38,7 +38,7 @@ testauthsuccess() {
 
 	rm -rf rootdir/var/lib/apt/lists
 	testsuccess aptget update
-	testequal 'Reading package lists...
+	testsuccessequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed:
   foo
@@ -61,7 +61,7 @@ runtest() {
 
 	# good auth
 	authfile 'machine localhost
-login star
+login star@irc
 password hunter2'
 	testauthsuccess "$1"
 
@@ -77,30 +77,33 @@ login debian
 password jessie
 
 machine localhost
-login star
+login star@irc
 password hunter2'
 	testauthsuccess "$1"
 }
 
 msgmsg 'server basic auth'
-rewritesourceslist 'http://localhost:8080'
-runtest 'http://localhost:8080'
-rewritesourceslist 'https://localhost:4433'
-runtest 'https://localhost:4433'
-rewritesourceslist 'http://localhost:8080'
+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}"
 
 msgmsg 'proxy to server basic auth'
 webserverconfig 'aptwebserver::request::absolute' 'uri'
-export http_proxy='http://localhost:8080'
-runtest 'http://localhost:8080'
+export http_proxy="http://localhost:${APTHTTPPORT}"
+runtest "http://localhost:${APTHTTPPORT}"
 unset http_proxy
 
 msgmsg 'proxy basic auth to server basic auth'
 webserverconfig 'aptwebserver::proxy-authorization' "$(printf 'moon:deer2' | base64)"
-export http_proxy='http://moon:deer2@localhost:8080'
-runtest 'http://localhost:8080'
+export http_proxy="http://moon:deer2@localhost:${APTHTTPPORT}"
+runtest "http://localhost:${APTHTTPPORT}"
 
 msgmsg 'proxy basic auth to server'
 authfile ''
 webserverconfig 'aptwebserver::authorization' ''
-testauthsuccess 'http://localhost:8080'
+testauthsuccess "http://localhost:${APTHTTPPORT}"