start_with_good_inrelease() {
create_fresh_archive
testsuccess aptget update
+ listcurrentlistsdirectory > lists.before
testequal "old/unstable 1.0 all" apt list -q
}
E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
# ensure that the Packages file is also rolled back
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
testequal "E: Unable to locate package new" aptget install new -s -qq
}
# update fails
testequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq
- # test that we can install the new packages but do no longer have a sig
+ # test that security downgrade was not successful
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
testsuccess aptget install old -s
testfailure aptget install new -s
testsuccess ls $ROOTDIR/var/lib/apt/lists/*_InRelease
testequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq # -o Debug::acquire::transaction=1
# ensure that the Packages file is also rolled back
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
testsuccess aptget install old -s
testfailure aptget install new -s
testsuccess ls $ROOTDIR/var/lib/apt/lists/*_InRelease
rm $APTARCHIVE/dists/unstable/InRelease
rm $APTARCHIVE/dists/unstable/Release.gpg
- testsuccess aptget update --allow-insecure-repositories
+ testwarning aptget update --allow-insecure-repositories
+ listcurrentlistsdirectory > lists.before
testequal "WARNING: The following packages cannot be authenticated!
old
E: There are problems and -y was used without --force-yes" aptget install -qq -y old
E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
testfailure ls rootdir/var/lib/apt/lists/*_InRelease
testequal "WARNING: The following packages cannot be authenticated!
old
msgmsg 'Test InRelease to InRelease without good sig'
start_with_good_inrelease
- signreleasefiles 'Marvin Paranoid' '+1hour'
+ signreleasefiles 'Marvin Paranoid'
testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2
W: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
testsuccess ls rootdir/var/lib/apt/lists/*_InRelease
}
rm $APTARCHIVE/dists/unstable/main/source/Sources
testfailure aptget update
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
}
TESTDIR=$(readlink -f $(dirname $0))