forked from adamlaska/runc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bats
More file actions
59 lines (40 loc) · 992 Bytes
/
run.bats
File metadata and controls
59 lines (40 loc) · 992 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bats
load helpers
function setup() {
setup_hello
}
function teardown() {
teardown_bundle
}
@test "runc run" {
runc run test_hello
[ "$status" -eq 0 ]
runc state test_hello
[ "$status" -ne 0 ]
}
@test "runc run --keep" {
runc run --keep test_run_keep
[ "$status" -eq 0 ]
testcontainer test_run_keep stopped
runc state test_run_keep
[ "$status" -eq 0 ]
runc delete test_run_keep
runc state test_run_keep
[ "$status" -ne 0 ]
}
@test "runc run --keep (check cgroup exists)" {
# for systemd driver, the unit's cgroup path will be auto removed if container's all processes exited
requires no_systemd
[[ "$ROOTLESS" -ne 0 ]] && requires rootless_cgroup
set_cgroups_path
runc run --keep test_run_keep
[ "$status" -eq 0 ]
testcontainer test_run_keep stopped
runc state test_run_keep
[ "$status" -eq 0 ]
# check that cgroup exists
check_cgroup_value "pids.max" "max"
runc delete test_run_keep
runc state test_run_keep
[ "$status" -ne 0 ]
}