mirror of https://github.com/istio/istio.io.git
Test cleanup (#8564)
* Framework inject set +e at start of cleanup test script * tabs * fix typo * add nl * fix doc
This commit is contained in:
parent
c5e8a9adc5
commit
a70e78f25e
|
@ -65,5 +65,4 @@ _verify_lines snip_apply_default_destination_rules_2 "
|
|||
"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -40,5 +40,4 @@ snip_disable_the_probe_rewrite_globally_1
|
|||
# TODO test annotation approach and verify both disable approaches work.
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -99,7 +99,6 @@ kubectl annotate deployment my-deployment galley.istio.io/analyze-suppress-
|
|||
snip_annotate_for_deployment_suppression_107
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
kubectl label namespace default istio-injection-
|
||||
kubectl delete ns frod
|
||||
kubectl delete deployment my-deployment
|
||||
|
|
|
@ -82,7 +82,6 @@ _verify_contains snip_view_the_dashboard_dashboard_1 'deployment "kiali" success
|
|||
# TODO Verify the browser output
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
cleanup_bookinfo_sample
|
||||
snip_uninstall_1
|
||||
kubectl delete ns istio-system --ignore-not-found=true
|
||||
|
|
|
@ -56,7 +56,6 @@ time verify_load_balancing
|
|||
|
||||
# @cleanup
|
||||
source content/en/docs/setup/install/multicluster/common.sh
|
||||
set +e # ignore cleanup errors
|
||||
set_single_network_vars
|
||||
time cleanup
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ time verify_load_balancing
|
|||
|
||||
# @cleanup
|
||||
source content/en/docs/setup/install/multicluster/common.sh
|
||||
set +e # ignore cleanup errors
|
||||
set_multi_network_vars
|
||||
time cleanup
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ time verify_load_balancing
|
|||
|
||||
# @cleanup
|
||||
source content/en/docs/setup/install/multicluster/common.sh
|
||||
set +e # ignore cleanup errors
|
||||
set_single_network_vars
|
||||
time cleanup
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ time verify_load_balancing
|
|||
|
||||
# @cleanup
|
||||
source content/en/docs/setup/install/multicluster/common.sh
|
||||
set +e # ignore cleanup errors
|
||||
set_multi_network_vars
|
||||
time cleanup
|
||||
|
||||
|
|
|
@ -46,8 +46,6 @@ _verify_same access_jaeger_by_port_forward "200"
|
|||
pgrep istioctl | xargs kill
|
||||
|
||||
# @cleanup
|
||||
set +e
|
||||
|
||||
# TODO: Fix issue of killing twice (https://github.com/istio/istio.io/issues/8014)
|
||||
pgrep istioctl | xargs kill
|
||||
cleanup_bookinfo_sample
|
||||
|
|
|
@ -50,7 +50,6 @@ _verify_same access_zipkin_with_portforward "200"
|
|||
pgrep istioctl | xargs kill
|
||||
|
||||
# @cleanup
|
||||
set +e
|
||||
cleanup_bookinfo_sample
|
||||
|
||||
# TODO: Fix issue with using killall. Also why do we need to do this in setup and cleanup?
|
||||
|
|
|
@ -63,5 +63,4 @@ _verify_same snip_cleanup_1 "$snip_cleanup_1_out"
|
|||
_verify_same snip_cleanup_2 "$snip_cleanup_2_out"
|
||||
_verify_same snip_cleanup_3 "$snip_cleanup_3_out"
|
||||
|
||||
set +e
|
||||
_undeploy_addons kiali prometheus grafana zipkin
|
||||
|
|
|
@ -69,6 +69,5 @@ _verify_same snip_cleanup_1 "$snip_cleanup_1_out"
|
|||
_verify_same snip_cleanup_2 "$snip_cleanup_2_out"
|
||||
_verify_same snip_cleanup_3 "$snip_cleanup_3_out"
|
||||
|
||||
set +e
|
||||
_undeploy_addons kiali prometheus grafana zipkin
|
||||
kubectl delete ns istio-system
|
||||
|
|
|
@ -49,7 +49,6 @@ _verify_contains snip_test_the_access_log_2 "outbound|8000||httpbin.default.svc.
|
|||
_verify_contains snip_test_the_access_log_3 "outbound_.8000_._.httpbin.default.svc.cluster.local"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
#snip_disable_envoys_access_logging_1
|
||||
#_wait_for_deployment istio-system istiod
|
||||
|
|
|
@ -60,7 +60,6 @@ _verify_lines snip_verify_the_results_2 "
|
|||
"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
cleanup_bookinfo_sample
|
||||
|
||||
# Clean up Istio. NOTE: Don't wipe out CRDs as doing
|
||||
|
|
|
@ -74,7 +74,6 @@ _verify_contains query_rate_of_requests_to_productpage_5m '"productpage.default.
|
|||
pgrep istioctl | xargs kill
|
||||
|
||||
# @cleanup
|
||||
set +e
|
||||
pgrep istioctl | xargs kill
|
||||
kubectl delete -f samples/addons/prometheus.yaml -n istio-system
|
||||
cleanup_bookinfo_sample
|
|
@ -71,7 +71,6 @@ _verify_contains get_metrics_1 '"istio_tcp_connections_opened_total"'
|
|||
pgrep istioctl | xargs kill
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
pgrep istioctl | xargs kill
|
||||
kubectl delete -f samples/bookinfo/networking/virtual-service-ratings-db.yaml
|
||||
kubectl delete -f samples/bookinfo/networking/destination-rule-all.yaml
|
||||
|
|
|
@ -94,8 +94,6 @@ _verify_lines query_request_from_productpage_workload "
|
|||
pgrep istioctl | xargs kill
|
||||
|
||||
# @cleanup
|
||||
set +e
|
||||
|
||||
# TODO: Fix issue of killing twice (https://github.com/istio/istio.io/issues/8014)
|
||||
pgrep istioctl | xargs kill
|
||||
cleanup_bookinfo_sample
|
||||
|
|
|
@ -114,7 +114,6 @@ _verify_same snip_require_valid_tokens_perpath_2 "$snip_require_valid_tokens_pe
|
|||
_verify_same snip_require_valid_tokens_perpath_3 "$snip_require_valid_tokens_perpath_3_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_part_1_1
|
||||
snip_cleanup_part_2_1
|
||||
snip_cleanup_part_3_1
|
||||
|
|
|
@ -56,5 +56,4 @@ _verify_same snip_explicitly_deny_a_request_9 "$snip_explicitly_deny_a_request_9
|
|||
_verify_same snip_explicitly_deny_a_request_10 "$snip_explicitly_deny_a_request_10_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_clean_up_1
|
||||
|
|
|
@ -120,7 +120,6 @@ _wait_for_istio authorizationpolicy default ratings-viewer
|
|||
verify 200 "William Shakespeare" "Book Details" "Book Reviews"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_clean_up_1
|
||||
# remaining cleanup (undocumented).
|
||||
cleanup_bookinfo_sample
|
||||
|
|
|
@ -84,6 +84,5 @@ _verify_same snip_ipbased_allow_list_and_deny_list_11 "$snip_ipbased_allow_list_
|
|||
_verify_contains snip_ipbased_allow_list_and_deny_list_12 "remoteIP"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_clean_up_1
|
||||
snip_clean_up_2
|
||||
|
|
|
@ -73,5 +73,4 @@ _verify_same snip_allow_requests_with_valid_jwt_and_listtyped_claims_10 "$snip_a
|
|||
_verify_same snip_allow_requests_with_valid_jwt_and_listtyped_claims_11 "$snip_allow_requests_with_valid_jwt_and_listtyped_claims_11_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_clean_up_1
|
||||
|
|
|
@ -67,5 +67,4 @@ _verify_same snip_configure_access_control_for_a_tcp_workload_9 "$snip_configure
|
|||
_verify_same snip_configure_access_control_for_a_tcp_workload_10 "$snip_configure_access_control_for_a_tcp_workload_10_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_clean_up_1
|
||||
|
|
|
@ -66,6 +66,4 @@ _verify_same snip_migrate_trust_domain_with_trust_domain_aliases_2 "$snip_migrat
|
|||
_verify_same snip_migrate_trust_domain_with_trust_domain_aliases_3 "$snip_migrate_trust_domain_with_trust_domain_aliases_3_out"
|
||||
|
||||
# @cleanup
|
||||
|
||||
set +e # ignore cleanup errors
|
||||
echo y | snip_clean_up_1
|
||||
|
|
|
@ -43,5 +43,4 @@ snip_regenerating_a_dns_certificate_1
|
|||
_verify_contains regen_dns_certs "$snip_regenerating_a_dns_certificate_3"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -58,6 +58,5 @@ _verify_same snip_verifying_the_certificates_4 "$snip_verifying_the_certificates
|
|||
_verify_same snip_verifying_the_certificates_5 "$snip_verifying_the_certificates_5_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
snip_cleanup_2
|
||||
|
|
|
@ -79,6 +79,5 @@ cluster.outbound|8000||httpbin.default.svc.cluster.local.upstream_rq_pending_tot
|
|||
_verify_like snip_tripping_the_circuit_breaker_5 "$expected"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleaning_up_1
|
||||
snip_cleaning_up_2
|
||||
|
|
|
@ -78,7 +78,6 @@ kubectl exec "$SOURCE_POD" -c sleep -- curl -v http://httpbin.org/headers
|
|||
# TODO This doesn't work, curl returns 502.
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_the_controlled_access_to_external_services_1
|
||||
snip_cleanup_1
|
||||
kubectl delete ns istio-system
|
||||
|
|
|
@ -72,7 +72,6 @@ _verify_contains snip_configure_mutual_tls_origination_for_egress_traffic_using_
|
|||
_verify_contains snip_configure_mutual_tls_origination_for_egress_traffic_using_sds_6 "GET / HTTP/1.1"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_the_mutual_tls_origination_example_1
|
||||
snip_cleanup_the_mutual_tls_origination_example_2
|
||||
snip_cleanup_the_mutual_tls_origination_example_3
|
||||
|
|
|
@ -65,7 +65,6 @@ _verify_contains snip_configure_simple_tls_origination_for_egress_traffic_5 "Wel
|
|||
_verify_contains snip_configure_simple_tls_origination_for_egress_traffic_6 "GET / HTTP/1.1"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_the_tls_origination_example_1
|
||||
snip_cleanup_the_tls_origination_example_2
|
||||
snip_cleanup_the_tls_origination_example_3
|
||||
|
|
|
@ -74,8 +74,7 @@ _verify_contains snip_configure_mutual_tls_origination_for_egress_traffic_4 "Wel
|
|||
_verify_contains snip_configure_mutual_tls_origination_for_egress_traffic_5 "GET / HTTP/1.1"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
kubectl label namespace default istio-injection- || true
|
||||
kubectl label namespace default istio-injection-
|
||||
snip_cleanup_the_mutual_tls_origination_example_1
|
||||
snip_cleanup_the_mutual_tls_origination_example_2
|
||||
snip_cleanup_the_mutual_tls_origination_example_3
|
||||
|
|
|
@ -50,7 +50,6 @@ _verify_elided snip_perform_tls_origination_with_an_egress_gateway_5 "$snip_perf
|
|||
_verify_contains snip_perform_tls_origination_with_an_egress_gateway_6 "GET /politics HTTP/2"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
kubectl label namespace default istio-injection- || true
|
||||
kubectl label namespace default istio-injection-
|
||||
snip_cleanup_the_tls_origination_example_1
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -116,7 +116,6 @@ _verify_contains snip_apply_kubernetes_network_policies_13 "200"
|
|||
_verify_contains snip_apply_kubernetes_network_policies_14 "outbound|443||edition.cnn.com"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_http_gateway_1
|
||||
snip_cleanup_https_gateway_1
|
||||
snip_cleanup_network_policies_1
|
||||
|
|
|
@ -62,7 +62,6 @@ _verify_contains snip_use_a_kubernetes_service_with_endpoints_to_access_an_exter
|
|||
_verify_contains snip_use_a_kubernetes_service_with_endpoints_to_access_an_external_service_7 "Connected to en.wikipedia.org"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_of_kubernetes_externalname_service_1
|
||||
snip_cleanup_of_kubernetes_service_with_endpoints_1
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -45,6 +45,5 @@ _verify_elided snip_curl_origination_http "$snip_curl_origination_http_out"
|
|||
_verify_elided snip_curl_origination_https "$snip_curl_origination_https_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
snip_cleanup_2
|
||||
|
|
|
@ -55,7 +55,6 @@ _verify_contains snip_configure_traffic_to_external_https_proxy_2 "<title>Wikipe
|
|||
_verify_contains snip_configure_traffic_to_external_https_proxy_3 "outbound|3128||my-company-proxy.com"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
snip_cleanup_2
|
||||
snip_cleanup_3
|
||||
|
|
|
@ -97,7 +97,6 @@ _verify_lines snip_configure_traffic_through_egress_gateway_with_sni_proxy_7 "
|
|||
"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_direct_traffic_to_a_wildcard_host_1
|
||||
|
||||
snip_cleanup_wildcard_configuration_for_a_single_hosting_server_1
|
||||
|
|
|
@ -69,7 +69,6 @@ _verify_contains get_bookinfo_productpage_jason "Ratings service is currently un
|
|||
_verify_not_contains get_bookinfo_productpage "Ratings service is currently unavailable"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
cleanup_bookinfo_sample
|
||||
cleanup_sleep_sample
|
||||
|
|
|
@ -73,5 +73,4 @@ curl_httpbin_headers() {
|
|||
_verify_contains curl_httpbin_headers "HTTP/1.1 200 OK"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -56,7 +56,6 @@ _set_ingress_environment_variables
|
|||
_verify_contains snip_configure_an_ingress_gateway_3 "SSL certificate verify ok."
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
snip_cleanup_2
|
||||
snip_cleanup_3
|
||||
|
|
|
@ -49,6 +49,4 @@ curl -s -H "Foo: bar" -HHost:httpbin.example.com "http://$INGRESS_HOST:$INGRESS_
|
|||
_verify_contains get_headers '"Foo": "bar"'
|
||||
|
||||
# @cleanup
|
||||
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -106,7 +106,6 @@ snip_configure_a_mutual_tls_ingress_gateway_4
|
|||
_verify_elided snip_configure_a_mutual_tls_ingress_gateway_5 "$snip_configure_a_mutual_tls_ingress_gateway_5_out"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
snip_cleanup_2
|
||||
snip_cleanup_3
|
||||
|
|
|
@ -68,6 +68,5 @@ _verify_contains snip_mirroring_traffic_to_v2_3 "GET /headers HTTP/1.1"
|
|||
_verify_contains snip_mirroring_traffic_to_v2_4 "GET /headers HTTP/1.1"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleaning_up_1
|
||||
snip_cleaning_up_2
|
||||
|
|
|
@ -74,7 +74,6 @@ _verify_contains get_bookinfo_productpage_jason "glyphicon glyphicon-star"
|
|||
_verify_not_contains get_bookinfo_productpage "glyphicon glyphicon-star"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
cleanup_bookinfo_sample
|
||||
cleanup_sleep_sample
|
||||
|
|
|
@ -62,7 +62,6 @@ _wait_for_istio virtualservice default reviews
|
|||
_verify_contains get_productpage "Sorry, product reviews are currently unavailable for this book."
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
cleanup_bookinfo_sample
|
||||
cleanup_sleep_sample
|
||||
|
|
|
@ -66,5 +66,4 @@ _verify_lines snip_apply_weightbased_tcp_routing_5 "
|
|||
"
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup_1
|
||||
|
|
|
@ -105,7 +105,6 @@ _wait_for_istio virtualservice default reviews
|
|||
_verify_same reviews_v3_traffic_percentage 100
|
||||
|
||||
# @cleanup
|
||||
set +e # ignore cleanup errors
|
||||
snip_cleanup
|
||||
cleanup_bookinfo_sample
|
||||
cleanup_sleep_sample
|
||||
|
|
|
@ -58,6 +58,10 @@ source "tests/util/helpers.sh"
|
|||
### END INJECTED SCRIPT ###
|
||||
`
|
||||
|
||||
// command injected at start of cleanup script
|
||||
cleanupScriptPrefix = `
|
||||
set +e # ignore cleanup errors
|
||||
`
|
||||
snipsFileSuffix = "snips.sh"
|
||||
testFileSuffix = "test.sh"
|
||||
|
||||
|
@ -139,7 +143,7 @@ func checkFile(path string) (*TestCase, error) {
|
|||
// copy the files sourced by test to cleanup
|
||||
re := regexp.MustCompile("(?m)^source \".*\\.sh\"$")
|
||||
sources := re.FindAllString(testScript, -1)
|
||||
cleanupScript = strings.Join(sources, "\n") + cleanupScript
|
||||
cleanupScript = strings.Join(sources, "\n") + cleanupScriptPrefix + cleanupScript
|
||||
|
||||
// find setup configuration
|
||||
re = regexp.MustCompile(fmt.Sprintf("(?m)^%v (.*)$", setupSpec))
|
||||
|
|
|
@ -298,7 +298,7 @@ You can also find this information by running `make doc.test.help`.
|
|||
error as the Istio control plane is being started. Adding a config when creating your `kind` cluster should fix the issue:
|
||||
|
||||
```sh
|
||||
kind create-cluster --name istio-test --config prow/config/trustworthy-jwt.yaml
|
||||
kind create cluster --name istio-test --config prow/config/trustworthy-jwt.yaml
|
||||
```
|
||||
|
||||
1. When using `kind` clusters on a Mac, an extra env var is needed (ADDITIONAL_CONTAINER_OPTIONS="--network host").
|
||||
|
|
Loading…
Reference in New Issue