summaryrefslogtreecommitdiff
path: root/tests/common.sh
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2010-06-11 09:15:55 -0700
committerBill Richardson <wfrichar@chromium.org>2010-06-11 09:15:55 -0700
commitf1372d9109d638fbb1a177a89ebaf64e7ee0637e (patch)
tree243cdacbc1028e6a987d582d33927560af0b47e0 /tests/common.sh
parent6a97b3e2a1bee35bf3c00f2fb0faafde4aaab9e2 (diff)
downloadvboot-f1372d9109d638fbb1a177a89ebaf64e7ee0637e.tar.gz
Nearly complete rewrite of cgpt tool.
This fixes a number of bugs, adds a bunch of commands, and essentially makes cgpt ready to use as a replacement for gpt. Still to do is to add commands and options that will let it generated intentionally bad partitions, for use in testing. Review URL: http://codereview.chromium.org/2719008
Diffstat (limited to 'tests/common.sh')
-rwxr-xr-xtests/common.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/common.sh b/tests/common.sh
index 421f6290..6afcd776 100755
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -30,10 +30,21 @@ COL_STOP='\E[0;m'
hash_algos=( sha1 sha256 sha512 )
key_lengths=( 1024 2048 4096 8192 )
+function happy {
+ echo -e "${COL_GREEN}$*${COL_STOP}" 1>&2
+}
+
+function warning {
+ echo -e "${COL_YELLOW}WARNING: $*${COL_STOP}" 1>&2
+}
+
+function error {
+ echo -e "${COL_RED}ERROR: $*${COL_STOP}" 1>&2
+ exit 1
+}
+
function check_test_keys {
- if [ ! -d ${TESTKEY_DIR} ]
- then
- echo "You must run gen_test_keys.sh to generate test keys first."
- exit 1
- fi
+ [ -d ${TESTKEY_DIR} ] || \
+ error "You must run gen_test_keys.sh to generate test keys first."
}
+