Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0878821
execute and dump output + first test case
Jun 11, 2015
22d6b68
included tox, pytest frameworks. Classes with logging argparse needs …
Jun 22, 2015
0017229
ovs tests ready with logging and output files
Jun 25, 2015
10cdddd
added tests for rfserver and rfproxy
Jun 25, 2015
4c3a1f0
logging and argparse
anhsirksai Jul 13, 2015
2300c2b
modularising code
anhsirksai Jul 16, 2015
c4aea79
half way through calling the functions
anhsirksai Jul 16, 2015
c89cf41
commiting broken code for the first time, couldnot help myself. Confu…
anhsirksai Jul 17, 2015
2e3d26f
doubts regarding OOP clarified
anhsirksai Jul 17, 2015
509261a
classes for RF Components
anhsirksai Jul 23, 2015
c813e32
modified test_RF
anhsirksai Jul 23, 2015
eb489a4
unwanted rfapps module
anhsirksai Jul 23, 2015
ebb343e
update RFUnitTest class
anhsirksai Jul 23, 2015
07b88b9
corrected syntax errors
anhsirksai Jul 24, 2015
f570734
added verify function. analyze is still pending
anhsirksai Jul 24, 2015
c11d3ab
done with implementation except for one clumsy if condition
anhsirksai Jul 25, 2015
e7b0198
fixed two issues of subprocess handling and dictionary io
Aug 11, 2015
e008ec0
adding debug messgaes and Connectivity cases
anhsirksai Aug 12, 2015
9391b50
Connectivity
anhsirksai Aug 12, 2015
ddfa68b
minor changes
anhsirksai Aug 16, 2015
40b01fb
removed unwanted files
anhsirksai Aug 16, 2015
5ca8863
resolved findtests issues, logger issues identified
anhsirksai Aug 17, 2015
14e64c0
resolved many issues in running
anhsirksai Aug 18, 2015
55541ef
Documentation for running testcases has been added.
anhsirksai Aug 21, 2015
533d321
Update README.md
anhsirksai Aug 21, 2015
397b7f8
Update README.md
anhsirksai Aug 21, 2015
636bd3f
sample log files
anhsirksai Aug 21, 2015
6883faf
Merge branch 'vandervecken' of https://github.com/anhsirksai/RouteFlo…
anhsirksai Aug 21, 2015
93e5ba4
removed unwanted files
anhsirksai Aug 21, 2015
f37a64b
Update README.md
anhsirksai Aug 22, 2015
38c7d41
updates and issues logged
anhsirksai Aug 22, 2015
875cc85
sample log
anhsirksai Aug 22, 2015
611daee
fixed the test required test cases for containers basic tests
anhsirksai Aug 26, 2015
1b04bb8
Minor fixes
anhsirksai Aug 26, 2015
f293e31
fixes in RFApps
anhsirksai Aug 26, 2015
42842ef
fixes
anhsirksai Aug 27, 2015
743533b
all the requirements satisfied
anhsirksai Aug 27, 2015
15fef97
connectivity tests issues
anhsirksai Aug 27, 2015
63c15b2
Update README.md
anhsirksai Aug 27, 2015
818d224
Update README.md
anhsirksai Aug 27, 2015
3d84473
Merge branch 'vandervecken' of https://github.com/anhsirksai/RouteFlo…
anhsirksai Aug 27, 2015
6e5cf8b
Update README.md
anhsirksai Aug 27, 2015
6e371f9
Update README.md
anhsirksai Aug 27, 2015
74b7533
arguments are taken as json file. Connectivity tests issue fixed. cod…
anhsirksai Aug 28, 2015
9c489ad
code cleanup
anhsirksai Aug 28, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ovs_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--log-file=/var/log/openvswitch/ovs-vswitchd.log \
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
-vsyslog:dbg -vfile:dbg --pidfile --detach
sudo ovs-vsctl --no-wait init
sudo ovs-vswitchd --pidfile --detach \
--log-file=/var/log/openvswitch/ovs-vswitchd.log \
-vconsole:err -vsyslog:info -vfile:info
3,114 changes: 3,114 additions & 0 deletions rftest/runtests.py

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions rftest/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from distutils.core import setup, Command
# you can also import from setuptools

class PyTest(Command):
user_options = []
def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
import subprocess
import sys
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)


setup(
#...,
cmdclass = {'test': PyTest},
#...,
)
5 changes: 5 additions & 0 deletions rftest/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.

pytest
5 changes: 5 additions & 0 deletions rftest/tests/Error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2015-08-18 18:24:55,780 root ERROR ERROR lxc-info: 'rfvmA' is not running

2015-08-18 18:24:55,793 root ERROR ERROR
2015-08-18 18:24:55,793 root ERROR ERROR (No info could be read for "-p": geteuid()=1000 but you should be root.)

