xref: /aosp_15_r20/external/crosvm/e2e_tests/guest_under_test/run_guest.sh (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1#!/bin/bash
2# Copyright 2022 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Example invocation to run the locally built guest for debugging
7
8CARGO_TARGET=$(cargo metadata --no-deps --format-version 1 |
9        jq -r ".target_directory")
10GUEST_DIR="${CARGO_TARGET}/guest_under_test/x86_64"
11
12cargo run -p crosvm -- \
13    run \
14    -p "init=/bin/sh" \
15    --root "${GUEST_DIR}/rootfs"\
16    "${GUEST_DIR}/bzImage" \
17    "$@"
18