4 # ensure that an update will only succeed entirely or not at all
6 TESTDIR
=$(readlink -f $(dirname $0))
10 configarchitecture
'i386'
12 insertpackage
'unstable' 'foo' 'all' '1.0'
13 insertsource
'unstable' 'foo' 'all' '1.0'
15 setupaptarchive
--no-update
29 testequal
"$(cat $1)" ls rootdir
/var
/lib
/apt
/lists
30 # all copied files are properly chmodded
31 find rootdir
/var
/lib
/apt
/lists
-maxdepth 1 -type f
| while read file; do
32 testaccessrights
"$file" '644'
33 testfilestats
"$file" '%U' '!=' '_apt'
38 # produce an unsigned repository
39 find aptarchive \
( -name 'Release.gpg' -o -name 'InRelease' \
) -delete
40 testfailure aptget update
--no-allow-insecure-repositories
46 breakfile aptarchive
/dists
/unstable
/main
/binary
-i386/Packages
47 testfailure aptget update
49 restorefile aptarchive
/dists
/unstable
/main
/binary
-i386/Packages
51 breakfile aptarchive
/dists
/unstable
/main
/source
/Sources
52 testfailure aptget update
54 restorefile aptarchive
/dists
/unstable
/main
/source
/Sources
58 msgmsg
'Test with no initial data over' "$1"
59 rm -rf rootdir
/var
/lib
/apt
/lists
60 mkdir -p rootdir
/var
/lib
/apt
/lists
/partial
61 ls rootdir
/var
/lib
/apt
/lists
> listsdir.lst
62 testrun
'listsdir.lst'
64 msgmsg
'Test with initial data over' "$1"
65 testsuccess aptget update
66 ls rootdir
/var
/lib
/apt
/lists
> listsdir.lst
67 testrun
'listsdir.lst'