Merge ~smoser/curtin:fix/1747077-curtainer-check-versions into curtin:master

Proposed by Scott Moser
Status: Merged
Approved by: Chad Smith
Approved revision: 9f304bf66aaed6d98e95c4e435246bfab06ea196
Merge reported by: Chad Smith
Merged at revision: d31e27a35a50cf4ccd415c0674c92eda4236a7f9
Proposed branch: ~smoser/curtin:fix/1747077-curtainer-check-versions
Merge into: curtin:master
Diff against target: 32 lines (+9/-2)
1 file modified
tools/curtainer (+9/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+337101@code.launchpad.net

Commit message

tools/curtainer: check that binary and source version are the same.

We saw a puzzling failure of vmtest against the daily archive.
The reason for failure was that the source package that was retrieved
via 'apt-get source' differed in version from the version installed.

This adds a check in curtainer that will exit failure if that is the case.

LP: #1747077

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

This looks perfect.

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/curtainer b/tools/curtainer
2index 618981d..3aa71df 100755
3--- a/tools/curtainer
4+++ b/tools/curtainer
5@@ -164,6 +164,10 @@ main() {
6 inside "$name" $eatmydata apt-get -q update ||
7 fail "failed apt-get update"
8 install "$name" $pkgs || fail "failed install of $pkgs"
9+ local pkg_ver="" src_ver=""
10+ pkg_ver=$(inside "$name" \
11+ dpkg-query --show --showformat='${Version}\n' curtin)
12+ debug 1 "installed curtin at $pkg_ver"
13
14 if [ "${getsource}" != "none" ]; then
15 local isrcd="/tmp/curtin-source"
16@@ -182,11 +186,14 @@ main() {
17 inside "$name" tar -C "$isrcd" -cf - . |
18 tar -C "$getsource" -xf - ||
19 fail "failed to copy source out to $getsource"
20- version=$(inside "$name" dpkg-parsechangelog \
21+ src_ver=$(inside "$name" dpkg-parsechangelog \
22 "--file=$isrcd/debian/changelog" "--show-field=version")
23+ if [ "$src_ver" != "$pkg_ver" ]; then
24+ fail "source version ($src_ver) != package version ($pkg_ver)"
25+ fi
26 inside "$name" rm -Rf "$isrcd" ||
27 fail "failed removal of extract dir"
28- debug 1 "put source for curtin at $version in $getsource"
29+ debug 1 "put source for curtin at $src_ver in $getsource"
30 fi
31
32 CONTAINER=""

Subscribers

People subscribed via source and target branches