8 changes: 8 additions & 0 deletions rftest/tests/Output.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2015-08-18 18:24:55,769 root INFO saikrishna
2015-08-18 18:24:55,776 root INFO Test containers class Begin
2015-08-18 18:24:55,780 root ERROR ERROR lxc-info: 'rfvmA' is not running

2015-08-18 18:24:55,780 root INFO Test Mongod class Begin
2015-08-18 18:24:55,793 root ERROR ERROR
2015-08-18 18:24:55,793 root ERROR ERROR (No info could be read for "-p": geteuid()=1000 but you should be root.)

116 changes: 116 additions & 0 deletions rftest/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
rftest/tests
===========

RouteFlow's Unified testing framework supports two functionalities:
* To run the test and get to know the health of routeflow components.
* Extend the testcases with ease to tests the new features.

Dependencies
-----------

* RouteFlow
* ryu-rfproxy
* 3.5 or 3.8 Generic kernal.(For Connectivity and Topology tests to run)

Building
--------

The testing framework requires RouteFlow and rftest to run. The usual way to install RouteFlow and
all of its dependencies is as follows:

* Requirements system Ubuntu 12.04 updated and git installed.
+ ```apt-get update & apt-get upgrade & apt-get install git```

* Clone RouteFlow
+ ```git clone https://github.com/raphaelvrosa/RouteFlow```

* Build all the required components of RouteFlow

+ ``` cd RouteFlow ```
+ ``` git checkout vandervecken ```
+ ``` ./build.sh -c -z -n -i ryu ```

Running
-------

RouteFlow usually supplies a script to run all of the components in the
correct order. If you want to run rftests, start rftest1 or rftest2 first followed by
running test cases. Below are the commands for the same.

* Prior to running the tests, OpenVswitch service should be running. Run the following
script to bring up the service:

+ ``` cd RouteFlow/```
+ ```./ovs-init.sh```

* Run the test, either rftest1 or rftest2:

+ ```cd rftest```
+ ```sudo ./rftest1 -z --ryu```
(or)
+ ```sudo ./rftest2 ```
+ ``` sudo mn --custom topo-4sw-4host.py --topo rftest2 --controller=remote,ip=127.0.0.1,port=6633 --switch=ovsk,protocols=OpenFlow13 --pre ipconf ```

* Now open a new terminal and run the testcases:

+ ```cd RouteFlow/rftest/tests/```
+ ```python test_RF.py```

* This will run all the three type of testcases.
+ Basic tests
+ Connectivity tests
+ Topology tests.

Checking the output of testcases:
--------------------------------

* The output of the testing framework will be updated and saved specific to each run of the command
+ ``` python test_RF.py``` The output is stored to file : ```RouteFlow/rftest/tests/Output.log```

* Logs will persistantly be stored in the file : ```RouteFlow/rftest/tests/RFtest.log```

Extend testcases/Implement New testcases
----------------------------------------

* Create a file with name test_\<xyz\>.py
* Add the <xyz> to CATALOGUE dictionary in test_RF.py.
* To run the new class, add the <\<xyz\>:True> pair to testsToRun dictionary.
* Pass the configuration parameters through testsParams dictionary.
* In Class <xyz>
+ Extend class<xyz> from RFUnitTests class.
+ Add tests to TESTS dictionary. Use addTest() defnition to add tests to TESTS dictionary.
+ Extend the runTests defnition in the new child class <xyz> by calling the evaluate() verify() and analyze() functions to run the testcase.

FAQ
---

Q. When I run "sudo ./rftest1 -z --ryu" followed by "python test_RF.py",
I get messages about lxc-attach faled
```lxc-attach: No such file or directory - failed to open '/proc/19731/ns/pid'
lxc-attach: failed to enter the namespace```

A. lxc-attach requires features that are not present in the native 12.04 kernel (3.5).
You need at least 3.8 which IIRC is available in the backport. The fix is tested on 3.8,
Hence it is suggested you upgrade to 3.8

To fix this issue, I ran the following command to get 3.8:
```sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring```

or you can run the following command to get 3.5
```sudo apt-get install linux-image-generic-lts-quantal linux-headers-generic-lts-quantal```

Issues
------

* Currently Logging server logs only to RFtest.log. Should resolve the issue so that logs will be printed into Debug.log, Output.log and Error.log accordingly.
* While filling the TESTS dictinary in Connectivity class, *kwargs is used to accept the additional parameters. - The implementation needs to be fixed in "addTest" defnition to accepts kwargs.
* This can possibly be a future task. But using argparse to accept huge number of parameters doesnot make sense and make the code clumsy. So I am planning to include a josn file that holds all the comman line parameters and will be used to initialise Tests class. - Still a future task.
* Currently tests_connectivity classes's constructor is not able to take the desired number of arguments. Should fix this issue. -Resolved
* As suggested, a customFind function for ping needs to be implemented and incorporated into findTests() defnition. - Implemented
* findTests() function in test_RF.py should be updated with parameters from configureTests dictionary - Resolved.


License
-------

This project uses the Apache License version 2.0. See LICENSE for more details.
Loading