Unable to get Variable value when exporting through envVars:

Aperta
#484 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
docker, go
Ambito
cli, testing-qa

Direzione di ricerca

Inizia riproducendo il test di command da test.yaml rispetto all’immagine specificata owasp/modsecurity-crs:4.0.0-nginx-alpine-202402261002, concentrandoti sulla voce envVars e sull’output di command. Traccia il modo in cui commandTests passa le variabili d’ambiente al container; il lavoro è completato quando PROJECT_MODE è visibile in stdout e il test continua a superare il controllo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 .

Lingua principale
Go
Stelle
2.5k
Fork
213
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GoogleContainerTools/container-structure-test

Tutte le issue di GoogleContainerTools/container-structure-test

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.