Seewai Fu | abd65c1 | 2021-07-21 10:30:11 -0700 | [diff] [blame] | 1 | #! /bin/bash -e |
| 2 | |
| 3 | # Copyright 2021 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 | # This script copy the test metadata from build to local test directory |
| 8 | # Example: |
| 9 | # ./copy_metadata.sh hana ./src/chromiumos/test/execution/data/metadata |
Seewai Fu | a93ae85 | 2021-10-05 21:10:53 -0700 | [diff] [blame] | 10 | # This script is temporary solution for testing of cros-test. |
Seewai Fu | abd65c1 | 2021-07-21 10:30:11 -0700 | [diff] [blame] | 11 | # It will be removed after we implement a permanent method to export |
| 12 | # test metadata to a single directory. |
| 13 | |
| 14 | board=$1 |
| 15 | dest=$2 |
| 16 | |
| 17 | if [ -z "${board}" ] |
| 18 | then |
| 19 | echo "board needs to be specified" |
| 20 | exit 1 |
| 21 | fi |
| 22 | if [ -z "${dest}" ] |
| 23 | then |
| 24 | echo "desination needs to be specified" |
| 25 | exit 1 |
| 26 | fi |
| 27 | |
| 28 | rm -rf "${dest:?}"/* |
| 29 | mkdir -p "${dest:?}"/tast/local "${dest:?}"/tast/remote "${dest:?}"/autotest |
| 30 | |
| 31 | cp -p /build/"${board}"/usr/local/build/autotest/autotest_metadata.pb "${dest}"/autotest |
| 32 | cp -p /build/"${board}"/usr/share/tast/metadata/local/cros.pb "${dest}"/tast/local |
| 33 | cp -p /build/"${board}"/build/share/tast/metadata/local/crosint.pb "${dest}"/tast/local |
| 34 | cp -p /usr/share/tast/metadata/remote/cros.pb "${dest}"/tast/remote |