Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
vmlinuz: '${{ github.workspace }}/vmlinuz'
kernel-root: ${{ env.REPO_ROOT }}
max-cpu: 8
max-memory: 16G
kernel-test: ${{ inputs.test }}
# Here we must use kbuild-output local to the repo, because
# it was extracted from the artifacts.
Expand Down
6 changes: 5 additions & 1 deletion run-vmtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ inputs:
description: 'kernel source dir'
default: '.'
max-cpu:
description: 'Maximum number of CPU allocated to a VM (regardless of number of CPUs available on the host). Default is unset, e.g it will default to the number of CPU on the host.'
description: 'Number of CPUs allocated to the VM. Default is 2.'
default: ''
max-memory:
description: 'Amount of memory allocated to the VM (e.g., "4G", "16G"). Default is "4G".'
default: ''
kernel-test:
description: 'Test to run'
Expand Down Expand Up @@ -64,6 +67,7 @@ runs:
KERNEL_ROOT: ${{ inputs.kernel-root }}
KERNEL_TEST: ${{ inputs.kernel-test }}
MAX_CPU: ${{ inputs.max-cpu }}
MAX_MEMORY: ${{ inputs.max-memory }}
OUTPUT_DIR: ${{ inputs.output-dir }}
VMLINUZ: ${{ inputs.vmlinuz || '' }}
run: |
Expand Down
23 changes: 19 additions & 4 deletions run-vmtest/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,25 @@ foldable start vmtest "Starting virtual machine..."

# Tests may be comma-separated. vmtest_selftest expect them to come from CLI space-separated.
TEST_RUNNERS=$(echo ${KERNEL_TEST} | tr -s ',' ' ')
vmtest -k "${VMLINUZ}" --kargs "panic=-1 sysctl.vm.panic_on_oom=1" \
"${GITHUB_ACTION_PATH}/vmtest-init.sh && \
cd '${GITHUB_WORKSPACE}' && \
${VMTEST_SCRIPT} ${TEST_RUNNERS}"

# Configure VM resources
VMTEST_NUM_CPUS=${MAX_CPU:-2}
VMTEST_MEMORY=${MAX_MEMORY:-4G}

# Generate vmtest.toml config file
cat > vmtest.toml <<EOF
[[target]]
name = "vmtest"
kernel = "${VMLINUZ}"
kernel_args = "panic=-1 sysctl.vm.panic_on_oom=1"
command = '''${GITHUB_ACTION_PATH}/vmtest-init.sh && cd '${GITHUB_WORKSPACE}' && ${VMTEST_SCRIPT} ${TEST_RUNNERS}'''

[target.vm]
num_cpus = ${VMTEST_NUM_CPUS}
memory = "${VMTEST_MEMORY}"
EOF

vmtest -c vmtest.toml

# fixup traffic montioring log paths if present
PCAP_DIR=/tmp/tmon_pcap
Expand Down