Add a test for container default env
@@ -1573,3 +1573,26 @@ function wait_until_exit() {
[ "$status" -eq 0 ]
stop_crio
}
+
+@test "ctr with default_env set in configuration" {
+ export CONTAINER_DEFAULT_ENV="NSS_SDB_USE_CACHE=no"
+ start_crio
+ run crictl runp "$TESTDATA"/sandbox_config.json
+ echo "$output"
+ [ "$status" -eq 0 ]
+ pod_id="$output"
+ run crictl create "$pod_id" "$TESTDATA"/container_config.json "$TESTDATA"/sandbox_config.json
+ echo "$output"
+ [ "$status" -eq 0 ]
+ ctr_id="$output"
+ run crictl exec --sync "$ctr_id" env
+ echo "$output"
+ [ "$status" -eq 0 ]
+ [[ "$output" =~ "NSS_SDB_USE_CACHE=no" ]]
+ run crictl stopp "$pod_id"
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run crictl rmp "$pod_id"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
