]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-authentication-basic
tests: don't use hardcoded port for http and https
[apt.git] / test / integration / test-authentication-basic
index 21b0249703e89c4e405a70240e47d3f01d169f40..e6dfc0272ecb4f01db3352e732561f3430ec8307 100755 (executable)
@@ -24,7 +24,7 @@ testauthfailure() {
 testauthsuccess() {
        testsuccess apthelper download-file "${1}/bash" ./downloaded/bash
        testfileequal ./downloaded/bash "$(cat aptarchive/bash)"
-       testfilestats ./downloaded/bash '%U:%G:%a' '=' "${USER}:${USER}:644"
+       testfilestats ./downloaded/bash '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644"
        rm -f ./downloaded/bash
 
        # lets see if got/retains acceptable permissions
@@ -32,13 +32,13 @@ testauthsuccess() {
                if [ "$(id -u)" = '0' ]; then
                        testfilestats "$AUTHCONF" '%U:%G:%a' '=' "_apt:root:600"
                else
-                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "${USER}:${USER}:600"
+                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:600"
                fi
        fi
 
        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
@@ -83,24 +83,24 @@ password hunter2'
 }
 
 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 "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}"