+ testfileequal lists.before "$(listcurrentlistsdirectory)"
+}
+
+test_from_inrelease_to_unsigned_with_override()
+{
+ # setup archive with InRelease file
+ setupaptarchive_with_lists_clean
+ testsuccess aptget update
+
+ # simulate moving to a unsigned but otherwise valid repo
+ simulate_mitm_and_inject_evil_package
+ generatereleasefiles '+2 hours'
+ find $APTARCHIVE -name '*Packages*' -exec touch -d '+2 hours' {} \;
+
+ # and ensure we can update to it (with enough force)
+ testwarning aptget update --allow-insecure-repositories \
+ -o Acquire::AllowDowngradeToInsecureRepositories=1 -o Debug::pkgAcquire::Worker=1 -o Debug::pkgAcquire::Auth=1
+ # but that the individual packages are still considered untrusted
+ testfailureequal "WARNING: The following packages cannot be authenticated!
+ evil
+E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y evil