mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
As we've done some changes in the VMM vcpu allocation, let's introduce basic tests to make sure that we're getting the expected behaviour. The test consists in checking 3 scenarios: * default_vcpus = 0 | no limits set * this should allocate 1 vcpu * default_vcpus = 0.75 | limits set to 0.25 * this should allocate 1 vcpu * default_vcpus = 0.75 | limits set to 1.2 * this should allocate 2 vcpus The tests are very basic, but they do ensure we're rounding things up to what the new logic is supposed to do. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
#
|
|
# Copyright (c) 2023 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: vcpus-less-than-one-with-no-limits
|
|
annotations:
|
|
io.katacontainers.config.hypervisor.default_vcpus: "0"
|
|
spec:
|
|
runtimeClassName: kata
|
|
containers:
|
|
- name: vcpus-less-than-one-with-no-limits
|
|
image: quay.io/prometheus/busybox:latest
|
|
command: ['nproc', '--all']
|
|
restartPolicy: Never
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: vcpus-less-than-one-with-limits
|
|
annotations:
|
|
io.katacontainers.config.hypervisor.default_vcpus: "0.75"
|
|
spec:
|
|
runtimeClassName: kata
|
|
containers:
|
|
- name: vcpus-less-than-one-with-limits
|
|
image: quay.io/prometheus/busybox:latest
|
|
resources:
|
|
limits:
|
|
cpu: "0.25"
|
|
command: ['nproc', '--all']
|
|
restartPolicy: Never
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: vcpus-more-than-one-with-limits
|
|
annotations:
|
|
io.katacontainers.config.hypervisor.default_vcpus: "0.75"
|
|
spec:
|
|
runtimeClassName: kata
|
|
containers:
|
|
- name: vcpus-more-than-one-with-limits
|
|
image: quay.io/prometheus/busybox:latest
|
|
resources:
|
|
limits:
|
|
cpu: "1.2"
|
|
command: ['nproc', '--all']
|
|
restartPolicy: Never
|
|
---
|