2017-09-22 15:10:15 +00:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load helpers
|
|
|
|
|
|
|
|
IMAGE="redis:alpine"
|
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
cleanup_test
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "bind secrets mounts to container" {
|
|
|
|
start_crio
|
|
|
|
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
pod_id="$output"
|
|
|
|
run crioctl image pull "$IMAGE"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
run crioctl ctr create --config "$TESTDATA"/container_redis.json --pod "$pod_id"
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
ctr_id="$output"
|
2017-10-24 17:43:03 +00:00
|
|
|
run crioctl ctr execsync --id "$ctr_id" cat /proc/mounts
|
2017-09-22 15:10:15 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
mount_info="$output"
|
2017-10-24 17:43:03 +00:00
|
|
|
run grep /container/path1 <<< "$mount_info"
|
2017-09-22 15:10:15 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-10-24 17:43:03 +00:00
|
|
|
rm -rf ${MOUNT_PATH}
|
2017-09-22 15:10:15 +00:00
|
|
|
cleanup_ctrs
|
|
|
|
cleanup_pods
|
|
|
|
stop_crio
|
|
|
|
}
|