Remove unused integrationtest
[netvirt.git] / README
1 DIRECTORY ORGANIZATION
2 ======================
3
4 - commons
5   +-- parent : Contains Parent pom.xml for all the ovsdb modules.
6
7 - distribution : Builds a working controller distribution based on the controller + ovsdb modules and other
8                  dependant modules such as openflowplugin
9   +-- opendaylight : older, OSGi-based distribution
10   +-- opendaylight-karaf : karaf-based distribution
11
12 - features : This folder contains all the Karaf related files.
13
14 - library : Contains Schema-independent library that is a reference implementation for RFC 7047.
15             This module doesn't depend on any of the Opendaylight components.
16             This library module can also be used independently in a non-OSGi environment.
17
18 - northbound : Provides AD-SAL style Northbound REST APIs.
19                Supports the legacy v2 APIs to provide backward compatibility for Hydrogen Release
20                Also supports the newer v3 APIs to provide schema-independent access to the OVSDB protocol.
21
22 - openstack
23   +-- net-virt : Handles the Openstack Neutron ML2 and Network Service calls and performs all the logic required
24                  for Network Virtualization.
25   +-- net-virt-providers : Mostly contains data-path programming functionality via OpenFlow or potentially
26                            other protocols.
27
28 - ovs-sfc : SFC implementation using the OVSDB project. Currently it is just a shell.
29
30 - plugin : Contains Opendaylight Southbound Plugin APIs and provides a simpler API interface on top of library layer.
31            Ideally, this module should also be schema independent. But due to legacy reasons this layer contains some
32            deprecated functionality that assumes openvswitch schema.
33
34 - plugin-mdsal-adapter : Adds an MD-SAL Adapter for the OVSDB Plugin. The adapter updates the MD-SAL with nodes
35                          as they are added and removed from the inventory. The Yang model provides a reference
36                          between OVSDB nodes and the OpenFlow nodes (bridges) that they manage.
37
38 - plugin-shell : Contains a Karaf shell framework for OVSDB plugin and printCache command-line.
39
40 - resources : Contains some useful resources such as scripts, testing utilities and tools used for deployment
41               or testing the binaries generated from the OVSDB project.
42
43 - schemas :
44   +-- openvswitch : Schema wrapper that represents http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf
45   +-- hardwarevtep: Schema wrapper that represents http://openvswitch.org/docs/vtep.5.pdf
46
47 - utils : MD-SAL OpenFlow and OVSDB common utilities.
48
49 HOW TO BUILD & RUN
50 ==================
51
52 Pre-requisites : JDK 1.7+, Maven 3+
53
54 1. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
55    1. This is a new method for Opendaylight distribution wherein there is no defined editions such
56       as Base, Virtualization or SP editions. The end-customer can choose to deploy the required feature
57       based on his/her deployment needs.
58
59    2. From the root ovsdb/ directory, execute "mvn clean install"
60
61    3. Next unzip the distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step #2 in
62       the directory ovsdb/distribution/opendaylight-karaf/target like so:
63       "unzip distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
64
65    4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
66       is to start the OVSDB plugin framework with the following command in the karaf console:
67       "feature:install odl-ovsdb-openstack odl-ovsdb-northbound" (without quotation marks).
68
69    Sample output from Karaf console :
70
71    opendaylight-user@root>feature:list | grep -i ovsdb
72    odl-ovsdb-all                    | 1.0.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: all
73    odl-ovsdb-library                | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Library
74    odl-ovsdb-schema-openvswitch     | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: Open_vSwitch
75    odl-ovsdb-schema-hardwarevtep    | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: hardware_vtep
76    odl-ovsdb-plugin                 | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Plugin
77    odl-ovsdb-northbound             | 0.6.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Northbound
78    odl-ovsdb-openstack              | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: OpenStack Network Virtual
79    odl-ovsdb-ovssfc                 | 0.0.1-SNAPSHOT      |           | ovsdb-0.0.1-SNAPSHOT                  | OpenDaylight :: OVSDB :: OVS Service Function Chai
80
81
82 2. Building a bundle and deploying it in an Opendaylight Karaf distribution :
83    This method can be used to update and test new code in a bundle. If the bundle of interest is rebuilt as a
84    snapshot with the same version as what it already defined in a feature repo then that new bundle will be used
85    when the feature is loaded in karaf. If karaf is already running with the feature loaded then follow the steps
86    below to load the new bundle:
87
88    1. Find the bundle id of the bundle you are going to rebuild:
89       - bundle:list -s | grep <bundlename>, i.e. bundle:list -s | grep odl-ovsdb-plugin
90
91    2. Instruct karaf to watch the new bundle and reload it if it changes:
92       - bundle:watch <id>
93       - The id is the value returned in 1 above.
94       - You can also watch the bundle URL itself:
95         - bundle:watch mvn:org.opendaylight.ovsdb/plugin/1.0.2-SNAPSHOT
96
97    3. Rebuild bundle.
98       - cd bundle dir, i.e. cd ovsdb/plugin
99       - mvn clean install. This will install the new bundle into the local mvn repo.
100
101    4. karaf will see the changed bundle and reload it.
102
103
104 3. Building an OVSDB based Opendaylight Virtualization edition:
105    1. This is the legacy way to build and distribute Opendaylight archives. This method was
106       followed in Hydrogen. It might still work in Helium but it is best effort for support.
107       The preferred method for Helium and later is to use karaf.
108
109    2. From the root folder(that hosts this README), execute "mvn clean install"
110       That should build a full distribution archive and distribution directory that will contain
111       Opendaylight Controller + OVSDB bundles + Openflow Plugins under
112       distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage
113
114    3. Upon successful completion of a build, the Controller with OVSDB can be executed by :
115       cd distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage/opendaylight/
116       ./run.sh -virt ovsdb
117
118 4. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
119 *** This method is deprecated.
120    1. This is a new method for Opendaylight distribution wherein there is no defined editions such
121       as Base, Virtualization or SP editions. Rather each of the projects will generate features in
122       form of .kar files. The end-customer can choose to deploy the required feature based on his/her
123       deployment needs.
124
125    2. From the features/ directory, execute "mvn clean install"
126       This will generate a kar file such as "features/target/ovsdb-features-1.2.1-SNAPSHOT.kar"
127
128    3. Download (or build from controller project) the Karaf distribution :
129       http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/
130       Sample zip file :
131       http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/1.4.2-SNAPSHOT/distribution.opendaylight-karaf-1.4.2-20140718.075612-407.zip
132
133    4. unzip the downloaded (or built) distribution and copy the ovsdb-features-x.x.x.kar file (from step 2) into
134       the unzipped distribution.opendaylight-karaf-X.X.X/deploy/ directory.
135
136    5. run Karaf from within the distribution.opendaylight-karaf-X.X.X/ directory using "bin/karaf"
137
138    Sample output from Karaf console :
139
140    opendaylight-user@root>kar:list
141    KAR Name
142    -----------------------------
143    ovsdb-features-1.2.1-SNAPSHOT
144
145    opendaylight-user@root>feature:list | grep ovsdb
146    odl-ovsdb-all | 1.2.1-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: all
147    odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Library
148    odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
149    odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
150    odl-ovsdb-plugin | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: Plugin
151
152    opendaylight-user@root>bundle:list | grep OVSDB
153    186 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Library
154    199 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Open_vSwitch Schema
155    200 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB hardware_vtep Schema
156    201 | Active | 80 | 1.0.0.SNAPSHOT | OpenDaylight OVSDB Plugin
157
158 Running The Integration Tests
159 =============================
160
161 To run the integration tests locally the following components are required:
162
163  - Docker
164  - Fig or Docker Compose
165
166 To install docker, follow the installation guide for your platform:
167    http://docs.docker.com/installation/
168
169 To install fig:
170    http://www.fig.sh/install.html
171
172 To install Docker Compose:
173    http://docs.docker.com/compose/install/
174
175 To run the integration tests:
176
177     mvn clean install
178     # The first time you need to set everything up
179     fig up -d
180     # Later runs only need the containers to be started
181     fig start
182     # OSX
183     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=$(boot2docker ip 2>/dev/null) -Dovsdbserver.port=6640
184     # Linux
185     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6640
186     fig stop
187
188 On Linux you'll generally need to run fig as root (sudo fig ...).
189
190 If you're using Docker Compose, replace "fig" above with "docker-compose" and ignore the warnings.
191
192 Skipping unit tests and karaf tests
193 ====================
194
195 mvn clean install -Dmaven.test.skip=true -Dskip.karaf=true