Skip to content

Commit

Permalink
run-vmtest@v2: remove unused img input, make vmlinuz optional
Browse files Browse the repository at this point in the history
Previously the first run-vmtest action step would always search for
vmlinux image in KERNEL_ROOT, and then copy it to path specified by
inputs.vmlinuz

However, the caller may want to pass vmlinux image directly.

Change this behavior: search only inputs.vmlinuz was not passed.

Signed-off-by: Ihor Solodrai <[email protected]>
  • Loading branch information
theihor committed Nov 1, 2024
1 parent 4c85516 commit 4db1d56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
20 changes: 5 additions & 15 deletions run-vmtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ inputs:
arch:
description: 'arch'
required: true
img:
description: 'img path'
required: true
vmlinuz:
description: 'vmlinuz path'
required: true
description: |
If passed, this vmlinuz will be used. Otherwise vmlinuz will be
searched via make -s image_name in kbuild-output.
required: false
kernel-root:
description: 'kernel source dir'
default: '.'
Expand All @@ -27,19 +26,11 @@ inputs:
kbuild-output:
description: 'Path to KBUILD_OUTPUT'
required: false
type: string
default: 'kbuild-output'

runs:
using: "composite"
steps:
- name: Find kernel
id: find-kernel
shell: bash
run: |
BUILDDIR=$(realpath ${{ inputs.kbuild-output }})
vmlinuz="$BUILDDIR/$(KBUILD_OUTPUT="${BUILDDIR}" make -C "${{ inputs.kernel-root }}" -s image_name)"
cp "$vmlinuz" ${{ inputs.vmlinuz }}
- name: Download vmtest
shell: bash
# FIXME: move to proper release
Expand Down Expand Up @@ -71,8 +62,7 @@ runs:
- name: Run vmtest
shell: bash
env:
VMLINUZ: ${{ inputs.vmlinuz }}
IMG: ${{ inputs.img }}
VMLINUZ: ${{ inputs.vmlinuz || '' }}
KERNEL_ROOT: ${{ inputs.kernel-root }}
MAX_CPU: ${{ inputs.max-cpu }}
KERNEL_TEST: ${{ inputs.kernel-test }}
Expand Down
5 changes: 5 additions & 0 deletions run-vmtest/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -euo pipefail
trap 'exit 2' ERR

source $(cd $(dirname $0) && pwd)/../helpers.sh
if [[ -z "${VMLINUZ}" || ! -f "${VMLINUZ}" ]]; then
image_name=$(make -C ${KERNEL_ROOT} -s image_name)
export VMLINUZ=$(realpath ${KERNEL_ROOT}/${image_name})
fi


foldable start bpftool_checks "Running bpftool checks..."
bpftool_exitstatus=0
Expand Down

0 comments on commit 4db1d56

Please sign in to comment.