Procházet zdrojové kódy

test: Always install dpkg into our tests, regardless of MA

Even if we only configure a single architecture, install dpkg, so
dpkg can assert multi arch correctly. This also has the nice side
effect of making single architecture and multiple architecture
test cases more uniform.

This fixes a regression from f878d3a862128bc1385616751ae1d78246b1bd01
("test: Assert multi-arch in the chroot").
Julian Andres Klode před 9 roky
rodič
revize
561a3557e7

+ 5 - 7
test/integration/framework

@@ -534,13 +534,11 @@ configdpkg() {
 		fi
 		fi
 	fi
 	fi
 	rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
 	rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
-	# if multi-arch make sure dpkg can detect itself as capable of it
-	if getarchitectures | grep -E -q '[^ ]+ [^ ]+'; then
-		if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
-			# dpkg doesn't really check the version as long as it is fully installed,
-			# but just to be sure we choose one above the required version
-			insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
-		fi
+	# make sure dpkg can detect itself as capable of it
+	if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
+		# dpkg doesn't really check the version as long as it is fully installed,
+		# but just to be sure we choose one above the required version
+		insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
 	fi
 	fi
 	if dpkg --assert-multi-arch >/dev/null 2>&1 ; then
 	if dpkg --assert-multi-arch >/dev/null 2>&1 ; then
 		local ARCHS="$(getarchitectures)"
 		local ARCHS="$(getarchitectures)"

+ 2 - 0
test/integration/test-apt-cli-list

@@ -22,6 +22,7 @@ setupaptarchive
 testsuccessequal "Listing...
 testsuccessequal "Listing...
 bar/now 1.0 i386 [installed,local]
 bar/now 1.0 i386 [installed,local]
 baz/unstable 2.0 all [upgradable from: 0.1]
 baz/unstable 2.0 all [upgradable from: 0.1]
+dpkg/now 1.16.2+fake all [installed,local]
 foo/unstable 1.0 all
 foo/unstable 1.0 all
 foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list
 foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list
 
 
@@ -38,6 +39,7 @@ foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list --upgradable
 testsuccessequal "Listing...
 testsuccessequal "Listing...
 bar/now 1.0 i386 [installed,local]
 bar/now 1.0 i386 [installed,local]
 baz/now 0.1 all [installed,upgradable to: 2.0]
 baz/now 0.1 all [installed,upgradable to: 2.0]
+dpkg/now 1.16.2+fake all [installed,local]
 foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed
 foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed
 
 
 testsuccessequal "Listing...
 testsuccessequal "Listing...

+ 3 - 3
test/integration/test-apt-move-and-forget-manual-sections

@@ -15,17 +15,17 @@ buildsimplenativepackage 'libdef' 'native' '1' 'unstable' '' '' 'libs'
 setupaptarchive
 setupaptarchive
 
 
 testmarkedauto
 testmarkedauto
-testmarkedmanual
+testmarkedmanual 'dpkg'
 
 
 testsuccess aptget install libabc/stable -y
 testsuccess aptget install libabc/stable -y
 testdpkginstalled 'libabc'
 testdpkginstalled 'libabc'
 testdpkgnotinstalled 'libdef'
 testdpkgnotinstalled 'libdef'
 
 
-testmarkedmanual 'libabc'
+testmarkedmanual 'dpkg' 'libabc'
 testmarkedauto
 testmarkedauto
 
 
 testsuccess aptget dist-upgrade -y
 testsuccess aptget dist-upgrade -y
 testdpkginstalled 'libabc' 'libdef'
 testdpkginstalled 'libabc' 'libdef'
 
 
 testmarkedauto 'libabc'
 testmarkedauto 'libabc'
-testmarkedmanual 'libdef'
+testmarkedmanual 'dpkg' 'libdef'

+ 2 - 1
test/integration/test-apt-update-nofallback

@@ -41,7 +41,8 @@ N: See apt-secure(8) manpage for repository creation and user configuration deta
 
 
 assert_repo_is_intact()
 assert_repo_is_intact()
 {
 {
-    testsuccessequal "foo/unstable 2.0 all" apt list -qq
+    testsuccessequal "dpkg/now 1.16.2+fake all [installed,local]
+foo/unstable 2.0 all" apt list -qq
     testsuccess aptget install -y -s foo
     testsuccess aptget install -y -s foo
     testfailure aptget install -y evil
     testfailure aptget install -y evil
     testsuccess aptget source foo --print-uris
     testsuccess aptget source foo --print-uris

+ 4 - 2
test/integration/test-apt-update-rollback

@@ -39,7 +39,8 @@ start_with_good_inrelease() {
     create_fresh_archive
     create_fresh_archive
     testsuccess aptget update
     testsuccess aptget update
     listcurrentlistsdirectory > lists.before
     listcurrentlistsdirectory > lists.before
-    testsuccessequal 'old/unstable 1.0 all' apt list -qq
+    testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local]
+old/unstable 1.0 all' apt list -qq
 }
 }
 
 
 test_inrelease_to_new_inrelease() {
 test_inrelease_to_new_inrelease() {
@@ -48,7 +49,8 @@ test_inrelease_to_new_inrelease() {
 
 
     add_new_package '+1hour'
     add_new_package '+1hour'
     testsuccess aptget update -o Debug::Acquire::Transaction=1
     testsuccess aptget update -o Debug::Acquire::Transaction=1
-    testsuccessequal 'new/unstable 1.0 all
+    testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local]
+new/unstable 1.0 all
 old/unstable 1.0 all' apt list -qq
 old/unstable 1.0 all' apt list -qq
 }
 }
 
 

+ 2 - 1
test/integration/test-bug-728500-tempdir

@@ -18,5 +18,6 @@ export TMPDIR=/does-not-exists
 testsuccess aptget update -o Debug::Acquire::gpg=1
 testsuccess aptget update -o Debug::Acquire::gpg=1
 unset TMPDIR
 unset TMPDIR
 
 
-testsuccessequal 'coolstuff' aptcache pkgnames
+testsuccessequal 'coolstuff
+dpkg' aptcache pkgnames
 testsuccess ls rootdir/var/lib/apt/lists/*InRelease
 testsuccess ls rootdir/var/lib/apt/lists/*InRelease

+ 1 - 0
test/integration/test-bug-753297-upgradable

@@ -31,4 +31,5 @@ N: There is 1 additional version. Please use the '-a' switch to see it" apt list
 
 
 testsuccessequal "Listing...
 testsuccessequal "Listing...
 bar/testing 2 all [upgradable from: 1]
 bar/testing 2 all [upgradable from: 1]
+dpkg/now 1.16.2+fake all [installed,local]
 foo/testing,now 1 all [installed]" apt list
 foo/testing,now 1 all [installed]" apt list

+ 1 - 1
test/integration/test-external-installation-planner-protocol

@@ -43,7 +43,7 @@ Remove: bar:amd64
 Install: libfoo:amd64 foo:amd64
 Install: libfoo:amd64 foo:amd64
 Planner: internal' head -n 6 "$EIPPLOG"
 Planner: internal' head -n 6 "$EIPPLOG"
 aptinternalplanner < "$EIPPLOG" > planner.log || true
 aptinternalplanner < "$EIPPLOG" > planner.log || true
-testsuccessequal 'Remove: 6
+testsuccessequal 'Remove: 7
 Unpack: 2
 Unpack: 2
 Unpack: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log
 Unpack: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log