GeneralPurpose detector doesn't work with banner match

Description

It is not possible to detect a simple "success" banner with the GP detector. The JUnit test for the GP detector uses a \n in the result executed from ExecRunner. It seems there is a different handling adding the the \n in the JUnit test instead of adding the \n in the banner over the WebUI.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Ronny Trommer December 9, 2013 at 5:28 PM

Fixed in master and cherry-picked to origin-1.12

Ronny Trommer December 9, 2013 at 3:28 PM

Cherry-picked to origin-1.12 with commit 84e4fa709c8cad7286f5429a6dbf493414985666

Ronny Trommer December 9, 2013 at 3:19 PM

Fixed in master with commit dd166e9f84bcae15fb6433afc807d718e1f9e86e

Ronny Trommer December 9, 2013 at 3:13 PM
Edited

We found a bug in the validate method in GpResponse.java. The validation returns:

return banner.matches(m_response);

where matches() can contain a regexp. It is not possible to use regexp in this case, cause we validate somthing like "succ.*".matches("success") which will not return true. So the validate method is fixed with

Second the ExecRunner returns a multiline output which has to be treated differently with Java Regexp by adding (?s) in front of you matching string. To match against an

requires the following banner string as detector parameter to match something starting with "succ"

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Affects versions

Priority

PagerDuty

Created December 9, 2013 at 3:06 PM
Updated January 27, 2017 at 4:21 PM
Resolved December 9, 2013 at 5:28 PM