add example robot suite for CSIT tutorial at 2016 ODL Summit 05/46005/7
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 21 Sep 2016 21:10:19 +0000 (14:10 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Thu, 22 Sep 2016 16:17:53 +0000 (16:17 +0000)
some very basic openflow related test cases are written and a few
more stubbed out for students to fill in.

Change-Id: Ibb89023ab8fc2b32bb496254188491a5fe50284f
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
csit/suites/examples/2016_Summit_Tutorial_Example.robot [new file with mode: 0644]
csit/testplans/tutorial-some-unique-string.txt [new file with mode: 0644]

diff --git a/csit/suites/examples/2016_Summit_Tutorial_Example.robot b/csit/suites/examples/2016_Summit_Tutorial_Example.robot
new file mode 100644 (file)
index 0000000..e531ed1
--- /dev/null
@@ -0,0 +1,57 @@
+*** Settings ***
+Documentation     Example Robot suite used for the CSIT tutorial at the 2016 OpenDaylight Summit
+Suite Setup       Local Suite Setup
+Suite Teardown    Local Suite Teardown
+Test Setup        Log Testcase Start To Controller Karaf
+Library           RequestsLibrary
+Variables         ../../variables/Variables.py
+Resource          ../../libraries/KarafKeywords.robot
+Resource          ../../libraries/OVSDB.robot
+
+*** Variables ***
+${switch_name}    odl_summit_switch
+
+*** Test Cases ***
+Verify Ovs Is Discovered In Operational
+    [Documentation]    The test case setup will connect ovs to the controller and the test case itself
+    ...    will verify specific elements are discovered in the operational toplogy.
+    [Setup]    Connect Ovs To Controller
+    Wait Until Keyword Succeeds    5s    1s    Verify Ovs Reports Connected
+    # very basic list of things we expect to find in the output of from operational's topology response
+    @{elements_to_verify}    Create List    openflow:    node-id
+    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${elements_to_verify}
+
+Verify There Is No Topology In Config Store
+    [Documentation]    Only the operational store should have any topology info at this point, as it was
+    ...    populated when the ovs was connected to the openflow southbound.
+    No Content From URI    session    ${CONFIG_TOPO_API}
+
+Add Openflow Rule
+    [Documentation]    TODO
+    [Tags]    exclude
+    Log    This test case is not implemented yet
+
+Delete Openflow Rule
+    [Documentation]    TODO
+    [Tags]    exclude
+    Log    This test case is not implemented yet
+
+*** Keywords ***
+Connect Ovs To Controller
+    [Documentation]    Will set the ovs manager to point at the ODL IP on the openflow port
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${switch_name}
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-br ${switch_name} protocols=OpenFlow13
+    Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    ${switch_name}    tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT}
+
+Local Suite Setup
+    [Documentation]    Make sure the environment is in a clean state.
+    # the variable named "session" has grandfathered it's way in to CSIT such that some keywords expect
+    # it to be the name of the session with which it should make it's rest calls with.    There is no other
+    # good reason than that.
+    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+    Clean OVSDB Test Environment
+
+Local Suite Teardown
+    [Documentation]    Ensure the system is clean and all connections are closed
+    Clean OVSDB Test Environment
+    Close All Connections
diff --git a/csit/testplans/tutorial-some-unique-string.txt b/csit/testplans/tutorial-some-unique-string.txt
new file mode 100644 (file)
index 0000000..c5cbc8c
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/examples/2016_Summit_Tutorial_Example.robot