Improve Regex in Isolation Library
[integration.git] / 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}