summaryrefslogtreecommitdiff
path: root/test/integration/test-same-version-but-different
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2023-08-01 13:59:09 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2023-08-02 12:04:32 +0200
commit5576e7f76da73f3f5217f90d816cc19b6c0a5a77 (patch)
treeb5caa7891f49ae697bd1b8fb0db18f2d8a1a1831 /test/integration/test-same-version-but-different
parent2a8830218bef1fa5fb01a387bddf7d76087eea58 (diff)
Compare SHA256 to check if versions are really the same
If we know both SHA256, and they're different, the packages are. This approach stores the SHA256 only at runtime, avoiding the overhead of storing it on-disk, because when we update repositories we update all of them anyhow. Note that pkgCacheGenerator is hidden, so we can just modify its ABI, hooray. Closes: #931175 LP: #2029268
Diffstat (limited to 'test/integration/test-same-version-but-different')
-rwxr-xr-xtest/integration/test-same-version-but-different11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/integration/test-same-version-but-different b/test/integration/test-same-version-but-different
index df6753a43..595a66fb6 100755
--- a/test/integration/test-same-version-but-different
+++ b/test/integration/test-same-version-but-different
@@ -30,6 +30,9 @@ insertpackage 'testing' 'diff-size' 'all' '1' 'Size: 42'
insertpackage 'unstable' 'diff-instsize' 'all' '1' 'Installed-Size: 21'
insertpackage 'testing' 'diff-instsize' 'all' '1' 'Installed-Size: 42'
+insertpackage 'unstable' 'diff-sha256' 'all' '1' 'SHA256: 0000000000000000000000000000000000000000000000000000000000000000'
+insertpackage 'testing' 'diff-sha256' 'all' '1' 'SHA256: 0000000000000000000000000000000000000000000000000000000000000001'
+
setupaptarchive
APTARCHIVE="$(readlink -f ./aptarchive)"
@@ -96,3 +99,11 @@ testsuccessequal "diff-instsize:
500 file:${APTARCHIVE} testing/main all Packages
1 500
500 file:${APTARCHIVE} unstable/main all Packages" apt policy diff-instsize
+testsuccessequal "diff-sha256:
+ Installed: (none)
+ Candidate: 1
+ Version table:
+ 1 500
+ 500 file:${APTARCHIVE} testing/main all Packages
+ 1 500
+ 500 file:${APTARCHIVE} unstable/main all Packages" apt policy diff-sha256