aboutsummaryrefslogtreecommitdiff
path: root/cli/tests/bsp_download.sh
blob: e88e0586a3c1c98969128075f54ffb9d750d531a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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

# Set up isolation for testing.
export HOME=${PWD} # bsps live in "~/.brillo/.BSPs".
mkdir brillo

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" -o brillo > output.txt

# All checks are obviously dependent upon how test_bard is defined in test_manifest.

# Licenses should have been read.
grep "git subpackage license" output.txt
grep "tar license 1" output.txt
grep "tar license 2" output.txt

# Success message expected.
grep "Successfully installed all packages for Test Board." output.txt
# Make sure links were created.
grep "git subpackage license" brillo/bsp/git/git_subpackage/git_license.txt
grep "tar license 1" brillo/bsp/tar1/tar_license1.txt
grep "tar license 2" brillo/bsp/tar2/deeper/tar_license2.txt