Преглед изворни кода

disable the lock disabling in the tests

We create our own directories here and work without root in them, so we
can also test the locking with them as it is how we usually operate.

Git-Dch: Ignore
David Kalnischkies пре 11 година
родитељ
комит
546dbfc82a

+ 1 - 2
test/integration/framework

@@ -236,7 +236,6 @@ setupenvironment() {
 
 
 	echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
 	echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
 	echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
 	echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
-	echo "Debug::NoLocking \"true\";" >> aptconfig.conf
 	echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
 	echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
 	echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf
 	echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf
 	# store apt-key were we can access it, even if we run it as a different user
 	# store apt-key were we can access it, even if we run it as a different user
@@ -1412,7 +1411,7 @@ aptautotest() {
 aptautotest_aptget_update() {
 aptautotest_aptget_update() {
 	if ! test -d "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"; then return; fi
 	if ! test -d "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"; then return; fi
 	# all copied files are properly chmodded
 	# all copied files are properly chmodded
-	for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -maxdepth 1 -type f); do
+	for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -maxdepth 1 -type f ! -name 'lock'); do
 		testfilestats "$file" '%U:%G:%a' '=' "${USER}:${USER}:644"
 		testfilestats "$file" '%U:%G:%a' '=' "${USER}:${USER}:644"
 	done
 	done
 }
 }

+ 3 - 2
test/integration/test-apt-get-update-unauth-warning

@@ -27,8 +27,9 @@ W: The repository 'file: unstable Release' does not have a Release file. This is
 E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
 E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
 
 
 # no package foo
 # no package foo
-testequal "Listing..." apt list foo
-testequal "partial" ls rootdir/var/lib/apt/lists
+testequal 'Listing...' apt list foo
+testequal 'lock
+partial' ls rootdir/var/lib/apt/lists
 
 
 # allow override
 # allow override
 testequal "Ign file: unstable InRelease
 testequal "Ign file: unstable InRelease

+ 1 - 0
test/integration/test-apt-update-transactions

@@ -49,6 +49,7 @@ testsetup() {
 	msgmsg 'Test with no initial data over' "$1"
 	msgmsg 'Test with no initial data over' "$1"
 	rm -rf rootdir/var/lib/apt/lists
 	rm -rf rootdir/var/lib/apt/lists
 	mkdir -m 700 -p rootdir/var/lib/apt/lists/partial
 	mkdir -m 700 -p rootdir/var/lib/apt/lists/partial
+	touch rootdir/var/lib/apt/lists/lock
 	if [ "$(id -u)" = '0' ]; then
 	if [ "$(id -u)" = '0' ]; then
 		chown _apt:root rootdir/var/lib/apt/lists/partial
 		chown _apt:root rootdir/var/lib/apt/lists/partial
 	fi
 	fi

+ 2 - 1
test/integration/test-ubuntu-bug-346386-apt-get-update-paywall

@@ -40,7 +40,8 @@ msgtest 'Got expected failure message' 'apt-get update'
 aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail
 aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail
 
 
 ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0
 ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0
-testequal 'partial' ls $LISTS
+testequal 'lock
+partial' ls $LISTS
 
 
 # and again with pre-existing files with "valid data" which should remain
 # and again with pre-existing files with "valid data" which should remain
 for f in Release Release.gpg main_binary-amd64_Packages main_source_Sources; do
 for f in Release Release.gpg main_binary-amd64_Packages main_source_Sources; do