diff --git a/cmd/karma/tests/testscript/031_check-config.txt b/cmd/karma/tests/testscript/031_check-config.txt index c97caac43..48b1aafc0 100644 --- a/cmd/karma/tests/testscript/031_check-config.txt +++ b/cmd/karma/tests/testscript/031_check-config.txt @@ -1,5 +1,5 @@ # Validates config when --check-config is passed -karma.bin-should-work --check-config --alertmanager.uri=http://127.0.0.1 +karma.bin-should-work --check-config --alertmanager.uri=http://127.0.0.1:7031 ! stdout . stderr 'msg="Configuration is valid"' ! stderr 'level=error' diff --git a/cmd/karma/tests/testscript/035_log_requests.txt b/cmd/karma/tests/testscript/035_log_requests.txt index acab6261d..b4e6efd0e 100644 --- a/cmd/karma/tests/testscript/035_log_requests.txt +++ b/cmd/karma/tests/testscript/035_log_requests.txt @@ -1,7 +1,7 @@ # Works in simple mode when single --alertmanager.uri flag is passed exec bash -x ./test.sh & -karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8035 --log.requests +karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7035 --listen.address=127.0.0.1 --listen.port=8035 --log.requests ! stdout . stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=.+ method=POST path=/alerts.json' stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=.+ method=POST path=/alerts.json' diff --git a/cmd/karma/tests/testscript/044_invalid_flag_alertmanager_timeout.txt b/cmd/karma/tests/testscript/044_invalid_flag_alertmanager_timeout.txt index 9600e4deb..e9c083a43 100644 --- a/cmd/karma/tests/testscript/044_invalid_flag_alertmanager_timeout.txt +++ b/cmd/karma/tests/testscript/044_invalid_flag_alertmanager_timeout.txt @@ -1,5 +1,5 @@ # Raises an error if we pass alertmanager.timeout value that doesn't parse -karma.bin-should-fail --alertmanager.timeout=abc123 --alertmanager.uri=http://127.0.0.1 +karma.bin-should-fail --alertmanager.timeout=abc123 --alertmanager.uri=http://127.0.0.1:7044 ! stdout . cmp stderr stderr.txt diff --git a/cmd/karma/tests/testscript/069_simple_config.txt b/cmd/karma/tests/testscript/069_simple_config.txt index 86a0cd925..3bd0de01e 100644 --- a/cmd/karma/tests/testscript/069_simple_config.txt +++ b/cmd/karma/tests/testscript/069_simple_config.txt @@ -1,23 +1,23 @@ # Works in simple mode when single --alertmanager.uri flag is passed exec bash -x ./test.sh & -karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8069 +karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7069 --listen.address=127.0.0.1 --listen.port=8069 ! stdout . cmp stderr stderr.txt -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7069 level=info msg="Writing PID file" path=karma.pid level=info msg="Initial Alertmanager collection" level=info msg="Pulling latest alerts and silences from Alertmanager" level=info msg="Collecting alerts and silences" alertmanager=default -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2 -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7069/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7069/metrics\": dial tcp 127.0.0.1:7069: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7069 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7069/api/v2/status\": dial tcp 127.0.0.1:7069: connect: connection refused" alertmanager=default try=1/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7069/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7069/metrics\": dial tcp 127.0.0.1:7069: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7069 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7069/api/v2/status\": dial tcp 127.0.0.1:7069: connect: connection refused" alertmanager=default try=2/2 level=info msg="Collection completed" level=info msg="Done, starting HTTP server" level=info msg="Starting HTTP server" address=127.0.0.1:8069 diff --git a/cmd/karma/tests/testscript/072_pid_file_write_error.txt b/cmd/karma/tests/testscript/072_pid_file_write_error.txt index 1a58d48b1..2363af5ae 100644 --- a/cmd/karma/tests/testscript/072_pid_file_write_error.txt +++ b/cmd/karma/tests/testscript/072_pid_file_write_error.txt @@ -1,11 +1,11 @@ # Fails is we cannot write a PID file -karma.bin-should-fail --pid-file=/foo/bar/karma.pid --alertmanager.uri=http://127.0.0.1 +karma.bin-should-fail --pid-file=/foo/bar/karma.pid --alertmanager.uri=http://127.0.0.1:7072 ! stdout . cmp stderr stderr.txt -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7072 level=info msg="Writing PID file" path=/foo/bar/karma.pid level=error msg="Execution failed" error="failed to write a PID file: open /foo/bar/karma.pid: no such file or directory" diff --git a/cmd/karma/tests/testscript/073_pid_file_remove_error.txt b/cmd/karma/tests/testscript/073_pid_file_remove_error.txt index 6d525664e..a34dd79c6 100644 --- a/cmd/karma/tests/testscript/073_pid_file_remove_error.txt +++ b/cmd/karma/tests/testscript/073_pid_file_remove_error.txt @@ -1,23 +1,23 @@ # Fails is we cannot remove a PID file exec bash -x ./test.sh & -karma.bin-should-fail --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8073 +karma.bin-should-fail --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7073 --listen.address=127.0.0.1 --listen.port=8073 ! stdout . cmp stderr stderr.txt -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7073 level=info msg="Writing PID file" path=karma.pid level=info msg="Initial Alertmanager collection" level=info msg="Pulling latest alerts and silences from Alertmanager" level=info msg="Collecting alerts and silences" alertmanager=default -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2 -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7073/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7073/metrics\": dial tcp 127.0.0.1:7073: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7073 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7073/api/v2/status\": dial tcp 127.0.0.1:7073: connect: connection refused" alertmanager=default try=1/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7073/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7073/metrics\": dial tcp 127.0.0.1:7073: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7073 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7073/api/v2/status\": dial tcp 127.0.0.1:7073: connect: connection refused" alertmanager=default try=2/2 level=info msg="Collection completed" level=info msg="Done, starting HTTP server" level=info msg="Starting HTTP server" address=127.0.0.1:8073 diff --git a/cmd/karma/tests/testscript/083_metrics.txt b/cmd/karma/tests/testscript/083_metrics.txt index 62d902c38..2ab680819 100644 --- a/cmd/karma/tests/testscript/083_metrics.txt +++ b/cmd/karma/tests/testscript/083_metrics.txt @@ -1,7 +1,7 @@ # GET /metrics returns same list of metrics exec bash -x ./test.sh & -karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8083 +karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7083 --listen.address=127.0.0.1 --listen.port=8083 ! stdout . cmp stderr stderr.txt cmp curl.txt metrics.txt @@ -117,17 +117,17 @@ promhttp_metric_handler_requests_total{code="500"} promhttp_metric_handler_requests_total{code="503"} -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7083 level=info msg="Writing PID file" path=karma.pid level=info msg="Initial Alertmanager collection" level=info msg="Pulling latest alerts and silences from Alertmanager" level=info msg="Collecting alerts and silences" alertmanager=default -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2 -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7083/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7083/metrics\": dial tcp 127.0.0.1:7083: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7083 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7083/api/v2/status\": dial tcp 127.0.0.1:7083: connect: connection refused" alertmanager=default try=1/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7083/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7083/metrics\": dial tcp 127.0.0.1:7083: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7083 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7083/api/v2/status\": dial tcp 127.0.0.1:7083: connect: connection refused" alertmanager=default try=2/2 level=info msg="Collection completed" level=info msg="Done, starting HTTP server" level=info msg="Starting HTTP server" address=127.0.0.1:8083 diff --git a/cmd/karma/tests/testscript/085_debug.txt b/cmd/karma/tests/testscript/085_debug.txt index 6c93ef67c..da6378b8d 100644 --- a/cmd/karma/tests/testscript/085_debug.txt +++ b/cmd/karma/tests/testscript/085_debug.txt @@ -1,23 +1,23 @@ # Enables pprof endpoints when debug is enabled exec bash -x ./test.sh & -karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8085 --debug +karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7085 --listen.address=127.0.0.1 --listen.port=8085 --debug ! stdout . cmp stderr stderr.txt -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7085 level=info msg="Writing PID file" path=karma.pid level=info msg="Initial Alertmanager collection" level=info msg="Pulling latest alerts and silences from Alertmanager" level=info msg="Collecting alerts and silences" alertmanager=default -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2 -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7085/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7085/metrics\": dial tcp 127.0.0.1:7085: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7085 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7085/api/v2/status\": dial tcp 127.0.0.1:7085: connect: connection refused" alertmanager=default try=1/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7085/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7085/metrics\": dial tcp 127.0.0.1:7085: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7085 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7085/api/v2/status\": dial tcp 127.0.0.1:7085: connect: connection refused" alertmanager=default try=2/2 level=info msg="Collection completed" level=info msg="Done, starting HTTP server" level=info msg="Starting HTTP server" address=127.0.0.1:8085 diff --git a/cmd/karma/tests/testscript/110_alert_history.txt b/cmd/karma/tests/testscript/110_alert_history.txt index c7098eb7d..ed321cf20 100644 --- a/cmd/karma/tests/testscript/110_alert_history.txt +++ b/cmd/karma/tests/testscript/110_alert_history.txt @@ -3,23 +3,23 @@ http response prometheus /api/v1/query_range 200 {"status":"success","data":{"re http start prometheus 127.0.0.1:9110 exec bash -x ./test.sh & -karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8110 --history.enabled=true --history.timeout=10s +karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7110 --listen.address=127.0.0.1 --listen.port=8110 --history.enabled=true --history.timeout=10s ! stdout . cmp stderr stderr.txt -- stderr.txt -- level=info msg="Version: dev" -level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1 +level=info msg="Configured Alertmanager source" name=default proxy=false readonly=false uri=http://127.0.0.1:7110 level=info msg="Writing PID file" path=karma.pid level=info msg="Initial Alertmanager collection" level=info msg="Pulling latest alerts and silences from Alertmanager" level=info msg="Collecting alerts and silences" alertmanager=default -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2 -level=info msg="GET request" timeout=40 uri=http://127.0.0.1/metrics -level=error msg="Request failed" error="Get \"http://127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://127.0.0.1 -level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/status\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7110/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7110/metrics\": dial tcp 127.0.0.1:7110: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7110 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7110/api/v2/status\": dial tcp 127.0.0.1:7110: connect: connection refused" alertmanager=default try=1/2 +level=info msg="GET request" timeout=40 uri=http://127.0.0.1:7110/metrics +level=error msg="Request failed" error="Get \"http://127.0.0.1:7110/metrics\": dial tcp 127.0.0.1:7110: connect: connection refused" alertmanager=default uri=http://127.0.0.1:7110 +level=error msg="Collection failed" error="Get \"http://127.0.0.1:7110/api/v2/status\": dial tcp 127.0.0.1:7110: connect: connection refused" alertmanager=default try=2/2 level=info msg="Collection completed" level=info msg="Done, starting HTTP server" level=info msg="Starting HTTP server" address=127.0.0.1:8110