Skip to content

Commit

Permalink
Add test runner inside qemu (pixie-io#985)
Browse files Browse the repository at this point in the history
Summary: This adds the test_runner script that runs inside of qemu to
manage and
execute the test programs.

Relevant Issues: pixie-io#709

Type of change: /kind test-infra

Test Plan: Tested locally, part of the larger test infra.

Signed-off-by: Zain Asgar <zasgar@pixielabs.ai>
  • Loading branch information
zasgar authored Mar 7, 2023
1 parent 8ed7354 commit 767b81a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions bazel/test_runners/qemu_with_kernel/test_runner_inside_qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Copyright 2018- The Pixie Authors.
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0

set -e

function finish {
retval=$?
/bin/exit_qemu_with_status "${retval}"
}

trap finish EXIT
trap finish ERR

# This file is generated by the test launcher.
# shellcheck disable=SC1091
source /test_fs/test_env.sh

cd "${test_base:?}"

if [[ -n "${GTEST_TMP_DIR}" ]]; then
mkdir -p "${GTEST_TMP_DIR}"
fi

# Actually run the test and capture the return value.
retval=0
"${test_exec_path:?}" || retval=$?
exit $retval

0 comments on commit 767b81a

Please sign in to comment.