features/notification_rules.feature in flapjack-0.7.7 vs features/notification_rules.feature in flapjack-0.7.8
- old
+ new
@@ -4,27 +4,50 @@
Background:
Given the following users exist:
| id | first_name | last_name | email | sms | timezone |
| 1 | Malak | Al-Musawi | malak@example.com | +61400000001 | Asia/Baghdad |
| 2 | Imani | Farooq | imani@example.com | +61400000002 | Europe/Moscow |
+ | 3 | Vera | Дурейко | vera@example.com | +61400000003 | Europe/Paris |
And the following entities exist:
| id | name | contacts |
| 1 | foo | 1 |
- | 2 | bar | 1,2 |
- | 3 | baz | 1 |
+ | 2 | bar | 1,2,3 |
+ | 3 | baz | 1,3 |
+ | 4 | buf | 1,2,3 |
And user 1 has the following notification intervals:
| email | sms |
| 15 | 60 |
+ And user 2 has the following notification intervals:
+ | email | sms |
+ | 15 | 60 |
+
+ And user 3 has the following notification intervals:
+ | email | sms |
+ | 15 | 60 |
+
And user 1 has the following notification rules:
- | id | entities | entity_tags | warning_media | critical_media | warning_blackhole | critical_blackhole | time_restrictions |
- | 1 | foo | | email | sms,email | | | 8-18 weekdays |
- | 2 | bar | | | sms,email | true | | |
- | 3 | baz | | email | sms,email | | | |
+ | entities | entity_tags | warning_media | critical_media | warning_blackhole | critical_blackhole | time_restrictions |
+ | foo | | email | sms,email | | | 8-18 weekdays |
+ | bar | | | sms,email | true | | |
+ | baz | | email | sms,email | | | |
+ And user 2 has the following notification rules:
+ | entities | entity_tags | warning_media | critical_media | warning_blackhole | critical_blackhole | time_restrictions |
+ | | | email | email | | | |
+ | | | sms | sms | | | |
+ | bar | | email | email,sms | | | |
+
+ And user 3 has the following notification rules:
+ | entities | entity_tags | warning_media | critical_media | warning_blackhole | critical_blackhole | time_restrictions |
+ | buf | | email | email | | | |
+ | buf | | sms | sms | | | |
+ | | | email | email | | | |
+ | baz | | sms | sms | | | |
+
@time_restrictions @time
Scenario: Alerts only during specified time restrictions
Given the timezone is Asia/Baghdad
And the time is February 1 2013 6:59
And the check is check 'ping' on entity 'foo'
@@ -150,5 +173,60 @@
And a critical event is received
And 1 minute passes
And a critical event is received
Then 3 email alerts should be queued for malak@example.com
And 3 sms alerts should be queued for +61400000001
+
+ @time
+ Scenario: Contact with only entity specific rules should not be notified for other entities they are a contact for
+ Given the check is check 'ping' on entity 'buf'
+ And the check is in an ok state
+ When a critical event is received
+ And 1 minute passes
+ And a critical event is received
+ Then no email alerts should be queued for malak@example.com
+
+ @time
+ Scenario: Contact with entity specific rules and general rules should be notified for other entities they are a contact for
+ Given the check is check 'ping' on entity 'buf'
+ And the check is in an ok state
+ When a critical event is received
+ And 1 minute passes
+ And a critical event is received
+ Then 1 email alert should be queued for imani@example.com
+
+ @time
+ Scenario: Mutiple rules for an entity should be additive
+ Given the check is check 'ping' on entity 'buf'
+ And the check is in an ok state
+ When a critical event is received
+ And 1 minute passes
+ And a critical event is received
+ Then 1 email alert should be queued for vera@example.com
+ Then 1 sms alert should be queued for +61400000003
+
+ @time
+ Scenario: Multiple general rules should be additive
+ Given the check is check 'ping' on entity 'buf'
+ And the check is in an ok state
+ When a critical event is received
+ And 1 minute passes
+ And a critical event is received
+ Then 1 email alert should be queued for imani@example.com
+ Then 1 sms alert should be queued for +61400000002
+
+ @time
+ Scenario: An entity specific rule should override general rules
+ Given the check is check 'ping' on entity 'baz'
+ And the check is in an ok state
+ When a critical event is received
+ And 1 minute passes
+ And a critical event is received
+ Then 0 email alerts should be queued for vera@example.com
+ Then 1 sms alert should be queued for +61400000003
+
+ @time
+ Scenario: A blackhole rule on an entity should override another matching entity specific rule
+
+ @time
+ Scenario: A blackhole rule on an entity should override another matching general rule
+