Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Issue 6246037: Add sanity test for /etc/lsb-release file in CrOS images (Closed)

Created:
9 years, 10 months ago by jimhebert
Modified:
9 years, 7 months ago
Reviewers:
petkov, gauravsh
CC:
chromium-os-reviews_chromium.org, Randall Spangler, gauravsh, Luigi Semenzato, Bill Richardson, Sumit
Visibility:
Public.

Description

Add sanity test for /etc/lsb-release file in CrOS images Change-Id: Ib8061ba35afd9681dc70fe1a1459ff9a00f74c3f BUG=chrome-os-partner:2181 TEST=./ensure_sane_lsb-release.sh chromiumos_base_image.bin (passes) Also tested each of the "test fail" possibilities: * Tested by changing various values in the .config file to force each mismatch/failure * Tested lsb_syntaxcheck by isolating it and having it check a mock bad lsb-release file containing each of the possible syntax violations. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=6b2b81c

Patch Set 1 #

Total comments: 30

Patch Set 2 : Hopefully address all-except-indentation-related items #

Patch Set 3 : Fix indentation/style #

Total comments: 2

Patch Set 4 : +gauravsh's suggested default config filename #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -0 lines) Patch
A scripts/image_signing/ensure_sane_lsb-release.sh View 1 2 3 1 chunk +161 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
jimhebert
Thanks in advance for your review!
9 years, 10 months ago (2011-02-01 23:31:53 UTC) #1
gauravsh
http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh File scripts/image_signing/ensure_sane_lsb-release.sh (right): http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh#newcode123 scripts/image_signing/ensure_sane_lsb-release.sh:123: extra newline http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh#newcode133 scripts/image_signing/ensure_sane_lsb-release.sh:133: for b in ${expected_boards[@]}; do ...
9 years, 10 months ago (2011-02-02 01:33:42 UTC) #2
petkov
thanks much for adding this test. comments below. http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh File scripts/image_signing/ensure_sane_lsb-release.sh (right): http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh#newcode16 scripts/image_signing/ensure_sane_lsb-release.sh:16: echo ...
9 years, 10 months ago (2011-02-02 15:57:12 UTC) #3
jimhebert
Agree with all the great feedback, thanks! New rev uploaded. See below. http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sane_lsb-release.sh File scripts/image_signing/ensure_sane_lsb-release.sh ...
9 years, 10 months ago (2011-02-02 23:51:35 UTC) #4
jimhebert
... and now with indentation fixed. PTAL. On 2011/02/02 23:51:35, jimhebert wrote: > Agree with ...
9 years, 10 months ago (2011-02-03 00:54:49 UTC) #5
gauravsh
9 years, 10 months ago (2011-02-03 01:12:38 UTC) #6
LGTM with 2 comments which you may choose to ignore or address in a separate CL.

http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sa...
File scripts/image_signing/ensure_sane_lsb-release.sh (right):

http://codereview.chromium.org/6246037/diff/1/scripts/image_signing/ensure_sa...
scripts/image_signing/ensure_sane_lsb-release.sh:119: cut -d = -f 2 | cut -d -
-f 1,2)
On 2011/02/02 15:57:12, petkov wrote:
> this may be a bit flaky but i don't have much better suggestions. i don't
think
> there's a rule that the basic board name is id-id. somebody may come up with
> x86-mario-v2, for example.

Yes, I agree with this concern. The proper solution (IMO) would be to have a
canonical board/platform name in lsb-release. Right now we overload that to
indicate how the image is signed.

http://codereview.chromium.org/6246037/diff/6001/scripts/image_signing/ensure...
scripts/image_signing/ensure_sane_lsb-release.sh:50: # - Each line is a
reasonable size (256 bytes).
you could, I guess, also use an eval assuming the 3rd argument is the name of a
list. not sure, if it will be necessarily cleaner, but worth a thought.

http://codereview.chromium.org/6246037/diff/6001/scripts/image_signing/ensure...
scripts/image_signing/ensure_sane_lsb-release.sh:122: eval
"expected_appid=\"\$expected_appid_$boardvar\""
A thought: Since we will only keep the a default config file in here (and not
the actual production config), you could replace this substitution with a file
called ${SCRIPT_DIR}/default_lsb_release.config.

This way the default config data file is not tied to the name of the script
(which makes renaming easier).

Powered by Google App Engine
This is Rietveld 408576698