diff options
| author | Steve Kemp <steve@steve.org.uk> | 2015-02-17 20:52:41 +0000 | 
|---|---|---|
| committer | Steve Kemp <steve@steve.org.uk> | 2015-02-17 20:52:41 +0000 | 
| commit | ad277813840592e0aed349364403f59d6f6ce7d1 (patch) | |
| tree | 5727becd5f0aff14aa2e65760aa57d1dee7243ba /lib | |
| parent | c8c062ff91a5ab89395b32138ab78dd31d137eb6 (diff) | |
Deal with multiple test-implementations.
As soon as we allow multiple test-implementations we get
into a mess, as Mauve regards an ID as unique and that is
based upon the test-definition not the implementing method
We want to allow:
* HTTPS test to succeed.
* SSL-check to fail.
Which means multiple tests of type "https" will have different
IDs.  Force this by adding on the class of the implementation.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/custodian/alerts/mauve.rb | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb index 66379a5..9a5d9ed 100644 --- a/lib/custodian/alerts/mauve.rb +++ b/lib/custodian/alerts/mauve.rb @@ -213,14 +213,20 @@ module Custodian          test_host = test.target          test_type = test.get_type -          alert         = Mauve::Proto::Alert.new          #          # Mauve only lets us use IDs which are <= 255 characters in length          # hash the line from the parser to ensure it is short enough.          # (IDs must be unique, per-source) -        alert.id      = Digest::SHA1.hexdigest(test.to_s) +        # +        # Because there might be N-classes which implemented the test +        # we need to make sure these are distinct too. +        # +        id_key  = test.to_s +        id_key += test.class + +        alert.id = Digest::SHA1.hexdigest(id_key)          alert.subject = subject          alert.summary = "The #{test_type} test failed against #{test_host}" | 
