architect-team / architect-cli

Command line interface for running Architect services locally
https://docs.architect.io
37 stars 13 forks source link

[DO NOT MERGE] Re-enable network policy test #911

Closed TylerAldrich closed 1 year ago

TylerAldrich commented 1 year ago

Re-enabling the network policy test now that we can create an env from the command line with zero-trust enabled: https://gitlab.com/architect-io/architect-cli/-/issues/583

The port number and error message we were looking for both seem to have been changed since this test last worked - I tested this against an environment with zero-trust enabled and disabled to make sure the test worked correctly:

(Environment with zero-trust enabled is ztrust, the default disabled zero trust is example-environment)

~/code/architect/architect-cli (reenable-network-policy-test*) » architect-dev exec -a test-tyler -e ztrust superset.services.stateful-api -- sh -c  "curl --connect-timeout 10 --insecure -L -I http://hello-world--api:8080/ || true" > network_policy_test.txt 2>&1 </dev/null
if [[ $(cat network_policy_test.txt) == *"Timeout was reached"* ]]; then echo "good"; else echo "bad"; fi
good
--------------------------------------------------------------------------------------------------------------------------------------
~/code/architect/architect-cli (reenable-network-policy-test*) » architect-dev exec -a test-tyler -e example-environment superset.services.stateful-api -- sh -c  "curl --connect-timeout 10 --insecure -L -I http://hello-world--api:8080/ || true" > network_policy_test.txt 2>&1 </dev/null
if [[ $(cat network_policy_test.txt) == *"Timeout was reached"* ]]; then echo "good"; else echo "bad"; fi
bad