R.B. Boyer ed294fc49c
test: fix envoy integration tests to explicitly create config entries (#15269)
This is instead of the current behavior where we feed the config entries in using the config_entries.bootstrap configuration which oddly races against other setup code in some circumstances.

I converted ALL tests to explicitly create config entries.
2022-11-07 10:02:04 -06:00

97 lines
1.6 KiB
Bash

#!/bin/bash
set -euo pipefail
upsert_config_entry primary '
kind = "service-defaults"
name = "s2"
protocol = "http"
'
upsert_config_entry primary '
kind = "service-intentions"
name = "s2"
sources {
name = "s1"
permissions = [
// paths
{
action = "allow"
http { path_exact = "/exact" }
},
{
action = "allow"
http { path_prefix = "/prefix" }
},
{
action = "allow"
http { path_regex = "/reg[ex]{2}" }
},
// headers
{
action = "allow"
http {
path_exact = "/hdr-present"
header = [{
name = "x-test-debug"
present = true
}]
}
},
{
action = "allow"
http {
path_exact = "/hdr-exact"
header = [{
name = "x-test-debug"
exact = "exact"
}]
}
},
{
action = "allow"
http {
path_exact = "/hdr-prefix"
header = [{
name = "x-test-debug"
prefix = "prefi"
}]
}
},
{
action = "allow"
http {
path_exact = "/hdr-suffix"
header = [{
name = "x-test-debug"
suffix = "uffix"
}]
}
},
{
action = "allow"
http {
path_exact = "/hdr-regex"
header = [{
name = "x-test-debug"
regex = "reg[ex]{2}"
}]
}
},
// methods
{
action = "allow"
http {
path_exact = "/method-match"
methods = ["GET", "PUT"]
}
}
]
}
'
register_services primary
gen_envoy_bootstrap s1 19000
gen_envoy_bootstrap s2 19001