Skip to content

Commit 77718dc

Browse files
Merge pull request cri-o#5758 from lack/test-improvements/taskset
Add bats test for infra_ctr_cpuset taskset
2 parents 59ceb0d + 1999baa commit 77718dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/infra_ctr_cpuset.bats

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bats
2+
# vim:set ft=bash :
23

34
load helpers
45

@@ -17,4 +18,11 @@ function teardown() {
1718
output=$(crictl inspectp -o yaml "$pod_id")
1819
[[ "$output" = *"cpus: \"0\""* ]]
1920
check_conmon_cpuset "$pod_id" '0'
21+
22+
# Ensure the container gets the appropriate taskset
23+
ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_redis.json "$TESTDATA"/sandbox_config.json)
24+
ctr_output=$(crictl inspect -o json "$ctr_id")
25+
ctr_pid=$(jq -r '.info.pid' <<< "$ctr_output")
26+
ctr_taskset=$(taskset -p "$ctr_pid")
27+
[[ ${ctr_taskset#*current affinity mask: } = 1 ]]
2028
}

0 commit comments

Comments
 (0)