Skip to content

Commit

Permalink
Merge pull request #4267 from kolyshkin/test-testdata-rm
Browse files Browse the repository at this point in the history
test/testdata: rm some files
  • Loading branch information
openshift-merge-robot committed Oct 15, 2020
2 parents e7c64e8 + d04aa90 commit b49cac4
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 522 deletions.
41 changes: 31 additions & 10 deletions test/ctr.bats
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,11 @@ function wait_until_exit() {
fi

start_crio
pod_id=$(crictl runp "$TESTDATA"/sandbox_config_privileged.json)
sandbox_config="$TESTDIR"/sandbox_config.json

jq ' .linux.security_context.privileged = true' \
"$TESTDATA"/sandbox_config.json > "$sandbox_config"
pod_id=$(crictl runp "$sandbox_config")

jq ' .devices = [ {
host_path: "/dev/null",
Expand All @@ -544,7 +548,7 @@ function wait_until_exit() {
| .linux.security_context.privileged = true' \
"$TESTDATA"/container_redis.json > "$newconfig"

ctr_id=$(crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config_privileged.json)
ctr_id=$(crictl create "$pod_id" "$newconfig" "$sandbox_config")
crictl start "$ctr_id"

output=$(crictl exec --sync "$ctr_id" ls /dev/mynull)
Expand All @@ -559,7 +563,11 @@ function wait_until_exit() {
fi

start_crio
pod_id=$(crictl runp "$TESTDATA"/sandbox_config_privileged.json)
sandbox_config="$TESTDIR"/sandbox_config.json

jq ' .linux.security_context.privileged = true' \
"$TESTDATA"/sandbox_config.json > "$sandbox_config"
pod_id=$(crictl runp "$sandbox_config")

jq ' .devices = [ {
host_path: "/dev/null",
Expand All @@ -571,7 +579,7 @@ function wait_until_exit() {
"$TESTDATA"/container_redis.json > "$newconfig"

# Error is "configured with a device container path that already exists on the host"
! crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config_privileged.json
! crictl create "$pod_id" "$newconfig" "$sandbox_config"
}

@test "ctr hostname env" {
Expand Down Expand Up @@ -711,11 +719,17 @@ function wait_until_exit() {
@test "ctr /etc/resolv.conf rw/ro mode" {
start_crio
pod_id=$(crictl runp "$TESTDATA"/sandbox_config.json)
ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_config_resolvconf.json "$TESTDATA"/sandbox_config.json)
jq ' .command = ["sh", "-c", "echo test >> /etc/resolv.conf"]' \
"$TESTDATA"/container_config.json > "$newconfig"
ctr_id=$(crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config.json)
crictl start "$ctr_id"
wait_until_exit "$ctr_id"

ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_config_resolvconf_ro.json "$TESTDATA"/sandbox_config.json)
jq ' .command = ["sh", "-c", "echo test >> /etc/resolv.conf"]
| .linux.security_context.readonly_rootfs = true
| .metadata.name = "test-resolv-ro"' \
"$TESTDATA"/container_config.json > "$newconfig"
ctr_id=$(crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config.json)
crictl start "$ctr_id"
wait_until_exit "$ctr_id"
}
Expand Down Expand Up @@ -834,8 +848,10 @@ function wait_until_exit() {
@test "ctr execsync conflicting with conmon env" {
start_crio
pod_id=$(crictl runp "$TESTDATA"/sandbox_config.json)
ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_redis_env_custom.json "$TESTDATA"/sandbox_config.json)
crictl start "$ctr_id"
# XXX: this relies on PATH being the first element in envs[]
jq ' .envs[0].value += ":/acustompathinpath"' \
"$TESTDATA"/container_config.json > "$newconfig"
ctr_id=$(crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config.json)

output=$(crictl exec "$ctr_id" env)
[[ "$output" == *"acustompathinpath"* ]]
Expand Down Expand Up @@ -917,10 +933,15 @@ function wait_until_exit() {
@test "privileged ctr -- check for rw mounts" {
start_crio

pod_id=$(crictl runp "$TESTDATA"/sandbox_config_privileged.json)
sandbox_config="$TESTDIR"/sandbox_config.json

jq ' .linux.security_context.privileged = true' \
"$TESTDATA"/sandbox_config.json > "$sandbox_config"
pod_id=$(crictl runp "$sandbox_config")

jq ' .linux.security_context.privileged = true' \
"$TESTDATA"/container_redis.json > "$newconfig"
ctr_id=$(crictl create "$pod_id" "$newconfig" "$TESTDATA"/sandbox_config_privileged.json)
ctr_id=$(crictl create "$pod_id" "$newconfig" "$sandbox_config")
crictl start "$ctr_id"

output=$(crictl inspect "$ctr_id")
Expand Down
75 changes: 0 additions & 75 deletions test/testdata/container_config_resolvconf.json

This file was deleted.

76 changes: 0 additions & 76 deletions test/testdata/container_config_resolvconf_ro.json

This file was deleted.

29 changes: 0 additions & 29 deletions test/testdata/container_exit_test.json

This file was deleted.

65 changes: 0 additions & 65 deletions test/testdata/container_redis_env_custom.json

This file was deleted.

47 changes: 0 additions & 47 deletions test/testdata/sandbox_config_hostnet.json

This file was deleted.

Loading

0 comments on commit b49cac4

Please sign in to comment.