Delete data folder
[integration/test.git] / csit / libraries / OVSDB.robot
index ed520988d92c353d90704cf72e93ab41396c7d92..e09f1e2e54779dbfbe9008ea357e1796628cb125 100644 (file)
@@ -139,8 +139,9 @@ Restart OVSDB
     Log    ${output}
 
 Set Controller In OVS Bridge
-    [Arguments]    ${tools_system}    ${bridge}    ${controller_opt}
-    [Documentation]    Sets controller for a given OVS ${bridge} using controller options in ${controller_opt}
+    [Arguments]    ${tools_system}    ${bridge}    ${controller_opt}    ${ofversion}=13
+    [Documentation]    Sets controller for the OVS bridge ${bridge} using ${controller_opt} and OF version ${ofversion}.
+    Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl set bridge ${bridge} protocols=OpenFlow${ofversion}
     Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl set-controller ${bridge} ${controller_opt}
 
 Check OVS OpenFlow Connections
@@ -199,3 +200,19 @@ Get Default Gateway
     ${gateway} =    Run Command On Remote System    ${ip}    /usr/sbin/route -n | grep '^0.0.0.0' | cut -d " " -f 10
     Log    ${gateway}
     [Return]    ${gateway}
+
+Add OVS Logging
+    [Arguments]    ${conn_id}
+    [Documentation]    Add higher levels of OVS logging
+    SSHLibrary.Switch Connection    ${conn_id}
+    @{modules} =    BuiltIn.Create List    bridge:file:dbg    connmgr:file:dbg    inband:file:dbg    ofp_actions:file:dbg    ofp_errors:file:dbg
+    ...    ofp_msgs:file:dbg    ovsdb_error:file:dbg    rconn:file:dbg    tunnel:file:dbg    vconn:file:dbg
+    : FOR    ${module}    IN    @{modules}
+    \    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set ${module}    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/list    ${DEFAULT_LINUX_PROMPT_STRICT}
+
+Reset OVS Logging
+    [Arguments]    ${conn_id}
+    [Documentation]    Reset the OVS logging
+    SSHLibrary.Switch Connection    ${conn_id}
+    ${output} =    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set :file:info    ${DEFAULT_LINUX_PROMPT_STRICT}