forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_envoy_test.sh
executable file
·45 lines (33 loc) · 1.73 KB
/
run_envoy_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
source "$TEST_RUNDIR/test/integration/test_utility.sh"
function expect_fail_with_error() {
log="${TEST_TMPDIR}/envoy.log"
rm -f "$log"
expected_error="$1"
shift
echo ${ENVOY_BIN} "$@" ">&" "$log"
${ENVOY_BIN} "$@" >& "$log"
EXIT_CODE=$?
cat "$log"
check [ $EXIT_CODE -eq 1 ]
check grep "$expected_error" "$log"
}
start_test Launching envoy with a bogus command line flag.
expect_fail_with_error "PARSE ERROR: Argument: --bogus-flag" --bogus-flag
start_test Launching envoy without --config-path or --config-yaml fails.
expect_fail_with_error \
"At least one of --config-path and --config-yaml should be non-empty"
start_test Launching envoy with unknown IP address.
expect_fail_with_error "error: unknown IP address version" --local-address-ip-version foo
start_test Launching envoy with unknown mode.
expect_fail_with_error "error: unknown mode" --mode foo
start_test Launching envoy with bogus component log level.
expect_fail_with_error "error: component log level not correctly specified" --component-log-level upstream:foo:bar
start_test Launching envoy with invalid log level.
expect_fail_with_error "error: invalid log level specified" --component-log-level upstream:foo
start_test Launching envoy with invalid component.
expect_fail_with_error "error: invalid component specified" --component-log-level foo:debug
start_test Launching envoy with max-obj-name-len value less than minimum value of 60.
expect_fail_with_error "error: the 'max-obj-name-len' value specified .* is less than the minimum" --max-obj-name-len 1
start_test Launching envoy with max-stats value more than maximum value of 100M.
expect_fail_with_error "error: the 'max-stats' value specified .* is more than the maximum value" --max-stats 1000000000