github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/tests/suites/firewall/bundle_with_exposed_endpoints.sh (about)

     1  run_bundle_with_exposed_endpoints() {
     2  	echo
     3  
     4  	file="${TEST_DIR}/test-bundle-with-exposed-endpoints.log"
     5  
     6  	ensure "bundle-with-exposed-endpoints" "${file}"
     7  
     8  	assert_deploy_bundle_with_expose_flag_and_exposed_endpoints_fails
     9  
    10  	destroy_model "bundle-with-exposed-endpoints"
    11  }
    12  
    13  assert_deploy_bundle_with_expose_flag_and_exposed_endpoints_fails() {
    14  	echo "==> Checking that deploying a bundle with both the expose flag and exposed endpoint sections is not allowed"
    15  
    16  	bundle=./tests/suites/firewall/bundles/invalid.yaml
    17  	got=$(juju deploy ${bundle} 2>&1 || true)
    18  	check_contains "${got}" 'exposed-endpoints cannot be specified together with "exposed:true" in application "ubuntu-lite" as this poses a security risk when deploying bundles to older controllers'
    19  }
    20  
    21  test_bundle_with_exposed_endpoints() {
    22  	if [ "$(skip 'test_bundle_with_exposed_endpoints')" ]; then
    23  		echo "==> TEST SKIPPED: juju bundle_with_exposed_endpoints"
    24  		return
    25  	fi
    26  
    27  	(
    28  		set_verbosity
    29  
    30  		cd .. || exit
    31  
    32  		run "run_bundle_with_exposed_endpoints" "$@"
    33  	)
    34  }