GoogleContainerTools / GoogleContainerTools/container-structure-test

Unable to get Variable value when exporting through envVars:

Open
#484 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.5k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

Hello

Variable value is not reflecting in the response when running with CST . I am new for this testing and follow the CST official instruction to check test case against the docker image, but not able to get variable value when running through CST.

1. Running the CST as:

container-structure-test test -i owasp/modsecurity-crs:4.0.0-nginx-alpine-202402261002 -c test.yaml

2 . root@kubernetes:~/CST# cat test.yaml
schemaVersion: 2.0.0

commandTests:
- name: "Test"
command: "/bin/sh"
args:
- -c
- |
echo "PROJECT_MODE is: ${PROJECT_MODE}"
envVars:
- key: "PROJECT_MODE"
value: "yes"

3. root@kubernetes:~/CST# container-structure-test test -i owasp/modsecurity-crs:4.0.0-nginx-alpine-202402261002 -c test.yaml

==================================
====== Test file: test.yaml ======
==================================
=== RUN: Command Test: Test
--- PASS
duration: 882.440353ms
stdout: PROJECT_MODE is:
PROJECT_MODE is:-

===================================
============= RESULTS =============
===================================
Passes: 1
Failures: 0
Duration: 882.440353ms
Total tests: 1

PASS
root@kubernetes:~/CST#

Please check and share steps (may be missing ) to get the variable value (PROJECT_MODE ) while running the CST .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.