From bbdc2e5dd4c1ca3ff24896374fb82c818b6a5413 Mon Sep 17 00:00:00 2001 From: Rob Skillington Date: Sun, 27 Dec 2020 18:27:03 -0500 Subject: [PATCH] [coordinator] Add Graphite Carbon rewrite cleanup integration test --- .../carbon/expected/dbaz.json | 9 ++++++++ .../carbon/expected/ebaz.json | 9 ++++++++ .../carbon/expected/fbaz.json | 9 ++++++++ .../carbon/expected/gbaz.json | 9 ++++++++ .../carbon/expected/hbarbaz.json | 9 ++++++++ .../carbon/expected/ibarbaz.json | 9 ++++++++ .../carbon/m3coordinator.yml | 2 ++ .../docker-integration-tests/carbon/test.sh | 21 +++++++++++++++++++ 8 files changed, 77 insertions(+) create mode 100644 scripts/docker-integration-tests/carbon/expected/dbaz.json create mode 100644 scripts/docker-integration-tests/carbon/expected/ebaz.json create mode 100644 scripts/docker-integration-tests/carbon/expected/fbaz.json create mode 100644 scripts/docker-integration-tests/carbon/expected/gbaz.json create mode 100644 scripts/docker-integration-tests/carbon/expected/hbarbaz.json create mode 100644 scripts/docker-integration-tests/carbon/expected/ibarbaz.json diff --git a/scripts/docker-integration-tests/carbon/expected/dbaz.json b/scripts/docker-integration-tests/carbon/expected/dbaz.json new file mode 100644 index 0000000000..7b1405f615 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/dbaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "d.bar.baz", + "text": "baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/expected/ebaz.json b/scripts/docker-integration-tests/carbon/expected/ebaz.json new file mode 100644 index 0000000000..2409cc9539 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/ebaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "e.bar.baz", + "text": "baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/expected/fbaz.json b/scripts/docker-integration-tests/carbon/expected/fbaz.json new file mode 100644 index 0000000000..a5ef84b312 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/fbaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "f.bar.baz", + "text": "baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/expected/gbaz.json b/scripts/docker-integration-tests/carbon/expected/gbaz.json new file mode 100644 index 0000000000..6b073b6f80 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/gbaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "g.bar.baz", + "text": "baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/expected/hbarbaz.json b/scripts/docker-integration-tests/carbon/expected/hbarbaz.json new file mode 100644 index 0000000000..dd9c581125 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/hbarbaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "h.bar_baz", + "text": "bar_baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/expected/ibarbaz.json b/scripts/docker-integration-tests/carbon/expected/ibarbaz.json new file mode 100644 index 0000000000..7832da2263 --- /dev/null +++ b/scripts/docker-integration-tests/carbon/expected/ibarbaz.json @@ -0,0 +1,9 @@ +[ + { + "id": "i.bar_baz", + "text": "bar_baz", + "leaf": 1, + "expandable": 0, + "allowChildren": 0 + } +] diff --git a/scripts/docker-integration-tests/carbon/m3coordinator.yml b/scripts/docker-integration-tests/carbon/m3coordinator.yml index dcff5f3a08..f0180b4e7e 100644 --- a/scripts/docker-integration-tests/carbon/m3coordinator.yml +++ b/scripts/docker-integration-tests/carbon/m3coordinator.yml @@ -14,6 +14,8 @@ clusters: carbon: ingester: listenAddress: "0.0.0.0:7204" + rewrite: + cleanup: true rules: - pattern: .*min.aggregate.* aggregation: diff --git a/scripts/docker-integration-tests/carbon/test.sh b/scripts/docker-integration-tests/carbon/test.sh index 3094318a62..34c4be7fba 100755 --- a/scripts/docker-integration-tests/carbon/test.sh +++ b/scripts/docker-integration-tests/carbon/test.sh @@ -85,6 +85,8 @@ echo "quail 42 $t" | nc 0.0.0.0 7204 ATTEMPTS=20 MAX_TIMEOUT=4 TIMEOUT=1 retry_with_backoff read_carbon 'quail' 42 t=$(date +%s) + +# Test basic cases echo "a 0 $t" | nc 0.0.0.0 7204 echo "a.bar 0 $t" | nc 0.0.0.0 7204 echo "a.biz 0 $t" | nc 0.0.0.0 7204 @@ -92,6 +94,19 @@ echo "a.biz.cake 0 $t" | nc 0.0.0.0 7204 echo "a.bar.caw.daz 0 $t" | nc 0.0.0.0 7204 echo "a.bag 0 $t" | nc 0.0.0.0 7204 echo "c:bar.c:baz 0 $t" | nc 0.0.0.0 7204 + +# Test rewrite multiple dots +echo "d..bar.baz 0 $t" | nc 0.0.0.0 7204 +echo "e.bar...baz 0 $t" | nc 0.0.0.0 7204 + +# Test rewrite leading or trailing dots +echo "..f.bar.baz 0 $t" | nc 0.0.0.0 7204 +echo "g.bar.baz.. 0 $t" | nc 0.0.0.0 7204 + +# Test rewrite bad chars +echo "h.bar@@baz 0 $t" | nc 0.0.0.0 7204 +echo "i.bar!!baz 0 $t" | nc 0.0.0.0 7204 + ATTEMPTS=10 TIMEOUT=1 retry_with_backoff find_carbon a* a.json ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.b* a.b.json ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.ba[rg] a.ba.json @@ -102,3 +117,9 @@ ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.d none.json ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon *.*.*.*.* none.json ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon c:* cbar.json ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon c:bar.* cbaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon d.bar.* dbaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon e.bar.* ebaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon f.bar.* fbaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon g.bar.* gbaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon h.bar* hbarbaz.json +ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon i.bar* ibarbaz.json