"Fossies" - the Fresh Open Source Software Archive

Member "apt-2.2.4/test/integration/test-apt-https-transient" (10 Jun 2021, 1906 Bytes) of package /linux/misc/apt-2.2.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 set -e
    3 
    4 TESTDIR="$(readlink -f "$(dirname "$0")")"
    5 . "$TESTDIR/framework"
    6 
    7 setupenvironment
    8 configarchitecture "i386"
    9 
   10 # Disable sandbox to avoid W: down below
   11 echo 'APT::Sandbox::User "root";' > rootdir/etc/apt/apt.conf.d/no-acquire-sandbox
   12 
   13 echo 'alright' > aptarchive/working
   14 changetohttpswebserver
   15 
   16 msgtest 'download of a file works via' 'http'
   17 testsuccess --nomsg downloadfile "http://localhost:${APTHTTPPORT}/working" httpsfile
   18 testfileequal httpsfile 'alright'
   19 rm -f httpfile httpsfile
   20 
   21 msgtest 'download of a file works via' 'https'
   22 testsuccess --nomsg downloadfile "https://localhost:${APTHTTPSPORT}/working" httpfile
   23 testfileequal httpfile 'alright'
   24 rm -f httpfile httpsfile
   25 
   26 # Speak wrong protocols (https on http port and vice versa). We check that they can be retried.
   27 
   28 msgtest 'protocol negotiation error is transient for' 'https'
   29 testfailureequal "Ign:1 https://localhost:${APTHTTPPORT}/working
   30   Could not wait for server fd - select (11: Resource temporarily unavailable)
   31 Err:1 https://localhost:${APTHTTPPORT}/working
   32   Could not wait for server fd - select (11: Resource temporarily unavailable)
   33 E: Failed to fetch https://localhost:${APTHTTPPORT}/working  Could not wait for server fd - select (11: Resource temporarily unavailable)
   34 E: Download Failed" apthelper download-file "https://localhost:${APTHTTPPORT}/working" httpfile -oAcquire::https::Timeout=1 -oAcquire::Retries=1
   35 
   36 # Speak wrong protocols (https on http port and vice versa)
   37 msgtest 'protocol negotiation error is transient for' 'http'
   38 testfailureequal "Ign:1 http://localhost:${APTHTTPSPORT}/working
   39   Connection failed
   40 Err:1 http://localhost:${APTHTTPSPORT}/working
   41   Connection failed
   42 E: Failed to fetch http://localhost:${APTHTTPSPORT}/working  Connection failed
   43 E: Download Failed" apthelper download-file "http://localhost:${APTHTTPSPORT}/working" httpfile -oAcquire::https::Timeout=1 -oAcquire::Retries=1