4 TESTDIR
="$(readlink -f "$(dirname "$0")")" 
   7 configarchitecture 'amd64' 
   9 buildsimplenativepackage 'foo' 'all' '1' 'stable' 
  10 buildsimplenativepackage 'foo' 'all' '2' 'sid' 
  11 setupaptarchive --no-update 
  13 NEWMETHODS="$(readlink -f rootdir)/usr
/lib
/apt
/methods
" 
  14 OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)" 
  18 IFS="$(printf "\n\b")" 
  19 for METH in $(find "$OLDMETHODS" -maxdepth 1 ! -type d); do 
  20         ln -s "$OLDMETHODS/$(basename "$METH")" "$NEWMETHODS" 
  24 changetohttpswebserver 
  25 for FILE in rootdir/etc/apt/sources.list.d/*-sid-* ; do 
  26         sed -i -e 's#https:#http:#' -e "s
#:${APTHTTPSPORT}/#:${APTHTTPPORT}/#" "$FILE" 
  31         rm -rf rootdir
/var
/lib
/apt
/lists
 
  32         testsuccessequal 
'N: Unable to locate package foo' aptcache policy foo
 
  34 pretest 
'initialize test' 'update' 
  35 testsuccess aptget update
 
  36 testsuccessequal 
"foo: 
  41         500 http://localhost:${APTHTTPPORT} sid/main all Packages 
  43         500 https://localhost:${APTHTTPSPORT} stable/main all Packages" aptcache policy foo
 
  45 pretest 
'not found' 'release files' 
  46 mv aptarchive
/dists
/stable aptarchive
/dists
/stable.good
 
  47 testfailuremsg 
"E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file. 
  48 N: Updating from such a repository can't be done securely, and is therefore disabled by default. 
  49 N: See apt-secure(8) manpage for repository creation and user configuration details." apt update
 
  50 testfailure aptget update 
--no-allow-insecure-repositories 
  51 testequalor2 
"Hit:1 http://localhost:${APTHTTPPORT} sid InRelease 
  52 Ign:2 https://localhost:${APTHTTPSPORT} stable InRelease 
  54 Err:3 https://localhost:${APTHTTPSPORT} stable Release 
  56 Reading package lists... 
  57 E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file. 
  58 N: Updating from such a repository can't be done securely, and is therefore disabled by default. 
  59 N: See apt-secure(8) manpage for repository creation and user configuration details." "Ign:1 https://localhost:${APTHTTPSPORT} stable InRelease 
  61 Err:2 https://localhost:${APTHTTPSPORT} stable Release 
  63 Hit:3 http://localhost:${APTHTTPPORT} sid InRelease 
  64 Reading package lists... 
  65 E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file. 
  66 N: Updating from such a repository can't be done securely, and is therefore disabled by default. 
  67 N: See apt-secure(8) manpage for repository creation and user configuration details." cat rootdir
/tmp
/testfailure.output
 
  69 mv aptarchive
/dists
/stable.good aptarchive
/dists
/stable
 
  71         testsuccessequal 
"foo: 
  76         500 http://localhost:${APTHTTPPORT} sid/main all Packages" aptcache policy foo
 
  80 pretest 
'method disabled' 'https' 
  81 echo 'Dir::Bin::Methods::https "false";' > rootdir
/etc
/apt
/apt.conf.d
/99disable
-https 
  82 testfailuremsg 
"E: The method 'https' is explicitly disabled via configuration. 
  83 N: If you meant to use Tor remember to use tor+https instead of https. 
  84 E: Failed to fetch https://localhost:${APTHTTPSPORT}/dists/stable/InRelease   
  85 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update
 
  86 rm -f rootdir
/etc
/apt
/apt.conf.d
/99disable
-https 
  89 pretest 
'method not installed' 'https' 
  90 rm "${NEWMETHODS}/https" 
  91 testfailuremsg 
"E: The method driver ${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/methods/https could not be found. 
  92 N: Is the package apt-transport-https installed? 
  93 E: Failed to fetch https://localhost:${APTHTTPSPORT}/dists/stable/InRelease   
  94 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update
 
  97 pretest 
'https connection refused' 'doom port' 
  98 for FILE 
in rootdir
/etc
/apt
/sources.list.d
/*-stable-* ; do 
  99         # lets see how many testservers run also Doom 
 100         sed -i -e "s#:${APTHTTPSPORT}/#:666/#" "$FILE" 
 102 testwarning aptget update 
-o Dir
::Bin
::Methods
::https
="${OLDMETHODS}/https" 
 103 testequalor2 
"W: Failed to fetch https://localhost:666/dists/stable/InRelease  Failed to connect to localhost port 666: Connection refused 
 104 W: Some index files failed to download. They have been ignored, or old ones used instead." "W: Failed to fetch https://localhost:666/dists/stable/InRelease  couldn't connect to host 
 105 W: Some index files failed to download. They have been ignored, or old ones used instead." tail -n 2 rootdir
/tmp
/testwarning.output