Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get Variable value when exporting through envVars: #484

Open
rahulsyal92 opened this issue Jan 23, 2025 · 0 comments
Open

Unable to get Variable value when exporting through envVars: #484

rahulsyal92 opened this issue Jan 23, 2025 · 0 comments

Comments

@rahulsyal92
Copy link

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"
  1. 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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant