Running Genius CSIT in a dev environment
[genius.git] / docs / genius-csit-howto.rst
1
2 .. contents:: Table of Contents
3       :depth: 3
4
5 ======================================
6 Running Genius CSIT in Dev Environment
7 ======================================
8 Genius CSIT requires very minimal testbed topology, and it is very easy to run the same
9 on your laptop, with the below steps. This will help you run tests yourself on the code changes
10 you are making in genius locally, without the need for waiting in jenkins job queue for long.
11
12 Test Setup
13 ==========
14 Test setup consists of ODL with `odl-genius-rest` feature installed and two switches (DPNs) connected
15 to ODL over OVSDB and OpenflowPlugin channels.
16
17 Testbed Topologies
18 ------------------
19 This setup uses the default Genius test topology.
20
21 Default Topology
22 ^^^^^^^^^^^^^^^^
23
24 .. literalinclude:: testplans/topologies/default-topology.txt
25
26 Software Requirements
27 ---------------------
28
29 * ODL running on a VM or laptop[usual specifications for running ODL, min 2CPU+4GB RAM]
30 * Two VMs with OVS [2.4 or higher] installed. [1CPU+1GB RAM]
31 * Robotframework which can co-exist with any of the above VMs(provided it has connectivity to all the above entities).
32
33 Steps To Bring Up the CSIT Environment
34 --------------------------------------
35
36 We can run ODL on laptop, and OVS on two VMs. RobotFramework can be installed on of the two OVS VMs.
37 The documentation is based on ubuntu Desktop VMs, which were started using virtual box.
38
39 ODL Installation
40 ----------------
41
42 * Pick up any ODL stable distribution or build it yourself
43 * cd genius/karaf/target/assembly/bin
44 * ./karaf
45 * In the karaf prompt, install the genius feature
46   feature:install odl-genius-rest
47
48 OVS Installation
49 ----------------
50 Most of the genius developers already know this.
51 Just for completion sake, on both the VMs, OVS has to be installed.
52
53 * sudo apt-get install openvswitch-switch
54 * service openvswitch-switch start
55 * You can type "ovs-vsctl show" command to check if ovs is running as expected.
56 * Make sure that the output of the above command should show different unique node UUIDs for OVS. If not, genius CSIT
57   will have trouble creating ITM tunnels.[This is likely to happen, if you clone the first VM to run the second OVS]
58
59 RobotFrameowork Installation
60 ----------------------------
61
62 Please refer to the script below for the latest uptodate requirement versions supported, the script also has more
63 information on how to setup the robot environment.
64
65 https://github.com/opendaylight/releng-builder/blob/master/jjb/integration/integration-install-robotframework.sh
66
67 Below are the requirements for running genius CSIT.
68
69 * Install Python 2.7
70 * Install pip
71 * Install ride tool and required libraries:
72   sudo pip install robotframework-ride
73   sudo pip install robotframework-requests
74   sudo pip install robotframework-sshlibrary
75   sudo pip install --upgrade robotframework-httplibrary
76   sudo pip install jmespath
77 * To start ride : ride.py <test suite name>
78   To open genius test suite, opendaylight integration/test repo needs to be cloned.
79   git clone https://<your_username>@git.opendaylight.org/gerrit/p/integration/test.git
80   ride.py test/csit/suites/genius
81   [Same can be imported after RIDE opens up, if you don't want to specify the path in the prompt]
82 * In the RIDE window that opens up, Genius test suite will be imported now
83 * Click on the Run panel, and Click Start, by passing below arguments
84   -v ODL_SYSTEM_IP:<ODL_IP>  -v TOOLS_SYSTEM_IP:<OVS1_IP>  -v TOOLS_SYSTEM_2_IP:<OVS2_IP> -v USER_HOME:<home-folder> -v TOOLS_SYSTEM_USER:<user-name>
85   Any arguments defined in Variables.py can be overriden, by passing the argument value like above.
86   For eg:, there was a recent change in karaf prompt, in that case we could run genius csit by passing argument "-v KARAF_PROMPT:karaf@root"
87
88 References
89 ==========
90
91 [1] `OpenDaylight Genius usrr Guide <http://docs.opendaylight.org/en/latest/user-guide/genius-user-guide.html#interface-manager-operations>`__
92
93 [2] https://simplyexplainedblog.wordpress.com/2017/04/11/running-odl-csit-locally/