crosvm/ci/crosvm_aarch64_builder/entrypoint
Dennis Kempin 4d2253b529 Kokoro: Extensive polishing and bugfixing
This CL fixes some of the issues that prevented the
test system from running on other workstations.

- Builders run by Kokoro will not use a scratch mount.
  It's not needed, and will cause issues if stored on
  /tmp with noexec set.
- Running podman with label=disable to prevent selinux
  issues.

The run_tests implementation has been moved to a separate
file and updated with parsing of cargo test output. This
allows simpler test output and integration with the
test results UI in sponge.

The sponge test UI can make it much easier to see which
tests failed, and to find the log of that test case.

This CL also includes an ./ci/kokoro/uprev script to
uprev the manifest versions. And runs the uprev.

BUG=b:174861002
TEST=Tested by forcing a kokoro build with this CL

Change-Id: I0cba9bb68915e2558a4ea6061dd9ba0a7050421b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2669712
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-02-10 22:04:43 +00:00

53 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# Copyright 2021 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.
# Clean scratch directory if requested.
if [ "$1" = "--clean" ]; then
shift
echo "Cleaning scratch directory..."
rm -rf /workspace/scratch/*
fi
echo "Building ChromeOS dependencies..."
if ! make -j $(nproc) -C ci/build_environment TARGET_ARCH=aarch64 \
>/workspace/logs/build_environment.log 2>&1; then
echo "Failed to build ChromeOS dependencies"
cat /workspace/logs/build_environment.log
# Drop into an interactive shell for debugging.
if [[ $# -eq 0 ]]; then
/bin/bash
fi
exit 1
fi
if [ "$1" = "--vm" ]; then
shift
echo "Starting testing vm..."
(cd /workspace/vm && screen -Sdm vm ./start_vm)
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="\
/workspace/vm/exec_file"
test_target="Virtual Machine (See 'screen -r vm')"
export CROSVM_USE_VM=1
else
test_target="User-space emulation"
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="\
qemu-${target_arch}-static \
-E LD_LIBRARY_PATH=/workspace/scratch/lib"
fi
echo ""
echo "crosvm builder is ready:"
echo " Cargo version: $(cargo --version)"
echo " Target architecture: ${CARGO_BUILD_TARGET}"
echo " Test target: ${test_target}"
echo ""
# Run user provided command or interactive shell
if [[ $# -eq 0 ]]; then
/bin/bash
else
echo "$ $@"
/bin/bash -c "$@"
fi