2018-03-15 16:59:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2018 The Chromium OS Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
main() {
|
2018-09-20 21:39:59 +00:00
|
|
|
if [ -z "${KOKORO_ARTIFACTS_DIR}" ]; then
|
|
|
|
echo "This script must be run in kokoro"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-03-15 16:59:19 +00:00
|
|
|
|
2018-09-20 21:39:59 +00:00
|
|
|
local src_root="${KOKORO_ARTIFACTS_DIR}"/git/crosvm
|
|
|
|
local base_image_tarball="${KOKORO_GFILE_DIR}"/crosvm-base.tar.xz
|
|
|
|
local base_image="crosvm-base"
|
2018-03-15 16:59:19 +00:00
|
|
|
|
2018-09-20 21:39:59 +00:00
|
|
|
if [[ "$(docker images -q ${base_image} 2> /dev/null)" == "" ]]; then
|
|
|
|
docker load -i "${base_image_tarball}"
|
|
|
|
fi
|
|
|
|
docker run \
|
2018-11-07 22:02:57 +00:00
|
|
|
--rm \
|
2018-09-20 21:39:59 +00:00
|
|
|
--privileged \
|
|
|
|
-e TEST_RUNNER_FLAGS='--format terse' \
|
|
|
|
-v /dev/log:/dev/log \
|
|
|
|
-v "${src_root}":/src:ro \
|
|
|
|
${base_image}
|
|
|
|
|
|
|
|
return 0
|
2018-03-15 16:59:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|