Running OpenDaylight ( I’ll refer it as ODL from now on)  integration tests can be frustrating for newcomers as the documentation may be confusing or scattered in different unlinked pages.  So my purpose here is to provide you with short, clear steps to do so yourself on centos or rhel 7.

User configuration

Let’s start by creating regular user for  running the tests:

At this point I’d also recommend to change the user password.

Create public key for the user we have just created:

For mininet to operate properly you should also copy the public key to authorized_keys. If this file doesn’t exists, create it:

Our new user should also have sudo access:

Install Mininet (Optional)

Mininet allows you set up virtual network with switches, hosts and controllers in seconds.

If you already have hosts with preconfigured network environment, you can skip it but some of the tests may rely on it.

I will show you how to install mininet from the project repo, but you should be aware it’s not the only way to it.  You can view all the installation methods here: Install mininet (at the moment there is no rpm for centos/rhel 7)

First, clone the project

Now you need to edit the installation script since it supports fedora and not cenots/rhel

Now start mininet installation

-f to install openflow, -v to install ovs and -n to install mininet dependencies ( gcc, ethtool, pylint, etc)

That’s it. Now verify it’s working propely:

Install and run the OpenDaylight Controller

I won’t go into details on how to install the controller since there several types of distributions and ways to install it.

For the the absolute beginner I would recommend to download pre-built tar/zip from here: ODL Downloads (I’m using Helium)

After downloading the tar/zip file and extracting the content, go into the distribution directory and  run these commands and you are set to go:

Configure Test Environment

First, lets install Robot. This is the framework used to run the tests.

Verify the installation:

Clone the repo which contains the tests:

Run the tests

Congrats! you are here in the final and the exciting step.

All the tests are located in ‘integration/test/csit/suites’ and they are divided by project.

You can run all the tests or you can run spesific project tests.

Lets run basic Restconf tests:

The results should look like this:

Restconf test results

Please note that each project/test might require different variables that you’ll need to provide.

For exmaple for openstack neutron there are tests in ‘integration/test/csit/suites/openstack/neutron’ which require additional parameters such as {OPENSTACK}.

You can include additional variables using -v like that:


Q&A

Q: My tests are failing. why? 🙁

A: Make sure controller is running and the odl-restconf feature is installed

Q: Do I have to use odluser or can I use my own user?

A: You can use any user you want.