Replace 'Run Keyword Unless'
[integration/test.git] / csit / libraries / Genius.robot
index 713d260472800d41987b913f1fa6fc1a31011d0e..7e499e6c33673a58cce1b948d3b7cb135a219db8 100644 (file)
@@ -230,13 +230,13 @@ Get Tunnel
     ${resp} =    BuiltIn.Run Keyword If    '${config_api_type}' == '${EMPTY}'    RequestsLibrary.Get Request    session    ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/${type}/
     ...    ELSE    RequestsLibrary.Get Request    session    ${CONFIG_API}/itm-state:dpn-teps-state/dpns-teps/${src}/remote-dpns/${dst}/
     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
-    BuiltIn.Log    ${resp.content}
-    ${respjson} =    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
-    ${json} =    Utils.Json Parse From String    ${resp.content}
+    BuiltIn.Log    ${resp.text}
+    ${respjson} =    RequestsLibrary.To Json    ${resp.text}    pretty_print=True
+    ${json} =    Utils.Json Parse From String    ${resp.text}
     BuiltIn.Should Contain    ${resp.text}    ${dst}
     BuiltIn.Run Keyword If    '${config_api_type}' == '${EMPTY}'    BuiltIn.Should Contain    ${resp.text}    ${src}
     ${tunnel_interface_name} =    BuiltIn.Run Keyword If    "tunnel-interface-names" in "${json}"    Genius.Get Tunnel Interface Name    ${json["internal-tunnel"][0]}    tunnel-interface-names
-    ${tunnel_name_output}    ${tunnel_name} =    BuiltIn.Run Keyword Unless    '${config_api_type}' == '${EMPTY}'    BuiltIn.Should Match Regexp    ${resp.text}    "tunnel-name":"(tun[\\w\\d]+)"
+    ${tunnel_name_output}    ${tunnel_name} =    BuiltIn.Run Keyword If    '${config_api_type}' != '${EMPTY}'    BuiltIn.Should Match Regexp    ${resp.text}    "tunnel-name":"(tun[\\w\\d]+)"
     ${tunnel} =    BuiltIn.Set Variable If    '${config_api_type}' == '${EMPTY}'    ${tunnel_interface_name}    ${tunnel_name}
     [Return]    ${tunnel}