]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-by-hash-update
add TODO
[apt.git] / test / integration / test-apt-by-hash-update
CommitLineData
50d98a1b
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
10insertpackage 'unstable' 'foo' 'all' '1.0'
11
12setupaptarchive --no-update
13
14APTARCHIVE=$(readlink -f ./aptarchive)
15
16# make Packages *only* accessable by-hash for this test
17mkdir -p aptarchive/dists/unstable/main/binary-i386/by-hash
18(cd aptarchive/dists/unstable/main/binary-i386/by-hash &&
19 mv ../Packages* . &&
20 ln -s Packages.gz $(sha256sum Packages.gz|cut -f1 -d' ') )
21
22# add sources
23mkdir -p aptarchive/dists/unstable/main/source/by-hash
24(cd aptarchive/dists/unstable/main/source/by-hash &&
25 ln -s ../Sources.gz $(sha256sum ../Sources.gz|cut -f1 -d' ')
26)
27
28
29# ensure we do not know about "foo"
30testequal "Reading package lists...
31Building dependency tree...
32E: Unable to locate package foo" aptget install -q -s foo
33
34# ensure we can apt-get update by hash
35testsuccess aptget update -o APT::Acquire::By-Hash=1
36
37# ensure it keeps working
38testequal "Inst foo (1.0 unstable [all])
39Conf foo (1.0 unstable [all])" aptget install -qq -s foo