]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-841874-warning-for-mismatching-distribution
show the conflicting distribution warning again
[apt.git] / test / integration / test-bug-841874-warning-for-mismatching-distribution
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture 'amd64'
8
9 insertpackage 'testing' 'foo' 'all' '1'
10
11 getcodenamefromsuite() { echo -n 'stretch'; }
12 setupaptarchive --no-update
13 APTARCHIVE="$(readlink -f './aptarchive')"
14 ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch"
15 ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/zurg"
16
17 testfailure apt show foo
18 testsuccess apt update
19 testsuccess apt show foo
20
21 rm -rf rootdir/var/lib/apt/lists
22 sed -i -e 's#testing#stretch#g' rootdir/etc/apt/sources.list.d/*
23 testsuccess apt update
24 testsuccess apt show foo
25
26 rm -rf rootdir/var/lib/apt/lists
27 sed -i -e 's#stretch#zurg#g' rootdir/etc/apt/sources.list.d/*
28 testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE zurg InRelease (expected zurg but got stretch)" apt update
29 testsuccess apt show foo
30
31 # check that 'foo/bar' is rewritten to 'foo' while we are at it
32 rm -rf rootdir/var/lib/apt/lists
33 sed -i -e 's#zurg#stretch/updates#g' rootdir/etc/apt/sources.list.d/*
34 testfailure apt update
35 testfailure apt show foo
36 ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch/updates"
37 testsuccess apt update
38 testsuccess apt show foo