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

Side by Side Diff: src/scripts/test_image

Issue 661239: Add test_image script for checking that dependencies in image are sane (Closed)
Patch Set: Update test_image to skip chrome on the arm architecture, and to test more binaries Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/scripts/check_deps ('K') | « src/scripts/check_deps ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Load common constants. This should be the first executable line.
8 # The path to common.sh should be relative to your script's location.
9 . "$(dirname "$0")/common.sh"
10
11 # Flags
12 DEFINE_string target "x86" \
13 "The target architecture to test. One of { x86, arm }."
14 DEFINE_string root "" \
15 "The root file system to check."
16
17 # Parse command line
18 FLAGS "$@" || exit 1
19 eval set -- "${FLAGS_ARGV}"
20
21 # Die on any errors
22 set -e
23
24 # Check all parts of a pipe
25 set -o pipefail
26
27 ROOT="$FLAGS_root"
28 if [[ -z "$ROOT" ]]; then
29 echo "Error: --root is required."
30 exit 1
31 fi
32 if [[ ! -d "$ROOT" ]]; then
33 echo "Error: Root FS does not exist ($ROOT)"
34 exit 1
35 fi
36
37 EXITCODE=0
38
39 BINARIES="$ROOT/usr/bin/Xorg
40 $ROOT/usr/bin/chromeos-wm
41 $ROOT/boot/vmlinuz
42 $ROOT/sbin/session_manager
43 $ROOT/bin/sed"
44
45 if [[ $FLAGS_target != arm ]]; then
46 # chrome isn't present on arm
47 BINARIES="$BINARIES
48 $ROOT/opt/google/chrome/chrome"
49 fi
50
51 for i in $BINARIES; do
52 if ! [[ -x $i ]]; then
53 echo test_image: Cannot find $i
54 EXITCODE=1
55 fi
56 done
57
58 LIBS="`sudo find $ROOT -type f -name '*.so*'`"
59
60 # Check that all .so files, plus the binaries, have the appropriate dependencies
61 if ! "${SCRIPTS_DIR}/check_deps" "$ROOT" $BINARIES $LIBS; then
62 echo test_image: Failed dependency check
63 EXITCODE=1
64 fi
65
66 exit $EXITCODE
OLDNEW
« src/scripts/check_deps ('K') | « src/scripts/check_deps ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698