]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-841874-warning-for-mismatching-distribution
show distribution mismatch for changed codenames
[apt.git] / test / integration / test-bug-841874-warning-for-mismatching-distribution
CommitLineData
d96c997e
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'amd64'
8
9insertpackage 'testing' 'foo' 'all' '1'
10
11getcodenamefromsuite() { echo -n 'stretch'; }
12setupaptarchive --no-update
13APTARCHIVE="$(readlink -f './aptarchive')"
14ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch"
15ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/zurg"
16
17testfailure apt show foo
18testsuccess apt update
19testsuccess apt show foo
20
21rm -rf rootdir/var/lib/apt/lists
22sed -i -e 's#testing#stretch#g' rootdir/etc/apt/sources.list.d/*
23testsuccess apt update
24testsuccess apt show foo
25
26rm -rf rootdir/var/lib/apt/lists
27sed -i -e 's#stretch#zurg#g' rootdir/etc/apt/sources.list.d/*
28testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE zurg InRelease (expected zurg but got stretch)" apt update
29testsuccess apt show foo
30
31# check that 'foo/bar' is rewritten to 'foo' while we are at it
32rm -rf rootdir/var/lib/apt/lists
33sed -i -e 's#zurg#stretch/updates#g' rootdir/etc/apt/sources.list.d/*
34testfailure apt update
35testfailure apt show foo
36ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch/updates"
37testsuccess apt update
38testsuccess apt show foo
d0c7d4d6
DK
39
40# … but only if needed
41rm -rf rootdir/var/lib/apt/lists
42sed -i -e 's#stretch#buster#g' rootdir/etc/apt/sources.list.d/*
43sed -i -e 's#^Codename: stretch$#Codename: buster/updates#g' $(find ./aptarchive -name 'Release')
44signreleasefiles
45testfailure apt update
46testfailure apt show foo
47ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/buster"
48testsuccess apt update
49testsuccess apt show foo
7434f15c
DK
50
51# changing codenames gets a warning, too
52rm -rf rootdir/var/lib/apt/lists
53sed -i -e 's#buster#testing#g' rootdir/etc/apt/sources.list.d/*
54testsuccess apt update
55testsuccess apt show foo
56sed -i -e 's#^Codename: buster#Codename: zurg#g' $(find ./aptarchive -name 'Release')
57signreleasefiles
58testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE testing/updates InRelease (expected buster/updates but got zurg/updates)" apt update
59testsuccess apt show foo
60testsuccess apt update
61testsuccess apt show foo