crosvm/e2e_tests/guest_under_test/use_local_build.sh
Hikaru Nishida cbdf02884c e2e_tests: Update use_local_build.sh to include the initrd env var
Fixup/improvement of crrev/c/5151636

BUG=b:295256641
TEST=make -C e2e_tests/guest_under_test x86_64_initramfs
TEST=source e2e_tests/guest_under_test/use_local_build.sh
TEST=cargo test --package e2e_tests -- boot

Change-Id: I94c092c87434bbd59aea25be456b9160f2882065
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5190791
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-01-15 01:52:27 +00:00

33 lines
1 KiB
Bash
Executable file

#!/bin/bash
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Exports env variables to make the e2e_tests use a locally built
# kernel / rootfs.
#
# Note: `source` this file, do not run it if you want it to set the environmens
# variables for you.
ARCH=$(arch)
TARGET_DIR=$(cargo metadata --no-deps --format-version 1 |
jq -r ".target_directory")
TARGET_DIR=${TARGET_DIR}/guest_under_test/${ARCH}
KERNEL_IMAGE=${TARGET_DIR}/bzImage
if [ -f ${KERNEL_IMAGE} ] ; then
echo "Kernel image overrided: ${KERNEL_IMAGE}"
export CROSVM_CARGO_TEST_KERNEL_IMAGE="${KERNEL_IMAGE}"
fi
ROOTFS_IMAGE=${TARGET_DIR}/rootfs
if [ -f ${ROOTFS_IMAGE} ] ; then
echo "Rootfs image overrided: ${ROOTFS_IMAGE}"
export CROSVM_CARGO_TEST_ROOTFS_IMAGE="${ROOTFS_IMAGE}"
fi
INITRD_IMAGE=${TARGET_DIR}/initramfs.cpio.gz
if [ -f ${INITRD_IMAGE} ] ; then
echo "Initrd image overrided: ${INITRD_IMAGE}"
export CROSVM_CARGO_TEST_INITRD_IMAGE="${INITRD_IMAGE}"
fi