-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to make sure /dev/shm is shared between containers in CRI-O
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
function teardown() { | ||
cleanup_test | ||
} | ||
|
||
@test "ctr check shared /dev/shm" { | ||
start_crio | ||
run crictl runp "$TESTDATA"/sandbox_config.json | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
pod_id="$output" | ||
run crictl create "$pod_id" "$TESTDIR"/container_sleep.json "$TESTDATA"/sandbox_config.json | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
ctr_id="$output" | ||
run crictl start "$ctr_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
run crictl exec --sync "$ctr_id" "touch /dev/shm/testdata" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
|
||
run crictl create "$pod_id" "$TESTDIR"/container_redis.json "$TESTDATA"/sandbox_config.json | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
ctr_id="$output" | ||
run crictl start "$ctr_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
run crictl exec --sync "$ctr_id" "ls /dev/shm/testdata" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
|
||
cleanup_ctrs | ||
cleanup_pods | ||
stop_crio | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"metadata": { | ||
"name": "podsandbox-sleep" | ||
}, | ||
"image": { | ||
"image": "quay.io/crio/redis:alpine" | ||
}, | ||
"command": [ | ||
"/bin/sleep", "6000" | ||
], | ||
"args": [ | ||
"6000" | ||
], | ||
"working_dir": "/", | ||
"envs": [ | ||
{ | ||
"key": "PATH", | ||
"value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
}, | ||
{ | ||
"key": "TERM", | ||
"value": "xterm" | ||
}, | ||
{ | ||
"key": "REDIS_VERSION", | ||
"value": "3.2.3" | ||
}, | ||
{ | ||
"key": "REDIS_DOWNLOAD_URL", | ||
"value": "http://download.redis.io/releases/redis-3.2.3.tar.gz" | ||
}, | ||
{ | ||
"key": "REDIS_DOWNLOAD_SHA1", | ||
"value": "92d6d93ef2efc91e595c8bf578bf72baff397507" | ||
} | ||
], | ||
"labels": { | ||
"tier": "backend" | ||
}, | ||
"annotations": { | ||
"pod": "podsandbox1" | ||
}, | ||
"readonly_rootfs": false, | ||
"log_path": "", | ||
"stdin": false, | ||
"stdin_once": false, | ||
"tty": false, | ||
"linux": { | ||
"resources": { | ||
"cpu_period": 10000, | ||
"cpu_quota": 20000, | ||
"cpu_shares": 512, | ||
"oom_score_adj": 30 | ||
}, | ||
} | ||
} |