diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-11-03 16:44:01 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-11-03 16:44:01 +0000 |
commit | 4edc5d3018380438351cb6b4058215ebe4d8e5b3 (patch) | |
tree | d1626c4cce9ec0dcdfc478c7482a0cc0718cbc91 /test/tc_mauve_alert.rb | |
parent | f334946b918ffc368da55a04308e919fb1728061 (diff) |
Added test to see us through a clock change.
Diffstat (limited to 'test/tc_mauve_alert.rb')
-rw-r--r-- | test/tc_mauve_alert.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/tc_mauve_alert.rb b/test/tc_mauve_alert.rb index a9aef5f..2b8af6f 100644 --- a/test/tc_mauve_alert.rb +++ b/test/tc_mauve_alert.rb @@ -272,4 +272,25 @@ EOF # end + def test_heartbeats_during_clock_change + + updates = YAML.load_file(File.join(File.dirname(__FILE__),"bst_to_gmt.yaml")) + + Timecop.freeze(updates.first[1]-20.minutes) + Configuration.current = ConfigurationBuilder.parse(@test_config) + Server.instance.setup + assert_equal(Time.now, Server.instance.started_at) + + updates.each do |update, received_at, source_ip| + Timecop.freeze(received_at) + Alert.receive_update(update, received_at, source_ip) + alert = Alert.first + assert(alert.cleared?) + alert.poll + assert(alert.cleared?) + assert(0, Server.instance.notification_buffer.length) + end + + end + end |