diff options
author | Peter Bandzi <pbandzi@cisco.com> | 2015-04-23 17:17:43 +0200 |
---|---|---|
committer | Peter Bandzi <pbandzi@cisco.com> | 2015-04-23 17:33:33 +0200 |
commit | 019227b6f4fdbbc93e14c7231a1e30c4523479ce (patch) | |
tree | d02aa9907243f8e91c5b055353bdb36fe0934e3d /testcases/Controllers/ODL/CI/libraries/Common.py | |
parent | 9dd9fbf85ee34e0872fb8c846bec1120f5b15eb6 (diff) |
Script for starting Robotframework ODL suites.
Script do clone integration test from git
activate python venv and start test suites with specified parameters
test suites are specified in test_list.txt
JIRA: FUNCTEST-5
Change-Id: Ic80b2e5760fd09a235bf946d0172e426d121a157
Signed-off-by: Peter Bandzi <pbandzi@cisco.com>
Diffstat (limited to 'testcases/Controllers/ODL/CI/libraries/Common.py')
-rw-r--r-- | testcases/Controllers/ODL/CI/libraries/Common.py | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/testcases/Controllers/ODL/CI/libraries/Common.py b/testcases/Controllers/ODL/CI/libraries/Common.py deleted file mode 100644 index e748caad8..000000000 --- a/testcases/Controllers/ODL/CI/libraries/Common.py +++ /dev/null @@ -1,81 +0,0 @@ -""" -Library for the robot based system test tool of the OpenDaylight project. -Authors: Baohua Yang@IBM, Denghui Huang@IBM -Updated: 2013-11-14 -""" -import collections -import xml.etree.ElementTree as ET - -''' -Common constants and functions for the robot framework. -''' - -def collection_should_contain(collection, *members): - """ - Fail if not every members is in the collection. - """ - if not isinstance(collection, collections.Iterable): - return False - for m in members: - if m not in collection: - return False - else: - return True - -def combine_strings(*strings): - """ - Combines the given `strings` together and returns the result. - The given strings are not altered by this keyword. - """ - result = '' - for s in strings: - if isinstance(s,str) or isinstance(s,unicode): - result += s - if result == '': - return None - else: - return result - - -def compare_xml(xml1, xml2): - """ - compare the two XML files to see if they contain the same data - but could be if different order. - It just split the xml in to lines and just check the line is in - the other file - """ - for line in xml1.rstrip().split('\n'): - if line not in xml2.rstrip().split('\n'): - return False - - for line in xml2.rstrip().split('\n'): - if line not in xml1.rstrip().split('\n'): - return False - - return True - -def num_of_nodes(depth, fanout): - '''returns num of switches of a mininet with tree topology - with particular depth and fanout parameters - ''' - result = 0 - for i in xrange(depth): - result += fanout**i - return result - -def num_of_links_for_node(nodeid, leaflist, fanout): - ''' - If the given node is a leaf node, there will be an only one link for it - and nodeid will be represented 2 times in topology - If the given node is not a leaf node, then there will be fanout+1 links - for it and nodeid will be represented (fanout+1)*2 times in topology - - p.s. root node is excluded. - ''' - if nodeid in leaflist: - return 1 - return (fanout+1) - -if __name__ == '__main__': - print num_of_nodes(3,4) - pass |