forked from opencontainers/runc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheduler.bats
34 lines (25 loc) · 937 Bytes
/
scheduler.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bats
load helpers
function setup() {
requires root
setup_debian
}
function teardown() {
teardown_bundle
}
@test "scheduler is applied" {
update_config ' .process.scheduler = {"policy": "SCHED_DEADLINE", "nice": 19, "priority": 0, "runtime": 42000, "deadline": 1000000, "period": 1000000, }'
runc run -d --console-socket "$CONSOLE_SOCKET" test_scheduler
[ "$status" -eq 0 ]
runc exec test_scheduler chrt -p 1
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *"scheduling policy: SCHED_DEADLINE" ]]
[[ "${lines[1]}" == *"priority: 0" ]]
[[ "${lines[2]}" == *"runtime/deadline/period parameters: 42000/1000000/1000000" ]]
}
@test "scheduler vs cpus" {
update_config ' .linux.resources.cpu.cpus = "0"
| .process.scheduler = {"policy": "SCHED_DEADLINE", "nice": 19, "runtime": 42000, "deadline": 1000000, "period": 1000000, }'
runc run -d --console-socket "$CONSOLE_SOCKET" test_scheduler
[ "$status" -eq 1 ]
}