• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2#
3# Copyright 2020 The ChromiumOS Authors
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# Used to run the constrain checks on project configuration. Assumes that
8# it is running in a project directory where the program constraints:
9#   ./program/generated/config.jsonproto
10# and project configuration:
11#   ./generated/config.jsonproto
12# can be found.
13
14# Exit if any command fails.
15set -e
16
17function usage() {
18  echo "Usage: $0" >&2
19  echo "  where you are assumed to be in a project's root directory and" >&2
20  echo "  and program and project config are in the standard locations," >&2
21  echo "  that is:" >&2
22  echo "    ./program/generated/config.jsonproto" >&2
23  echo "    ./generated/config.jsonproto" >&2
24  exit 1
25}
26
27if [[ $# -ne 0  ]]; then
28  usage
29fi
30
31if ! ./config/payload_utils/checker.py \
32  --program ./program/generated/config.jsonproto \
33  --project ./generated/config.jsonproto \
34  --factory_dir=./factory; then
35  echo 'checker.py constraint checks failed'
36  exit 1
37fi
38