blob: db0fd39fcc6b7fa80cd4c1a14f2746b95f3e2832 [file] [log] [blame]
#!/bin/bash
# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
. tests/test_helpers
setup_working_path
stub_git
stub_tar
stub_curl
echo "Testing bdk bsp download"
# Note: download, update, and install should all be aliases for the same thing.
# This tests download from nothing in the bdk tree, bsp_update.sh tests
# updating a messed up bdk tree, bsp_install.sh tests installing from an
# already present tarball.
${BDK} bsp download test_board -a -m "${DATA_DIR}/test_manifest.json"\
| tee output.txt
# All checks are obviously dependent upon how test_bard is defined
# in test_manifest.
# Success message expected.
grep "Successfully installed all packages for Test Board." output.txt
# Make sure download happened.
grep "git subpackage license" ${TEST_BSPs}/git_package/source_versions\
/branch\:deadbeef/git_subdir/git_license.txt
tar_source=${TEST_BSPs}/tar_package/source_versions\
/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
grep "tar license 1" ${tar_source}/tar/sub1/tar_license1.txt
grep "tar license 2" ${tar_source}/tar/sub2/deeper/tar_license2.txt