OLD | NEW |
1 #!/bin/bash -eu | 1 #!/bin/bash -eu |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 # Run tests for RSA Signature verification. | 7 # Run tests for RSA Signature verification. |
8 | 8 |
9 # Load common constants and variables. | 9 # Load common constants and variables. |
10 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
11 | 11 |
12 GPT=${1:-../cgpt/cgpt} | 12 GPT=$1 |
13 [ -x "$GPT" ] || error "Can't execute $GPT" | 13 [ -x "$GPT" ] || error "Can't execute $GPT" |
14 warning "testing $GPT" | 14 warning "testing $GPT" |
15 | 15 |
16 echo "Create an empty file to use as the device..." | 16 echo "Create an empty file to use as the device..." |
17 NUM_SECTORS=1000 | 17 NUM_SECTORS=1000 |
18 DEV=$(mktemp) | 18 DEV=$(mktemp) |
19 BOOTFILE=$(mktemp) | 19 BOOTFILE=$(mktemp) |
20 dd if=/dev/zero of=${DEV} conv=notrunc bs=512 count=${NUM_SECTORS} 2>/dev/null | 20 dd if=/dev/zero of=${DEV} conv=notrunc bs=512 count=${NUM_SECTORS} 2>/dev/null |
21 trap "rm -f ${DEV}" EXIT | 21 trap "rm -f ${DEV}" EXIT |
22 | 22 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 $GPT boot -i ${KERN_NUM} ${DEV} >/dev/null | 105 $GPT boot -i ${KERN_NUM} ${DEV} >/dev/null |
106 | 106 |
107 echo "Check the PMBR's idea of the boot partition..." | 107 echo "Check the PMBR's idea of the boot partition..." |
108 X=$($GPT boot ${DEV}) | 108 X=$($GPT boot ${DEV}) |
109 Y=$($GPT show -u -i $KERN_NUM $DEV) | 109 Y=$($GPT show -u -i $KERN_NUM $DEV) |
110 [ "$X" = "$Y" ] || error "fail at line $LINENO" | 110 [ "$X" = "$Y" ] || error "fail at line $LINENO" |
111 | 111 |
112 echo "Done." | 112 echo "Done." |
113 | 113 |
114 happy "All tests passed." | 114 happy "All tests passed." |
OLD | NEW |