Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import pytest
  2. import os
  3.  
  4. TEST_CASES = [
  5. ("alertname=SomeAlert", "some-alert-receiver"),
  6.  
  7. ("owner=platform severity=warning", "slack-platform-alerts"),
  8. ("owner=platform severity=critical", "pagerduty-platform-team"),
  9.  
  10. ("severity=info", "slack-monitoring"),
  11. ("severity=warning", "slack-monitoring,pd-platform-warning"),
  12. ("severity=critical", "slack-monitoring,pd-platform-critical"),
  13. ]
  14.  
  15.  
  16. @pytest.mark.parametrize("labels,receivers", TEST_CASES)
  17. def test_routing(labels, receivers):
  18. cmd = f"amtool config routes test --config.file=./am-config.yaml --verify.receivers={receivers} {labels}"
  19. exit_code = os.system(cmd)
  20. assert exit_code == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement