Improve Regex in Isolation Library 82/25382/2
authorPhillip Shea <phillip.shea@hp.com>
Mon, 17 Aug 2015 20:52:19 +0000 (13:52 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Mon, 17 Aug 2015 23:09:36 +0000 (23:09 +0000)
IPTables are now checked for the string DROP for
isolated controllers. This is so the isolation
keywords will not erroneously match actions
other than DROP on the same controller pair.

Change-Id: I0a55f994c6d19a6aebd30375396ca840da4da61b
Signed-off-by: Phillip Shea <phillip.shea@hp.com>
test/csit/libraries/ClusterKeywords.robot

index 46c1b979c177e4803a6db448e3e3458ed44adee3..e3846aeaa19563a558844bcc9d957739172317d4 100644 (file)
@@ -304,11 +304,11 @@ Modify IPTables
     ${cmd string}    Set Variable    sudo iptables -L -n
     ${return string}=    Run Command On Remote System    ${isolated controller}    ${cmd string}
     #If inserting rules:
-    Run Keyword If    "${rule type}" == '-I'    Should Match Regexp    ${return string}    [\s\S]*${isolated controller} *${controller}[\s\S]*
-    Run Keyword If    "${rule type}" == '-I'    Should Match Regexp    ${return string}    [\s\S]*${controller} *${isolated controller}[\s\S]*
+    Run Keyword If    "${rule type}" == '-I'    Should Match Regexp    ${return string}    [\s\S]*DROP *all *-- *${isolated controller} *${controller}[\s\S]*
+    Run Keyword If    "${rule type}" == '-I'    Should Match Regexp    ${return string}    [\s\S]*DROP *all *-- *${controller} *${isolated controller}[\s\S]*
     #If deleting rules:
-    Run Keyword If    "${rule type}" == '-D'    Should Match Regexp    ${return string}    (?![\s\S]*${isolated controller} *${controller}[\s\S]*)
-    Run Keyword If    "${rule type}" == '-D'    Should Match Regexp    ${return string}    (?![\s\S]*${controller} *${isolated controller}[\s\S]*)
+    Run Keyword If    "${rule type}" == '-D'    Should Match Regexp    ${return string}    (?![\s\S]*DROP *all *-- *${isolated controller} *${controller}[\s\S]*)
+    Run Keyword If    "${rule type}" == '-D'    Should Match Regexp    ${return string}    (?![\s\S]*DROP *all *-- *${controller} *${isolated controller}[\s\S]*)
 
 Rejoin All Isolated Controllers
     [Arguments]    @{controllers}