~ubuntu-branches/debian/experimental/apt/experimental

« back to all changes in this revision

Viewing changes to test/integration/test-partial-file-support

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, David Kalnischkies, Steve Langasek, Michael Vogt
  • Date: 2013-12-07 14:54:31 UTC
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: package-import@ubuntu.com-20131207145431-8av51jnzb9kz20ow
Tags: 0.9.14
[ David Kalnischkies ]
* merge ubuntus apport reporting changes to reduce diff
* enable NOISE for build logs to enable analyse
* introduce a vendor system to change sources.list
* add a vendor specific file to have configurable entities
* use a substvar to set the archive-keyring in debian/control
* cherry-pick ubuntus (disabled) net-update fixes
* generate apt-key script with vendor info about keys
* drop old /var/state to /var/lib transition artefacts

[ Steve Langasek ]
* prepare-release: declare the packages needed as source build deps.

[ Michael Vogt ]
* enable release based selection for deb-src (closes: 731102)
* document Dpkg::Progress-Fancy (closes: 726169), thanks to James McCoy
* vendor/makefile: fix build error for parallel builds
* Handle SIGWINCH in APT::Progress-Fancy=1

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
        rm -f "$DOWNLOG"
19
19
        msgtest "Testing download of file $2 with" "$1"
20
20
        if ! downloadfile "$2" "$3" > "$DOWNLOG"; then
21
 
                cat "$DOWNLOG"
 
21
                cat >&2 "$DOWNLOG"
22
22
                msgfail
23
23
        else
24
24
                msgpass
40
40
                if [ "$EXPECTED" "$4" "$hash" ]; then
41
41
                        msgpass
42
42
                else
43
 
                        cat "$DOWNLOG"
 
43
                        cat >&2 "$DOWNLOG"
44
44
                        msgfail "expected: $EXPECTED ; got: $hash"
45
45
                fi
46
46
        done
47
47
}
48
48
 
49
49
testwebserverlaststatuscode() {
50
 
        STATUS="$(mktemp)"
 
50
        local DOWNLOG='download-testfile.log'
 
51
        rm -f "$DOWNLOG"
 
52
        local STATUS="$(mktemp)"
51
53
        addtrap "rm $STATUS;"
52
54
        msgtest 'Test last status code from the webserver was' "$1"
53
 
        downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" >/dev/null
 
55
        downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
54
56
        if [ "$(cat "$STATUS")" = "$1" ]; then
55
57
                msgpass
56
58
        else
57
 
                cat download-testfile.log
 
59
                cat >&2 "$DOWNLOG"
58
60
                msgfail "Status was $(cat "$STATUS")"
59
61
        fi
60
62
}
64
66
cp -a ${TESTDIR}/framework $TESTFILE
65
67
 
66
68
testrun() {
67
 
        downloadfile "$1/_config/set/aptwebserver::support::range/true" '/dev/null' >/dev/null
68
 
        testwebserverlaststatuscode '200'
 
69
        webserverconfig 'aptwebserver::support::range' 'true'
69
70
 
70
71
        copysource $TESTFILE 0 ./testfile
71
72
        testdownloadfile 'no data' "${1}/testfile" './testfile' '='
92
93
        testdownloadfile 'old data' "${1}/testfile" './testfile' '='
93
94
        testwebserverlaststatuscode '200'
94
95
 
95
 
        downloadfile "$1/_config/set/aptwebserver::support::range/false" '/dev/null' >/dev/null
96
 
        testwebserverlaststatuscode '200'
 
96
        webserverconfig 'aptwebserver::support::range' 'false'
97
97
 
98
98
        copysource $TESTFILE 20 ./testfile
99
99
        testdownloadfile 'no server support' "${1}/testfile" './testfile' '='