diff --git a/.github/workflows/kernel-test.yml b/.github/workflows/kernel-test.yml index 4c29851..2de9ced 100644 --- a/.github/workflows/kernel-test.yml +++ b/.github/workflows/kernel-test.yml @@ -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. diff --git a/run-vmtest/action.yml b/run-vmtest/action.yml index 55b2dec..945d554 100644 --- a/run-vmtest/action.yml +++ b/run-vmtest/action.yml @@ -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' @@ -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: | diff --git a/run-vmtest/run.sh b/run-vmtest/run.sh index 7a8527c..4a9eb06 100755 --- a/run-vmtest/run.sh +++ b/run-vmtest/run.sh @@ -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 <