Merge "Fix the Totalintent number is less than 0 - Refactor getTotalFlowsNum driver function, now use more stable method - Check flows number, if flows number is not except, will finish this iteration - Improved some logical - NOTE: sometimes it's still not stable, Be careful."
diff --git a/TestON/README.md b/TestON/README.md
index fdb9200..5335503 100644
--- a/TestON/README.md
+++ b/TestON/README.md
@@ -45,7 +45,7 @@
resides into "TestON-master" directory as following:
- paxterra@paxterra-desktop:~/TestON/bin$ ./cli.py
+ sdn@test-station:~/TestON/bin$ ./cli.py
teston>run MininetTest
2. TAI (Test Authoring Interface) UI based :
@@ -61,7 +61,7 @@
--------
For more examples, refer 'examples' directory.
Please find the below link for examples:
- https://github.com/Paxterra/TestON/tree/TestOn-1.0.0/examples
+ https://github.com/opennetworkinglab/OnosSystemTest/tree/master/TestON/examples
diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index f29a8ec..13423a5 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python
'''
Created on 20-Dec-2012
+Modified 2016 by ON.Lab
-@author: Anil Kumar (anilkumar.s@paxterrasolutions.com)
-
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -261,20 +262,24 @@
'''
options = self.initOptions(options)
try :
- for index, option in enumerate(args):
+ index = 0
+ while index < len( args ):
+ option = args[index]
if index > 0 :
- if re.match("logdir|mail|example|testdir|testcases|onoscell", option, flags = 0):
- index = index+1
- options[option] = args[index]
- options = self.testcasesInRange(index,option,args,options)
- elif re.match("--params", option, flags=0):
+ if re.match("--params", option, flags=0):
# check if there is a params
- index = index + 1
- options['params'].append(args[index])
+ options['params'].append(args[index+1])
+ elif re.match("logdir|mail|example|testdir|testcases|onoscell", option, flags = 0):
+ options[option] = args[index+1]
+ options = self.testcasesInRange(index+1,option,args,options)
+ index += 2
else :
options['testname'] = option
+ index += 1
except IndexError as e:
- print e
+ print (e)
+ main.cleanup()
+ main.exit()
return options
diff --git a/TestON/core/graph.py b/TestON/core/graph.py
index 936a286..e8c8a7a 100644
--- a/TestON/core/graph.py
+++ b/TestON/core/graph.py
@@ -1,4 +1,13 @@
#!/usr/bin/env python
+"""
+Created 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+"""
+
+
import time
import random
diff --git a/TestON/core/logger.py b/TestON/core/logger.py
index 05693ba..79f7c7f 100644
--- a/TestON/core/logger.py
+++ b/TestON/core/logger.py
@@ -1,8 +1,11 @@
#/usr/bin/env python
'''
Created on 07-Jan-2013
+Modified 2015 by ON.Lab
-@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/core/openspeak.py b/TestON/core/openspeak.py
index 3794910..b98c68b 100644
--- a/TestON/core/openspeak.py
+++ b/TestON/core/openspeak.py
@@ -1,9 +1,11 @@
#/usr/bin/env python
'''
Created on 20-Dec-2012
+Modified 2015 by ON.Lab
-@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index a770490..e3b50a5 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python
'''
Created on 22-Oct-2012
+Modified 2016 by ON.Lab
-@author: Anil Kumar (anilkumar.s@paxterrasolutions.com)
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -412,7 +414,7 @@
argument is given.
Optional Arguments:
- result: Case insensite string. Can be 'PASS' or 'FAIL' and will set
+ result: Case insensitive string. Can be 'PASS' or 'FAIL' and will set
the case result accordingly.
msg: Message to be printed when the case is skipped in the reports.
"""
@@ -949,7 +951,7 @@
if not re.search( ".=.", param ):
print( "Error when parsing params: params should follow key=value format" )
continue
- # Split the param string to netest keys and value
+ # Split the param string to catch nested keys and the value
[ keys, value ] = param.split( "=" )
# Split the nested keys according to its hierarchy
keyList = keys.split( "/" )
diff --git a/TestON/core/testparser.py b/TestON/core/testparser.py
index aab4388..904ebc0 100644
--- a/TestON/core/testparser.py
+++ b/TestON/core/testparser.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python
'''
Created on 26-Dec-2012
+Modified 2015 by ON.Lab
-@author: Anil Kumar (anilkumar.s@paxterrasolutions.com)
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index ce502cb..43d56dc 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -1,11 +1,11 @@
#!/usr/bin/env python
'''
Created on 23-Oct-2012
+Modified 2015 by ON.Lab
-@authors: Anil Kumar (anilkumar.s@paxterrasolutions.com),
- Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
-
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/core/xmldict.py b/TestON/core/xmldict.py
index 8d1dcf4..0746f3a 100644
--- a/TestON/core/xmldict.py
+++ b/TestON/core/xmldict.py
@@ -1,5 +1,10 @@
'''
Created on 03-Dec-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
@author: Anil Kumar (anilkumar.s@paxterrasolutions.com)
diff --git a/TestON/core/xmlparser.py b/TestON/core/xmlparser.py
index f12f69c..e639d57 100644
--- a/TestON/core/xmlparser.py
+++ b/TestON/core/xmlparser.py
@@ -1,6 +1,11 @@
#/usr/bin/env python
'''
Created on 07-Jan-2013
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index ff3d2e4..033353b 100644
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 07-08-2015
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1175,6 +1180,7 @@
udpDst="",
udpSrc="",
mpls="",
+ priority=100,
ip="DEFAULT",
port="DEFAULT",
debug=False ):
@@ -1205,7 +1211,7 @@
of the ONOS node
"""
try:
- flowJson = { "priority":100,
+ flowJson = { "priority":priority,
"isPermanent":"true",
"timeout":0,
"deviceId":deviceId,
diff --git a/TestON/drivers/common/api/controllerdriver.py b/TestON/drivers/common/api/controllerdriver.py
index 1c3b3b8..6cda814 100644
--- a/TestON/drivers/common/api/controllerdriver.py
+++ b/TestON/drivers/common/api/controllerdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 29-Nov-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/api/dockerapidriver.py b/TestON/drivers/common/api/dockerapidriver.py
index 4a874c6..10743da 100644
--- a/TestON/drivers/common/api/dockerapidriver.py
+++ b/TestON/drivers/common/api/dockerapidriver.py
@@ -1,4 +1,11 @@
#!/usr/bin/env python
+"""
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+"""
import json
import os
@@ -201,7 +208,7 @@
"""
rmResult = main.TRUE
- if self.dockerClient.images() is []:
+ if self.dockerClient.images() is []:
main.log.info( "No docker image found with RepoTags: " + image )
return rmResult
else:
diff --git a/TestON/drivers/common/api/fvtapidriver.py b/TestON/drivers/common/api/fvtapidriver.py
index 892eef9..f861f7d 100644
--- a/TestON/drivers/common/api/fvtapidriver.py
+++ b/TestON/drivers/common/api/fvtapidriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/apidriver.py b/TestON/drivers/common/apidriver.py
index af66d98..166211e 100644
--- a/TestON/drivers/common/apidriver.py
+++ b/TestON/drivers/common/apidriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 22-Nov-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/dpclidriver.py b/TestON/drivers/common/cli/dpclidriver.py
index 23214b8..f3ea3e5 100644
--- a/TestON/drivers/common/cli/dpclidriver.py
+++ b/TestON/drivers/common/cli/dpclidriver.py
@@ -1,5 +1,10 @@
"""
Driver for blank dataplane VMs. Created for SDNIP test.
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
"""
import pexpect
from drivers.common.clidriver import CLI
diff --git a/TestON/drivers/common/cli/emulator/flowvisordriver.py b/TestON/drivers/common/cli/emulator/flowvisordriver.py
index 6ec2ee6..35c0bbf 100644
--- a/TestON/drivers/common/cli/emulator/flowvisordriver.py
+++ b/TestON/drivers/common/cli/emulator/flowvisordriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Mar-2013
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/emulator/lincoedriver.py b/TestON/drivers/common/cli/emulator/lincoedriver.py
index ae3eef9..5024f17 100644
--- a/TestON/drivers/common/cli/emulator/lincoedriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoedriver.py
@@ -13,6 +13,11 @@
shreya@onlab.us
OCT 20 2014
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
"""
import pexpect
diff --git a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
index 7dfcb1e..1691ef8 100644
--- a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
@@ -16,7 +16,14 @@
LincOEMininetDriver is an extension of the mininetclidriver to handle linc oe
+
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
"""
+
import pexpect
import re
import sys
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 1632fee..a587019 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2016 by ON.Lab
-author: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/drivers/common/cli/emulator/poxclidriver.py b/TestON/drivers/common/cli/emulator/poxclidriver.py
index 2d92139..02c43b1 100644
--- a/TestON/drivers/common/cli/emulator/poxclidriver.py
+++ b/TestON/drivers/common/cli/emulator/poxclidriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Raghav Kashyap( raghavkashyap@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/emulator/remotemininetdriver.py b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
index cc75755..bf1c6c6 100644
--- a/TestON/drivers/common/cli/emulator/remotemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2016 by ON.Lab
-author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/TestON/drivers/common/cli/emulator/scapyclidriver.py b/TestON/drivers/common/cli/emulator/scapyclidriver.py
index 39c5c4d..f1457ea 100644
--- a/TestON/drivers/common/cli/emulator/scapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/scapyclidriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
2015-2016
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -619,7 +624,132 @@
main.cleanup()
main.exit()
- def buildICMP( self, **kwargs ):
+ def buildSCTP( self, ipVersion=4, **kwargs ):
+ """
+ Build an SCTP frame
+
+ Will create a frame class with the given options. If a field is
+ left blank it will default to the below value unless it is
+ overwritten by the next frame.
+
+ NOTE: Some arguments require quotes around them. It's up to you to
+ know which ones and to add them yourself. Arguments with an asterisk
+ do not need quotes.
+
+ Options:
+ ipVersion - Either 4 (default) or 6, indicates what Internet Protocol
+ frame to use to encapsulate into
+ Default frame:
+ ###[ SCTP ]###
+ sport= domain *
+ dport= domain *
+ tag = None
+ chksum = None
+
+ Returns main.TRUE or main.FALSE on error
+ """
+ try:
+ # Set the SCTP frame
+ cmd = 'sctp = SCTP( '
+ options = [ ]
+ for key, value in kwargs.iteritems( ):
+ options.append( str( key ) + "=" + str( value ) )
+ cmd += ", ".join( options )
+ cmd += ' )'
+ self.handle.sendline( cmd )
+ self.handle.expect( self.scapyPrompt )
+ if "Traceback" in self.handle.before:
+ # KeyError, SyntaxError, ...
+ main.log.error( "Error in sending command: " + self.handle.before )
+ return main.FALSE
+ if str( ipVersion ) is '4':
+ self.handle.sendline( "packet = ether/ip/sctp" )
+ elif str( ipVersion ) is '6':
+ self.handle.sendline( "packet = ether/ipv6/sctp" )
+ else:
+ main.log.error( "Unrecognized option for ipVersion, given " +
+ repr( ipVersion ) )
+ return main.FALSE
+ self.handle.expect( self.scapyPrompt )
+ if "Traceback" in self.handle.before:
+ # KeyError, SyntaxError, ...
+ main.log.error( "Error in sending command: " + self.handle.before )
+ return main.FALSE
+ return main.TRUE
+ except pexpect.TIMEOUT:
+ main.log.exception( self.name + ": Command timed out" )
+ return main.FALSE
+ except pexpect.EOF:
+ main.log.exception( self.name + ": connection closed." )
+ main.cleanup( )
+ main.exit( )
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup( )
+ main.exit( )
+
+ def buildARP( self, **kwargs ):
+ """
+ Build an ARP frame
+
+ Will create a frame class with the given options. If a field is
+ left blank it will default to the below value unless it is
+ overwritten by the next frame.
+
+ NOTE: Some arguments require quotes around them. It's up to you to
+ know which ones and to add them yourself. Arguments with an asterisk
+ do not need quotes.
+
+ Default frame:
+ ###[ ARP ]###
+ hwtype : XShortField = (1)
+ ptype : XShortEnumField = (2048)
+ hwlen : ByteField = (6)
+ plen : ByteField = (4)
+ op : ShortEnumField = (1)
+ hwsrc : ARPSourceMACField = (None)
+ psrc : SourceIPField = (None)
+ hwdst : MACField = ('00:00:00:00:00:00')
+ pdst : IPField = ('0.0.0.0')
+
+ Returns main.TRUE or main.FALSE on error
+ """
+ try:
+ # Set the ARP frame
+ cmd = 'arp = ARP( '
+ options = []
+ for key, value in kwargs.iteritems( ):
+ if isinstance( value, str ):
+ value = '"' + value + '"'
+ options.append( str( key ) + "=" + str( value ) )
+ cmd += ", ".join( options )
+ cmd += ' )'
+ self.handle.sendline( cmd )
+ self.handle.expect( self.scapyPrompt )
+ if "Traceback" in self.handle.before:
+ # KeyError, SyntaxError, ...
+ main.log.error( "Error in sending command: " + self.handle.before )
+ return main.FALSE
+ self.handle.sendline( "packet = ether/arp" )
+ self.handle.expect( self.scapyPrompt )
+ if "Traceback" in self.handle.before:
+ # KeyError, SyntaxError, ...
+ main.log.error( "Error in sending command: " + self.handle.before )
+ return main.FALSE
+ return main.TRUE
+ except pexpect.TIMEOUT:
+ main.log.exception( self.name + ": Command timed out" )
+ return main.FALSE
+ except pexpect.EOF:
+ main.log.exception( self.name + ": connection closed." )
+ main.cleanup( )
+ main.exit( )
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup( )
+ main.exit( )
+
+ def buildICMP( self, ipVersion=4, **kwargs ):
"""
Build an ICMP frame
@@ -634,13 +764,24 @@
id= 0x0
seq= 0x0
+ Options:
+ ipVersion - Either 4 (default) or 6, indicates what Internet Protocol
+ frame to use to encapsulate into
+
Returns main.TRUE or main.FALSE on error
"""
try:
# Set the ICMP frame
- cmd = 'icmp = ICMP( '
+ if str( ipVersion ) is '4':
+ cmd = 'icmp = ICMP( '
+ elif str( ipVersion ) is '6':
+ cmd = 'icmp6 = ICMPv6EchoReply( '
+ else:
+ main.log.error( "Unrecognized option for ipVersion, given " +
+ repr( ipVersion ) )
+ return main.FALSE
options = []
- for key, value in kwargs.iteritems():
+ for key, value in kwargs.iteritems( ):
if isinstance( value, str ):
value = '"' + value + '"'
options.append( str( key ) + "=" + str( value ) )
@@ -652,7 +793,15 @@
# KeyError, SyntaxError, ...
main.log.error( "Error in sending command: " + self.handle.before )
return main.FALSE
- self.handle.sendline( "packet = ether/ip/icmp" )
+
+ if str( ipVersion ) is '4':
+ self.handle.sendline( "packet = ether/ip/icmp" )
+ elif str( ipVersion ) is '6':
+ self.handle.sendline( "packet = ether/ipv6/icmp6" )
+ else:
+ main.log.error( "Unrecognized option for ipVersion, given " +
+ repr( ipVersion ) )
+ return main.FALSE
self.handle.expect( self.scapyPrompt )
if "Traceback" in self.handle.before:
# KeyError, SyntaxError, ...
@@ -664,12 +813,12 @@
return main.FALSE
except pexpect.EOF:
main.log.exception( self.name + ": connection closed." )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
def sendPacket( self, iface=None, packet=None, timeout=1 ):
"""
@@ -817,12 +966,15 @@
main.exit()
return self.handle.before
- def updateSelf( self ):
+ def updateSelf( self, IPv6=False ):
"""
Updates local MAC and IP fields
"""
self.hostMac = self.getMac()
- self.hostIp = self.getIp()
+ if IPv6:
+ self.hostIp = self.getIp( IPv6=True )
+ else:
+ self.hostIp = self.getIp()
def getMac( self, ifaceName=None ):
"""
@@ -852,24 +1004,33 @@
main.cleanup()
main.exit()
- def getIp( self, ifaceName=None ):
+ def getIp( self, ifaceName=None, IPv6=False ):
"""
Save host's IP address
Returns the IP of the first interface that is not a loopback device.
If no IP could be found then it will return 0.0.0.0.
+
+ If IPv6 is equal to True, returns IPv6 of the first interface that is not a loopback device.
+ If no IPv6 could be found then it will return :: .
+
"""
def getIPofInterface( ifaceName ):
cmd = 'get_if_addr("' + str( ifaceName ) + '")'
+ if IPv6:
+ cmd = 'get_if_raw_addr6("' + str( ifaceName ) + '")'
self.handle.sendline( cmd )
self.handle.expect( self.scapyPrompt )
pattern = r'(((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))'
+ if IPv6:
+ pattern = r'(\\x([0-9]|[a-f]|[A-F])([0-9]|[a-f]|[A-F])){16}'
match = re.search( pattern, self.handle.before )
if match:
# NOTE: The command will return 0.0.0.0 if the iface doesn't exist
- if match.group() == '0.0.0.0':
- main.log.warn( 'iface {0} has no IPv4 address'.format( ifaceName ) )
+ if IPv6 != True:
+ if match.group() == '0.0.0.0':
+ main.log.warn( 'iface {0} has no IPv4 address'.format( ifaceName ) )
return match.group()
else:
return None
@@ -877,13 +1038,33 @@
if not ifaceName:
# Get list of interfaces
ifList = self.getIfList()
- for ifaceName in ifList:
- if ifaceName == "lo":
- continue
- ip = getIPofInterface( ifaceName )
- if ip != "0.0.0.0":
- return ip
- return "0.0.0.0"
+ if IPv6:
+ for ifaceName in ifList:
+ if ifaceName == "lo":
+ continue
+ ip = getIPofInterface( ifaceName )
+ if ip != None:
+ newip =ip
+ tmp = newip.split( "\\x" )
+ ip = ""
+ counter = 0
+ for i in tmp:
+ if i != "":
+ counter = counter + 1;
+ if counter % 2 == 0 and counter < 16:
+ ip = ip + i + ":"
+ else:
+ ip = ip + i
+ return ip
+ return "::"
+ else:
+ for ifaceName in ifList:
+ if ifaceName == "lo":
+ continue
+ ip = getIPofInterface( ifaceName )
+ if ip != "0.0.0.0":
+ return ip
+ return "0.0.0.0"
else:
return getIPofInterface( ifaceName )
diff --git a/TestON/drivers/common/cli/emulatordriver.py b/TestON/drivers/common/cli/emulatordriver.py
index fa0309e..fb7a80d 100644
--- a/TestON/drivers/common/cli/emulatordriver.py
+++ b/TestON/drivers/common/cli/emulatordriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 64d9fbb..22425bf 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -14,6 +14,11 @@
shreya@onlab.us
OCT 13 2014
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
"""
import pexpect
@@ -2807,9 +2812,12 @@
"""
import json
try:
- topology = self.getTopology( self.topology() )
summary = json.loads( self.summary() )
-
+ except ( TypeError, ValueError ):
+ main.log.exception( "{}: Object not as expected: {!r}".format( self.name, summary ) )
+ return main.ERROR
+ try:
+ topology = self.getTopology( self.topology() )
if topology == {} or topology == None or summary == {} or summary == None:
return main.ERROR
output = ""
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index e749ce2..635178e 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -14,6 +14,11 @@
andrew@onlab.us
OCT 9 2014
+Modified 2016 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
"""
import time
@@ -2364,4 +2369,4 @@
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
- main.exit()
\ No newline at end of file
+ main.exit()
diff --git a/TestON/drivers/common/cli/quaggaclidriver.py b/TestON/drivers/common/cli/quaggaclidriver.py
index e89047e..721ae6a 100644
--- a/TestON/drivers/common/cli/quaggaclidriver.py
+++ b/TestON/drivers/common/cli/quaggaclidriver.py
@@ -1,4 +1,11 @@
#!/usr/bin/env python
+"""
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+"""
import time
import pexpect
diff --git a/TestON/drivers/common/cli/remotesysdriver.py b/TestON/drivers/common/cli/remotesysdriver.py
index 963b8f4..a56f644 100644
--- a/TestON/drivers/common/cli/remotesysdriver.py
+++ b/TestON/drivers/common/cli/remotesysdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
index a000806..4f55a90 100644
--- a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 12-Feb-2013
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
index 07fb668..aea470d 100644
--- a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
@@ -1,3 +1,11 @@
+"""
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+"""
+
class NEC:
def __init__( self ):
diff --git a/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py b/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
index 6f2f90c..50100c9 100644
--- a/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 12-Feb-2013
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py b/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
index 892d998..f4a1f1a 100644
--- a/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 12-Feb-2013
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/remotetestbeddriver.py b/TestON/drivers/common/cli/remotetestbeddriver.py
index acb9ccc..ebf8fbe 100644
--- a/TestON/drivers/common/cli/remotetestbeddriver.py
+++ b/TestON/drivers/common/cli/remotetestbeddriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Oct-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/tool/dpctlclidriver.py b/TestON/drivers/common/cli/tool/dpctlclidriver.py
index 504567c..683f16e 100644
--- a/TestON/drivers/common/cli/tool/dpctlclidriver.py
+++ b/TestON/drivers/common/cli/tool/dpctlclidriver.py
@@ -1,6 +1,11 @@
#/usr/bin/env python
"""
Created on 26-Nov-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Raghav Kashyap( raghavkashyap@paxterrasolutions.com )
diff --git a/TestON/drivers/common/cli/toolsdriver.py b/TestON/drivers/common/cli/toolsdriver.py
index 775902f..c96cb4f 100644
--- a/TestON/drivers/common/cli/toolsdriver.py
+++ b/TestON/drivers/common/cli/toolsdriver.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python
"""
Created on 26-Nov-2012
+Modified 2015 by ON.Lab
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
author:: Raghav Kashyap( raghavkashyap@paxterrasolutions.com )
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index a7404fa..283088d 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python
"""
Created on 24-Oct-2012
+Modified 2016 by ON.Lab
-author:s: Anil Kumar ( anilkumar.s@paxterrasolutions.com ),
- Raghav Kashyap( raghavkashyap@paxterrasolutions.com )
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,9 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
-
-
-
"""
import pexpect
import re
diff --git a/TestON/drivers/component.py b/TestON/drivers/component.py
index b8a66e9..fc17d47 100644
--- a/TestON/drivers/component.py
+++ b/TestON/drivers/component.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python
"""
Created on 24-Oct-2012
+Modified 2015 by ON.Lab
-author:s: Anil Kumar ( anilkumar.s@paxterrasolutions.com ),
- Raghav Kashyap( raghavkashyap@paxterrasolutions.com )
-
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,9 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
-
-
-
"""
import logging
diff --git a/TestON/install.sh b/TestON/install.sh
index dee85c9..4bbfe92 100755
--- a/TestON/install.sh
+++ b/TestON/install.sh
@@ -63,13 +63,20 @@
echo "Installing TestON dependencies"
if [ "$DIST" = "Fedora" ]; then
# Fedora may have vlan enabled by default. Still need to confirm and update later
- $install python-pip build-essential python-dev pep8 arping python3-requests
+ $install python-pip build-essential python-dev pep8 python3-requests
$pipinstall pexpect==3.2 configobj==4.7.2 numpy
else
- $install python-pip build-essential python-dev pep8 vlan arping python3-requests
+ $install python-pip build-essential python-dev pep8 vlan python3-requests
$pipinstall pexpect==3.2 configobj==4.7.2 numpy
fi
+# Some Distos have this already from another package
+if which arping > /dev/null ; then
+ echo "Arping command detected, skipping package installation."
+else
+ $install arping
+fi
+
# Add check here to make sure OnosSystemTest is cloned into home directory (place holder)
# Add symbolic link to main TestON folder in Home dir
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index 848e4cc..6c9ef4b 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -15,12 +15,13 @@
# 50. Set FlowObjective to True
# 51. Set FlowObjective to False
# 60. Rebalance devices across controllers
- # 70. Randomly generate events
+ # 70. Run randomly generated events
+ # 80. Replay events from log file
# 90. Sleep for some time
- # 100. Do something else
+ # 100. Do nothing
# Sample sequence: 0,1,2,3,[10,30,21,31,10,32,21,33,50,10,30,21,31,10,32,21,33,51,40,60,10,30,21,31,10,32,21,33,50,10,30,21,31,10,32,21,33,51,41,60]*500,100
<testcases>
- 0,1,2,3,70,[30,21,31,32,21,33]*500,100
+ 0,1,2,3,70
</testcases>
<TEST>
@@ -391,6 +392,12 @@
<deviceDownWeight>2</deviceDownWeight>
</CASE70>
+ <CASE80>
+ <filePath>/home/admin/log-for-replay</filePath>
+ <sleepTime>0.1</sleepTime>
+ <skipChecks>on</skipChecks>
+ </CASE80>
+
<CASE90>
<sleepSec>60</sleepSec>
</CASE90>
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 11459b3..8937a4a 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -794,7 +794,7 @@
events.append( 'device-down' )
for i in range( int( pow( hostIntentNum, 1.5 ) / 100 ) ):
events.append( 'del-host-intent' )
- for i in range( int( pow( pointIntentNum/2, 1.5 ) / 100 ) ):
+ for i in range( int( pow( pointIntentNum, 1.5 ) / 100 ) ):
events.append( 'del-point-intent' )
for i in range( pow( 2, downLinkNum ) - 1 ):
events.append( 'link-up' )
@@ -806,30 +806,26 @@
n = random.randint( 5, 50 )
for i in range( n ):
cliIndex = random.sample( upControllers, 1 )[ 0 ]
- main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_ADD, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex )
+ main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_ADD, EventScheduleMethod().RUN_BLOCK, 'random', 'random', cliIndex )
hostIntentNum += 1
- main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
elif event == 'del-host-intent':
n = random.randint( 5, hostIntentNum )
for i in range( n ):
cliIndex = random.sample( upControllers, 1 )[ 0 ]
- main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_DEL, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex )
+ main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_DEL, EventScheduleMethod().RUN_BLOCK, 'random', 'random', cliIndex )
hostIntentNum -= 1
- main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
elif event == 'add-point-intent':
n = random.randint( 5, 50 )
for i in range( n ):
cliIndex = random.sample( upControllers, 1 )[ 0 ]
- main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_ADD, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
- pointIntentNum += 1
- main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+ main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_ADD, EventScheduleMethod().RUN_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
+ pointIntentNum += 2
elif event == 'del-point-intent':
- n = random.randint( 5, pointIntentNum )
+ n = random.randint( 5, pointIntentNum / 2 )
for i in range( n ):
cliIndex = random.sample( upControllers, 1 )[ 0 ]
- main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_DEL, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
- pointIntentNum -= 1
- main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+ main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_DEL, EventScheduleMethod().RUN_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
+ pointIntentNum -= 2
elif event == 'link-down':
main.eventGenerator.triggerEvent( EventType().NETWORK_LINK_DOWN, EventScheduleMethod().RUN_BLOCK, 'random', 'random' )
downLinkNum += 1
@@ -849,7 +845,6 @@
main.eventGenerator.triggerEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
main.eventGenerator.triggerEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
main.eventGenerator.triggerEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
with main.eventScheduler.idleCondition:
while not main.eventScheduler.isIdle():
main.eventScheduler.idleCondition.wait()
@@ -860,6 +855,45 @@
onfail="Randomly generate events test failed" )
time.sleep( main.caseSleep )
+ def CASE80( self, main ):
+ """
+ Replay events from log file
+ """
+ import time
+ from tests.CHOTestMonkey.dependencies.events.Event import EventType
+ from tests.CHOTestMonkey.dependencies.EventScheduler import EventScheduleMethod
+
+ main.log.report( "Replay events from log file" )
+ main.log.report( "__________________________________________________" )
+ main.case( "Replay events from log file" )
+ main.step( "Replay events from log file" )
+ main.caseResult = main.TRUE
+ try:
+ f = open( main.params[ 'CASE80' ][ 'filePath' ], 'r' )
+ for line in f.readlines():
+ if 'CHOTestMonkey' in line and 'Event recorded' in line:
+ line = line.split()
+ eventIndex = int( line[ 9 ] )
+ eventName = line[ 10 ]
+ args = line[ 11: ]
+ assert eventName.startswith( 'CHECK' )\
+ or eventName.startswith( 'NETWORK' )\
+ or eventName.startswith( 'APP' )\
+ or eventName.startswith( 'ONOS' )
+ if main.params[ 'CASE80' ][ 'skipChecks' ] == 'on' and eventName.startswith( 'CHECK' ):
+ continue
+ with main.eventScheduler.idleCondition:
+ while not main.eventScheduler.isIdle():
+ main.eventScheduler.idleCondition.wait()
+ main.eventGenerator.triggerEvent( eventIndex, EventScheduleMethod().RUN_BLOCK, *args )
+ time.sleep( float( main.params[ 'CASE80' ][ 'sleepTime' ] ) )
+ except Exception as e:
+ print e
+ utilities.assert_equals( expect=main.TRUE,
+ actual=main.caseResult,
+ onpass="Replay from log file passed",
+ onfail="Replay from log file failed" )
+
def CASE90( self, main ):
"""
Sleep for some time
diff --git a/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py b/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
index 0c3e0e0..27b8166 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
@@ -15,7 +15,7 @@
address = ( host, port )
conn = Client( address )
request = []
- request.append( 2 )
+ request.append( 1 )
request.append( type )
request.append( scheduleMethod )
for arg in args:
@@ -23,7 +23,9 @@
conn.send( request )
response = conn.recv()
while response == 11:
+ conn.close()
time.sleep( 1 )
+ conn = Client( address )
conn.send( request )
response = conn.recv()
if response == 10:
@@ -64,5 +66,19 @@
else:
pass
+def replayFromFile( filePath='/home/admin/event-list', sleepTime=1 ):
+ try:
+ f = open( filePath, 'r' )
+ for line in f.readlines():
+ event = line.split()
+ if event[ 3 ].startswith( 'CHECK' ):
+ continue
+ triggerEvent( event[ 3 ], 'RUN_BLOCK', *event[ 4: ] )
+ time.sleep( sleepTime )
+ f.close()
+ except Exception as e:
+ print e
+
if __name__ == '__main__':
- testLoop( 2 )
+ #testLoop( 2 )
+ replayFromFile()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
index 17e9e73..e9dff29 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
@@ -58,7 +58,6 @@
def setWithdrawn( self ):
self.expectedState = 'WITHDRAWN'
- # TODO: should we check whether hostA and hostB are made correspondents by other intents/flows?
if self.hostB in self.hostA.correspondents:
self.hostA.correspondents.remove( self.hostB )
if self.hostA in self.hostB.correspondents:
@@ -66,17 +65,12 @@
def setFailed( self ):
self.expectedState = 'FAILED'
- # TODO: should we check whether hostA and hostB are made correspondents by other intents/flows?
- if self.hostB in self.hostA.correspondents:
- self.hostA.correspondents.remove( self.hostB )
- if self.hostA in self.hostB.correspondents:
- self.hostB.correspondents.remove( self.hostA )
def setInstalled( self ):
+ if self.expectedState == 'UNKNOWN':
+ self.hostA.correspondents.append( self.hostB )
+ self.hostB.correspondents.append( self.hostA )
self.expectedState = 'INSTALLED'
- # TODO: should we check whether hostA and hostB are already correspondents?
- self.hostA.correspondents.append( self.hostB )
- self.hostB.correspondents.append( self.hostA )
def __str__( self ):
return "ID: " + self.id
@@ -97,16 +91,13 @@
def setFailed( self ):
self.expectedState = 'FAILED'
- for hostA in self.deviceA.hosts:
- for hostB in self.deviceB.hosts:
- if hostB in hostA.correspondents:
- hostA.correspondents.remove( hostB )
def setInstalled( self ):
+ if self.expectedState == 'UNKNOWN':
+ for hostA in self.deviceA.hosts:
+ for hostB in self.deviceB.hosts:
+ hostA.correspondents.append( hostB )
self.expectedState = 'INSTALLED'
- for hostA in self.deviceA.hosts:
- for hostB in self.deviceB.hosts:
- hostA.correspondents.append( hostB )
def __str__( self ):
return "ID: " + self.id
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index 07c8cb6..4283ff6 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -63,7 +63,7 @@
def startEvent( self, args ):
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
if self.typeIndex == EventType().APP_INTENT_HOST_ADD or self.typeIndex == EventType().APP_INTENT_HOST_DEL:
if len( args ) < 3:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
@@ -138,6 +138,7 @@
intent.hostB == self.hostA and intent.hostA == self.hostB:
main.log.warn( self.typeString + " - find an exiting intent for the host pair, abort installation" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.hostA.name, self.hostB.name, self.CLIIndex ) )
controller = main.controllers[ self.CLIIndex - 1 ]
with controller.CLILock:
id = controller.CLI.addHostIntent( self.hostA.id, self.hostB.id )
@@ -179,6 +180,7 @@
if targetIntent == None:
main.log.warn( self.typeString + " - intent does not exist" )
return EventStates().FAIL
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.hostA.name, self.hostB.name, self.CLIIndex ) )
controller = main.controllers[ self.CLIIndex - 1 ]
with controller.CLILock:
result = controller.CLI.removeIntent( targetIntent.id, purge=True )
@@ -204,7 +206,7 @@
def startEvent( self, args ):
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
if self.typeIndex == EventType().APP_INTENT_POINT_ADD or self.typeIndex == EventType().APP_INTENT_POINT_DEL:
if len( args ) < 3:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
@@ -290,6 +292,7 @@
if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
main.log.warn( self.typeString + " - find an exiting intent for the device pair, abort installation" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.deviceA.name, self.deviceB.name, self.CLIIndex ) )
controller = main.controllers[ self.CLIIndex - 1 ]
with controller.CLILock:
srcMAC = ""
@@ -336,6 +339,7 @@
if targetIntent == None:
main.log.warn( self.typeString + " - intent does not exist" )
return EventStates().FAIL
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.deviceA.name, self.deviceB.name, self.CLIIndex ) )
controller = main.controllers[ self.CLIIndex - 1 ]
with controller.CLILock:
result = controller.CLI.removeIntent( targetIntent.id, purge=True )
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
index fcbf23d..fa42e12 100755
--- a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
@@ -13,7 +13,7 @@
def startEvent( self, args ):
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ main.log.info( "Event recorded: {} {}".format( self.typeIndex, self.typeString ) )
result = self.startCheckEvent()
return result
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
index 8ec62a1..ccab8a1 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
@@ -19,7 +19,7 @@
args are the names of the two link ends, e.g. ['s1', 's2']
"""
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
if len( args ) < 2:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
return EventStates().ABORT
@@ -84,6 +84,7 @@
elif self.linkA.isRemoved() or self.linkB.isRemoved():
main.log.warn( "Link Down - link has been removed" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {}".format( self.typeIndex, self.typeString, self.linkA.deviceA.name, self.linkA.deviceB.name ) )
with main.mininetLock:
'''
result = main.Mininet1.link( END1=self.linkA.deviceA.name,
@@ -118,6 +119,7 @@
if self.linkA.isRemoved() or self.linkB.isRemoved():
main.log.warn( "Link Up - link has been removed" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {}".format( self.typeIndex, self.typeString, self.linkA.deviceA.name, self.linkA.deviceB.name ) )
with main.mininetLock:
'''
result = main.Mininet1.link( END1=self.linkA.deviceA.name,
@@ -147,7 +149,7 @@
args are the names of the device, e.g. 's1'
"""
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
if len( args ) < 1:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
return EventStates().ABORT
@@ -199,6 +201,7 @@
if self.device.isRemoved():
main.log.warn( "Device Down - device has been removed" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {}".format( self.typeIndex, self.typeString, self.device.name ) )
with main.mininetLock:
result = main.Mininet1.delSwitch( self.device.name )
if not result:
@@ -232,6 +235,7 @@
main.log.warn( "Device Up - device already up" )
return EventStates().ABORT
# Re-add the device
+ main.log.info( "Event recorded: {} {} {}".format( self.typeIndex, self.typeString, self.device.name ) )
with main.mininetLock:
result = main.Mininet1.addSwitch( self.device.name, dpid=self.device.dpid[3:] )
if not result:
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
index f4e2a89..28960d2 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
@@ -11,7 +11,7 @@
def startEvent( self, args ):
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
result = EventStates().PASS
if self.typeIndex == EventType().ONOS_ONOS_DOWN or self.typeIndex == EventType().ONOS_ONOS_UP:
if len( args ) < 1:
@@ -42,6 +42,7 @@
if not main.controllers[ self.ONOSIndex - 1 ].isUp():
main.log.warn( "ONOS Down - ONOS already down" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {}".format( self.typeIndex, self.typeString, self.ONOSIndex ) )
with main.ONOSbenchLock:
result = main.ONOSbench.onosStop( main.controllers[ self.ONOSIndex - 1 ].ip )
if not result:
@@ -63,6 +64,7 @@
if main.controllers[ self.ONOSIndex - 1 ].isUp():
main.log.warn( "ONOS Up - ONOS already up" )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {}".format( self.typeIndex, self.typeString, self.ONOSIndex ) )
with main.ONOSbenchLock:
startResult = main.ONOSbench.onosStart( main.controllers[ self.ONOSIndex - 1 ].ip )
if not startResult:
@@ -92,7 +94,7 @@
def startEvent( self, args ):
with self.eventLock:
- main.log.info( "%s - starting event" % ( self.typeString ) )
+ #main.log.info( "%s - starting event" % ( self.typeString ) )
result = self.startCfgEvent( args )
return result
@@ -121,6 +123,7 @@
if index == -1:
main.log.warn( "%s - No available controllers" %s ( self.typeString ) )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.component, self.propName, self.value ) )
controller = main.controllers[ index - 1 ]
with controller.CLILock:
result = controller.CLI.setCfg( component=self.component,
@@ -158,6 +161,7 @@
if index == -1:
main.log.warn( "%s - No available controllers" %s ( self.typeString ) )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.component, self.propName, self.value ) )
controller = main.controllers[ index - 1 ]
with controller.CLILock:
result = controller.CLI.setCfg( component=self.component,
@@ -184,6 +188,7 @@
if index == -1:
main.log.warn( "%s - No available controllers" %s ( self.typeString ) )
return EventStates().ABORT
+ main.log.info( "Event recorded: {} {}".format( self.typeIndex, self.typeString ) )
controller = main.controllers[ index - 1 ]
with controller.CLILock:
result = controller.CLI.balanceMasters()
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.params b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.params
index 34dba48..89202a5 100755
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.params
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.params
@@ -5,14 +5,15 @@
#CASE1: Compile ONOS and push it to the test machines
#CASE2: Discovery the topology using BGPLS
#CASE3: Addition of new Node to existing topology
-#CASE4: Deletion of Node
-#Case5: Uninstalling the app
+#CASE4: Verification of Links thats is discovered"
+#CASE5: Deletion of Links
+#Case6: Uninstalling the app
- <testcases>1,2,3,4,5</testcases>
+ <testcases>1,2,3,4,5,6</testcases>
<DEPENDENCY>
- <path>/tests/FUNCbgpls/Dependencies/</path>
+ <path>/tests/FUNC/FUNCbgpls/Dependencies/</path>
</DEPENDENCY>
<ENV>
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
index a56c5c4..db60aad 100755
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
@@ -8,8 +8,9 @@
CASE1: Compile ONOS and push it to the test machines
CASE2: Discovery the topology using BGPLS
CASE3: Addition of new Node to existing topology
-CASE4: Deletion of Node
-Case5: Uninstalling the app
+CASE4: Verification of Links thats is discovered"
+CASE5: Deletion of Links
+Case6: Uninstalling the app
"""
@@ -275,7 +276,7 @@
bgplsConfig.Comments()
main.Scapy1.handle.sendline( "\x03" )
- time.sleep(90) #This Sleep time gives time for the socket to close.
+ time.sleep( 90 ) #This Sleep time gives time for the socket to close.
@@ -365,24 +366,23 @@
stepResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
- onpass="Node " + str( Ne_id[1][3] ) + " update sucess",
- onfail="Node " + str( Ne_id[1][3]) + " update failed" )
+ onpass="Node " + str( Ne_id[ 1 ][ 3 ] ) + " update sucess",
+ onfail="Node " + str( Ne_id[ 1 ][ 3 ] ) + " update failed" )
bgplsConfig.Comments()
main.log.info( "Kill Scapy process" )
bgplsConfig.Comments()
main.Scapy1.handle.sendline( "\x03" )
-
+ time.sleep( 90 ) #This Sleep time gives time for the socket to close.
def CASE4( self, main ):
"""
- Deletion of Node
+ Verification of Links in existing topology
"""
- import os , sys
- import re
+ import json
import time
- main.case( "TestCase 4: Deletion of Node from existing Topology" )
-
+ import os
+ main.case( "Testcase 4: Verification of Links thats is discovered" )
try:
from tests.FUNC.FUNCbgpls.dependencies.Nbdata import BgpLs
except ImportError:
@@ -392,30 +392,14 @@
main.exit()
bgplsConfig = BgpLs()
- Ne_id = bgplsConfig.Constants()
app = bgplsConfig.apps()
main.CLIs = []
main.nodes = []
main.numCtrls= 1
-
- bgplsConfig.Comments()
- main.log.info( "Blocked due to this defect : ONOS-3920 " )
- bgplsConfig.Comments()
-
- '''
ipList = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
scapy_ip = os.getenv(main.params ['SCAPY'] ['HOSTNAMES'] )
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- cellAppString= main.params[ 'ENV' ][ 'cellApps' ]
- httpport = main.params['HTTP']['port']
- path = main.params['HTTP']['path']
- bgplsConfig = BgpLs()
bgplsConfig.ipValue(ipList,scapy_ip)
- main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
- scapy_ip,
- cellAppString, ipList , onosUser="karaf" )
-
for i in range( 1, main.numCtrls + 1 ):
try:
main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
@@ -424,93 +408,120 @@
except AttributeError:
break
- main.step( "Apply cell to environment" )
bgplsConfig.Comments()
- cellResult = main.ONOSbench.setCell( cellName )
-
- bgplsConfig.Comments()
- main.log.info( "Sending BGPLS information " )
+ main.log.info( "Sending BGPLS Link information Packet " )
bgplsConfig.Comments()
-
- main.Scapy1.handle.sendline( "sudo python OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py" )
- #main.Scapy1.handle.expect( "sdn:" )
- #main.Scapy1.handle.sendline( "rocks" )
-
-
+ main.Scapy1.handle.sendline( "sudo python OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py" )
bgplsConfig.Comments()
main.log.info( "Enable BGPlS plugin in ONOS" )
bgplsConfig.Comments()
+ main.step( "UnInstall onos-app-bgp" )
+ installResults = main.ONOScli1.deactivateApp( app[ 0 ] )
+ utilities.assert_equals( expect=main.TRUE, actual=installResults,
+ onpass="Uninstall onos-app-bgp successful",
+ onfail="Uninstall onos-app-bgp failed" )
- cliResults = main.ONOScli1.startOnosCli( main.nodes[0].ip_address)
-
- main.step( "Getting connected to ONOS" )
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
- installResults = main.ONOScli1.activateApp( app[0])
-
+ installResults = main.ONOScli1.activateApp( app[ 0 ])
main.step( "Install onos-app-bgp" )
utilities.assert_equals( expect=main.TRUE, actual=installResults,
onpass="Install onos-app-bgp successful",
onfail="Install onos-app-bgp failed" )
-
- main.step( "Install onos-app-bgpflow" )
- installResults = main.ONOScli1.activateApp( app[1] )
- utilities.assert_equals( expect=main.TRUE, actual=installResults,
- onpass="Install onos-app-bgpflow successful",
- onfail="Install onos-app-bgpflow failed" )
-
-
- bgpls_post = bgplsConfig.DictoJson()
-
bgplsConfig.Comments()
- main.log.info( "BGPLS RestConf input" )
+ main.log.info( "Checking the Link Discovery Status" )
bgplsConfig.Comments()
+ time.sleep( 120 ) # Time taken to discovery the links
+ response = main.ONOScli1.links()
+ linksResp = json.loads( response )
+ check_link = bgplsConfig.checkLinks( linksResp )
- print (bgpls_post)
- main.ONOSrest.user_name = "karaf"
- main.ONOSrest.pwd = "karaf"
- Poststatus, result = main.ONOSrest.send( ipList,httpport,'', path + 'v1/network/configuration/',
- 'POST', None, bgpls_post, debug=True )
-
- main.step( "Configure BGP through RESTCONF" )
- utilities.assert_equals(
- expect='200',
- actual=Poststatus,
- onpass="Post Port Success",
- onfail="Post Port Failed " + str( Poststatus ) + "," + str( result ) )
-
-
- bgplsConfig.Comments()
- main.log.info( "Check Network devices is deleted from ONOS " )
- bgplsConfig.Comments()
- time.sleep(15)
-
- response = main.ONOScli1.devices()
-
- main.step( "Check whehther Node is deleted successfully" )
-
- if response.find(Ne_id[3]) != -1:
- stepResult = main.TRUE
- else:
- stepResult = main.FALSE
- utilities.assert_equals( expect=main.FALSE,
- actual=stepResult,
- onpass="Node " + str( Ne_id[3] ) + " Deletion sucess",
- onfail="Node " + str( Ne_id[3] ) + " Deletion failed" )
-
+ if check_link == True:
+ reply_Check_Link = main.TRUE
+ utilities.assert_equals( expect= main.TRUE,
+ actual=reply_Check_Link ,
+ onpass="Link Discovery Success.",
+ onfail="Link Discovery Failed." )
bgplsConfig.Comments()
main.log.info( "Kill Scapy process" )
bgplsConfig.Comments()
-
main.Scapy1.handle.sendline( "\x03" )
- '''
-
+ time.sleep( 90 )
def CASE5( self, main ):
"""
+ Deletion of links
+ """
+ import json
+ import time
+ import os
+ main.case( "Testcase 5: Deletion of Link in existing topology" )
+ try:
+ from tests.FUNC.FUNCbgpls.dependencies.Nbdata import BgpLs
+ except ImportError:
+ main.log.exception( "Something wrong with import file or code error." )
+ main.log.info( "Import Error, please check!" )
+ main.cleanup()
+ main.exit()
+
+ bgplsConfig = BgpLs()
+ app = bgplsConfig.apps()
+ main.CLIs = []
+ main.nodes = []
+ main.numCtrls= 1
+ ipList = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
+ scapy_ip = os.getenv(main.params [ 'SCAPY' ] [ 'HOSTNAMES' ] )
+ bgplsConfig.ipValue(ipList,scapy_ip)
+
+ for i in range( 1, main.numCtrls + 1 ):
+ try:
+ main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+ main.nodes.append( getattr( main, 'ONOS' + str( i ) ) )
+ ipList.append( main.nodes[ -1 ].ip_address )
+ except AttributeError:
+ break
+
+ bgplsConfig.Comments()
+ main.log.info( "Sending BGPLS Delete Link Packet " )
+ bgplsConfig.Comments()
+
+ main.Scapy1.handle.sendline( "sudo python OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py" )
+ bgplsConfig.Comments()
+ main.log.info( "Enable BGPlS plugin in ONOS" )
+ bgplsConfig.Comments()
+
+ main.step( "UnInstall onos-app-bgp" )
+ installResults = main.ONOScli1.deactivateApp( app[ 0 ] )
+ utilities.assert_equals( expect=main.TRUE, actual=installResults,
+ onpass="Uninstall onos-app-bgp successful",
+ onfail="Uninstall onos-app-bgp failed" )
+
+ installResults = main.ONOScli1.activateApp( app[ 0 ])
+ main.step( "Install onos-app-bgp" )
+ utilities.assert_equals( expect=main.TRUE, actual=installResults,
+ onpass="Install onos-app-bgp successful",
+ onfail="Install onos-app-bgp failed" )
+ bgplsConfig.Comments()
+ main.log.info( "Checking whether the links is deleted" )
+ bgplsConfig.Comments()
+ time.sleep( 120 ) # Time taken to discovery the links
+ response = main.ONOScli1.links()
+ linksResp = json.loads( response )
+ check_link = bgplsConfig.checkLinks( linksResp )
+ if check_link == False:
+ reply_Check_Link = main.TRUE
+ utilities.assert_equals( expect= main.TRUE,
+ actual=reply_Check_Link ,
+ onpass="Link is Deleted Successfully.",
+ onfail="Link is Deletion Failed." )
+ bgplsConfig.Comments()
+ main.log.info( "Kill Scapy process" )
+ bgplsConfig.Comments()
+ main.Scapy1.handle.sendline( "\x03" )
+ time.sleep( 90 )
+
+ def CASE6( self, main ):
+ """
Uninstalling the app
"""
import os,sys
@@ -542,7 +553,7 @@
bgplsConfig.ipValue(ipList,scapy_ip)
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
scapy_ip,
- cellAppString, ipList , onosUser="karaf" )
+ cellAppString, ipList )
for i in range( 1, main.numCtrls + 1 ):
try:
@@ -574,5 +585,9 @@
onpass="Uninstall onos-app-bgp successful",
onfail="Uninstall onos-app-bgp failed" )
-
-
+ main.log.info( "Check for Errors or Exception End of the Script" )
+ errorLog = main.ONOSbench.logReport( main.nodes[0].ip_address, ["ERROR",\
+ "EXCEPT"] )
+ utilities.assert_equals( expect= 0, actual=errorLog,
+ onpass="No Exception or Error occured",
+ onfail="Exception or Error occured" )
\ No newline at end of file
diff --git a/TestON/tests/FUNC/FUNCbgpls/README b/TestON/tests/FUNC/FUNCbgpls/README
index 2ecb554..8974506 100755
--- a/TestON/tests/FUNC/FUNCbgpls/README
+++ b/TestON/tests/FUNC/FUNCbgpls/README
@@ -28,7 +28,7 @@
1] We use Scapy tool, to send the BGPLS packet to ONOS.
2] The packets are already pre-captured.
3] ONOS reads those packet and displays the topology.
-4] We query the devices information in ONOS to check the devices/links are learn
+4] We query the devices information in ONOS to check the devices/links are learned
Steps :
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/Topo_pkts.pcap b/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/Topo_pkts.pcap
deleted file mode 100755
index 2021f22..0000000
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/Topo_pkts.pcap
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap b/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap
new file mode 100644
index 0000000..8e3db7d
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap
Binary files differ
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
index 8a83748..5661cb8 100755
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
@@ -78,3 +78,47 @@
self.app_bgpflow = 'org.onosproject.bgpflow'
self.list1 = [self.app_bgp,self.app_bgpflow]
return self.list1
+
+ def checkLinks(self,linksResp):
+ #Declaring the links values
+ links = {'link1_src' : "1650.5555.0055", 'link1_dst' : "1660.6666.0066",
+ 'link2_src' : "1630.3333.0033", 'link2_dst' : "1620.2222.0022",
+ 'link3_src' : "1660.6666.0066", 'link3_dst' : "1650.5555.0055",
+ 'link4_src' : "1630.3333.0033", 'link4_dst' : "1650.5555.0055",
+ 'link5_src' : "1640.4444.0044", 'link5_dst' : "1610.1111.0011",
+ 'link6_src' : "1650.5555.0055", 'link4_dst' : "1630.3333.0033",
+ 'link7_src' : "1620.2222.0022", 'link4_dst' : "1630.3333.0033",
+ 'link8_src' : "1620.2222.0022", 'link4_dst' : "1610.1111.0011",
+ 'link9_src' : "1630.3333.0033", 'link4_dst' : "1640.4444.0044",
+ 'link10_src' : "1650.5555.0055", 'link4_dst' : "1640.4444.0044",
+ 'link11_src' : "1610.1111.0011", 'link4_dst' : "1640.4444.0044",
+ 'link12_src' : "1640.4444.0044", 'link4_dst' : "1620.2222.0022",
+ 'link13_src' : "1660.6666.0066", 'link4_dst' : "1630.3333.0033",
+ 'link14_src' : "1640.4444.0044", 'link4_dst' : "1660.6666.0066",
+ 'link15_src' : "1640.4444.0044", 'link4_dst' : "1630.3333.0033",
+ 'link16_src' : "1610.1111.0011", 'link4_dst' : "1630.3333.0033",
+ 'link17_src' : "1630.3333.0033", 'link4_dst' : "1610.1111.0011",
+ 'link18_src' : "1610.1111.0011", 'link4_dst' : "1620.2222.0022",
+ 'link19_src' : "1620.2222.0022", 'link4_dst' : "1640.4444.0044",
+ 'link20_src' : "1630.3333.0033", 'link4_dst' : "1660.6666.0066",
+ 'link21_src' : "1640.4444.0044", 'link4_dst' : "1650.5555.0055",
+ 'link22_src' : "1660.6666.0066", 'link4_dst' : "1640.4444.0044"
+ }
+
+ #Comparing the Links
+ for x in xrange(22):
+ link_src_info = linksResp[x]['src']['device']
+ link_dst_info = linksResp[x]['dst']['device']
+ link_src_split = link_src_info.split("=")
+ link_src = link_src_split[4]
+ link_dst_split = link_dst_info.split("=")
+ link_dst = link_dst_split[4]
+ y = x+1
+ link_src_ref = links['link'+str(y)+'_src']
+ link_dst_ref = links['link'+str(y)+'_dst']
+ if (link_src == link_src_ref) and (link_dst == (link_dst_ref) and \
+ linksResp[x]['type'] == 'DIRECT' and linksResp[x]['state'] == \
+ 'ACTIVE'):
+ return True
+ else:
+ return False
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
index abd1cfc..259f846 100755
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
@@ -18,36 +18,35 @@
host = peerIp # Get local machine name
port = 179 # Reserve a port for your service.
s.bind((host, port)) # Bind to the port
-pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
-pkts[69][BGPOpen].bgp_id = peerIp
+pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap")
+time.sleep(15)
+pkts[759][BGPOpen].bgp_id = peerIp
s.listen(5) # Now wait for client connection.
print("starting Connecting to ONOS peer")
c, addr = s.accept() # Establish connection with client.
print 'Got connection from ONOS :', addr
-c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
+c.send(str(pkts[759][BGPHeader])) # OPEN MESSAGE
c.recv(4096)
-c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
+c.send(str(pkts[765][BGPHeader]))# KEEPALIVE MESSAGE
c.recv(4096)
-c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
-c.send(str(pkts[74][BGPHeader]))
-c.send(str(pkts[71][BGPHeader]))
+c.send(str(pkts[768][BGPHeader])) # UPDATE MESSAGES
+c.send(str(pkts[771][BGPHeader]))
+c.send(str(pkts[773][BGPHeader]))
+c.send(str(pkts[775][BGPHeader]))
+c.send(str(pkts[778][BGPHeader]))
+c.send(str(pkts[765][BGPHeader]))
-time.sleep(10) # Waiting for 120 seconds for update message.
-
-c.send(str(pkts[298][BGPHeader]))
-c.send(str(pkts[860][BGPHeader])) # UPDATE MESSAGES with new node
-c.send(str(pkts[865][BGPHeader]))
-print ("New Node update msg sent")
-
-time.sleep(5)
-c.send(str(pkts[890][BGPHeader]))
+time.sleep(15)
+c.send(str(pkts[1168][BGPHeader]))
+c.send(str(pkts[1250][BGPHeader]))
+c.send(str(pkts[1354][BGPHeader]))
print ("Node Delete msg sent")
while True:
c.recv(4096)
- c.send(str(pkts[71][BGPHeader]))
+ c.send(str(pkts[765][BGPHeader]))
# c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py
new file mode 100755
index 0000000..03a5653
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py
@@ -0,0 +1,45 @@
+#!/usr/bin/python # This is server.py file
+from scapy.all import *
+import socket # Import socket module
+import time # Import Time module
+import sys
+import os
+
+path = os.getcwd()
+sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+from Nbdata import BgpLs
+
+obj = BgpLs()
+returnlist = obj.Constants()
+peerIp = returnlist[0][0]
+
+load_contrib('bgp')
+s = socket.socket() # Create a socket object
+host = peerIp # Get local machine name
+port = 179 # Reserve a port for your service.
+s.bind((host, port)) # Bind to the port
+pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap")
+time.sleep(15)
+pkts[759][BGPOpen].bgp_id = peerIp
+
+s.listen(5) # Now wait for client connection.
+
+print("starting Connecting to ONOS peer")
+c, addr = s.accept() # Establish connection with client.
+print 'Got connection from ONOS :', addr
+c.send(str(pkts[759][BGPHeader])) # OPEN MESSAGE
+c.recv(4096)
+c.send(str(pkts[765][BGPHeader]))# KEEPALIVE MESSAGE
+c.recv(4096)
+c.send(str(pkts[768][BGPHeader])) # UPDATE MESSAGES
+c.send(str(pkts[771][BGPHeader]))
+c.send(str(pkts[773][BGPHeader]))
+c.send(str(pkts[775][BGPHeader]))
+c.send(str(pkts[778][BGPHeader]))
+c.send(str(pkts[765][BGPHeader]))
+
+while True:
+ c.recv(4096)
+ c.send(str(pkts[765][BGPHeader]))
+
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.params b/TestON/tests/FUNC/FUNCflow/FUNCflow.params
index aa7c358..c0ce79f 100755
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.params
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.params
@@ -1,21 +1,27 @@
<PARAMS>
# CASE - Descritpion
- # 1,2,10,1000,1100,2000,1200,2000,100
+ # Openflow 1.0: 1,2,10,1000,3000,1100,3000,1400,3000,1600,3000,1700,100
+ # Openflow 1.3: 1,2,10,1000,3000,1100,3000,1200,3000,1300,3000,1400,3000,1500,3000,1600,3000,1700,3000,1800,3000,1900,3000,2000,100
# 1 - Variable initialization and optional pull and build ONOS package
# 2 - install ONOS
# 10 - Start mininet and verify topology
# 66 - Testing Scapy
# 100 - Check logs for Errors and Warnings
# 1000 - Add flows with MAC selector
- # 1100 - Add flows with IPv4 selector
- # 1200 - Add flows with VLAN selector
+ # 1100 - Add flows with VLAN selector
+ # 1200 - Add flows with ARP selector
# 1300 - Add flows with MPLS selector
- # 1400 - Add flows with TCP selectors
- # 1500 - Add flows with UDP selectors
- # 2000 - Delete flows
+ # 1400 - Add flows with IPv4 selector
+ # 1500 - Add flows with IPv6 selector
+ # 1600 - Add flows with UDP selector
+ # 1700 - Add flows with TCP selector
+ # 1800 - Add flows with SCTP selector
+ # 1900 - Add flows with ICMPv4 selector
+ # 2000 - Add flows with ICMPv6 selector
+ # 3000 - Delete flows
- <testcases>1,2,10,1000,2000,1100,2000,1200,2000,1300,2000,1400,2000,1500,100</testcases>
+ <testcases>1,2,10,1000,3000,1100,3000,1200,3000,1300,3000,1400,3000,1500,3000,1600,3000,1700,3000,1800,3000,1900,3000,2000,100</testcases>
<SCALE>
<max>1</max>
@@ -49,9 +55,16 @@
<mpls>22</mpls>
<tcpDst>40001</tcpDst>
<udpDst>40051</udpDst>
+ <sctpDst>40001</sctpDst>
<ip4Type>2048</ip4Type>
+ <ip6Type>34525</ip6Type>
+ <arpType>2054</arpType>
<tcpProto>6</tcpProto>
<udpProto>17</udpProto>
+ <sctpProto>132</sctpProto>
+ <icmpProto>1</icmpProto>
+ <icmp6Proto>58</icmp6Proto>
+ <sctpProto>132</sctpProto>
<vlanType>33024</vlanType>
<mplsType>34887</mplsType>
<swDPID>of:0000000000000001</swDPID>
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index eeed451..80bd618 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -4,7 +4,6 @@
self.default = ''
def CASE1( self, main ):
- import time
import os
import imp
@@ -20,7 +19,6 @@
main.case( "Constructing test variables and building ONOS package" )
main.step( "Constructing test variables" )
- stepResult = main.FALSE
# Test variables
main.testOnDirectory = os.path.dirname( os.getcwd ( ) )
@@ -39,15 +37,15 @@
main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] )
main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] )
main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] )
- main.debug = main.params['DEBUG']
+ main.debug = main.params[ 'DEBUG' ]
main.swDPID = main.params[ 'TEST' ][ 'swDPID' ]
- main.cellData = {} # for creating cell file
- main.CLIs = []
- main.ONOSip = []
+ main.cellData = { } # for creating cell file
+ main.CLIs = [ ]
+ main.ONOSip = [ ]
main.debug = True if "on" in main.debug else False
- main.ONOSip = main.ONOSbench.getOnosIps()
+ main.ONOSip = main.ONOSbench.getOnosIps( )
# Assigning ONOS cli handles to a list
for i in range( 1, main.maxNodes + 1 ):
@@ -66,10 +64,16 @@
copyResult = main.ONOSbench.scp( main.Mininet1,
- main.dependencyPath+main.topology,
- main.Mininet1.home+'/custom/',
+ main.dependencyPath + main.topology,
+ main.Mininet1.home + '/custom/',
direction="to" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=copyResult,
+ onpass="Successfully copy " + "test variables ",
+ onfail="Failed to copy test variables" )
+
+
if main.CLIs:
stepResult = main.TRUE
else:
@@ -78,8 +82,7 @@
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
- onpass="Successfully construct " +
- "test variables ",
+ onpass="Successfully construct " + "test variables ",
onfail="Failed to construct test variables" )
if gitPull == 'True':
@@ -88,10 +91,8 @@
stepResult = onosBuildResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
- onpass="Successfully compiled " +
- "latest ONOS",
- onfail="Failed to compile " +
- "latest ONOS" )
+ onpass="Successfully compiled " + "latest ONOS",
+ onfail="Failed to compile " + "latest ONOS" )
else:
main.log.warn( "Did not pull new code so skipping mvn " +
"clean install" )
@@ -108,6 +109,7 @@
- Install ONOS cluster
- Connect to cli
"""
+ import time
main.numCtrls = int( main.maxNodes )
@@ -123,9 +125,9 @@
main.log.info( "NODE COUNT = " + str( main.numCtrls ) )
- tempOnosIp = []
+ tempOnosIp = [ ]
for i in range( main.numCtrls ):
- tempOnosIp.append( main.ONOSip[i] )
+ tempOnosIp.append( main.ONOSip[ i ] )
main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
"temp",
@@ -135,16 +137,15 @@
main.step( "Apply cell to environment" )
cellResult = main.ONOSbench.setCell( "temp" )
- verifyResult = main.ONOSbench.verifyCell()
+ verifyResult = main.ONOSbench.verifyCell( )
stepResult = cellResult and verifyResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
- onpass="Successfully applied cell to " + \
- "environment",
+ onpass="Successfully applied cell to " + "environment",
onfail="Failed to apply cell to environment " )
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage( )
stepResult = packageResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -156,7 +157,7 @@
onosUninstallResult = main.TRUE
for ip in main.ONOSip:
onosUninstallResult = onosUninstallResult and \
- main.ONOSbench.onosUninstall( nodeIp=ip )
+ main.ONOSbench.onosUninstall( nodeIp = ip )
stepResult = onosUninstallResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -167,7 +168,7 @@
onosInstallResult = main.TRUE
for i in range( main.numCtrls ):
onosInstallResult = onosInstallResult and \
- main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+ main.ONOSbench.onosInstall( node = main.ONOSip[ i ] )
stepResult = onosInstallResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -222,7 +223,7 @@
main.step( "Setup Mininet Topology" )
topology = main.Mininet1.home + '/custom/' + main.topology
- stepResult = main.Mininet1.startNet( topoFile=topology )
+ stepResult = main.Mininet1.startNet( topoFile = topology )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -241,18 +242,14 @@
main.step( "Comparing MN topology to ONOS topology" )
main.log.info( "Gathering topology information" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
devices = main.topo.getAllDevices( main )
hosts = main.topo.getAllHosts( main )
ports = main.topo.getAllPorts( main )
links = main.topo.getAllLinks( main )
- clusters = main.topo.getAllClusters( main )
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
+ mnSwitches = main.Mininet1.getSwitches( )
+ mnLinks = main.Mininet1.getLinks( )
+ mnHosts = main.Mininet1.getHosts( )
for controller in range( main.numCtrls ):
controllerStr = str( controller + 1 )
@@ -307,32 +304,32 @@
main.step( "Creating Host1 component" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
main.log.debug( host.name )
main.log.debug( host.hostIp )
main.log.debug( host.hostMac )
main.step( "Sending/Receiving Test packet - Filter doesn't match" )
main.log.info( "Starting Filter..." )
- main.h2.startFilter()
+ main.h2.startFilter( )
main.log.info( "Building Ether frame..." )
main.h1.buildEther( dst=main.h2.hostMac )
main.log.info( "Sending Packet..." )
main.h1.sendPacket( )
main.log.info( "Checking Filter..." )
- finished = main.h2.checkFilter()
+ finished = main.h2.checkFilter( )
main.log.debug( finished )
i = ""
if finished:
- a = main.h2.readPackets()
- for i in a.splitlines():
+ a = main.h2.readPackets( )
+ for i in a.splitlines( ):
main.log.info( i )
else:
- kill = main.h2.killFilter()
+ kill = main.h2.killFilter( )
main.log.debug( kill )
main.h2.handle.sendline( "" )
main.h2.handle.expect( main.h2.scapyPrompt )
@@ -343,18 +340,18 @@
onfail="Fail" )
main.step( "Sending/Receiving Test packet - Filter matches" )
- main.h2.startFilter()
+ main.h2.startFilter( )
main.h1.buildEther( dst=main.h2.hostMac )
main.h1.buildIP( dst=main.h2.hostIp )
main.h1.sendPacket( )
- finished = main.h2.checkFilter()
+ finished = main.h2.checkFilter( )
i = ""
if finished:
- a = main.h2.readPackets()
- for i in a.splitlines():
+ a = main.h2.readPackets( )
+ for i in a.splitlines( ):
main.log.info( i )
else:
- kill = main.h2.killFilter()
+ kill = main.h2.killFilter( )
main.log.debug( kill )
main.h2.handle.sendline( "" )
main.h2.handle.expect( main.h2.scapyPrompt )
@@ -368,9 +365,9 @@
main.step( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
def CASE1000( self, main ):
'''
@@ -389,12 +386,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
- stepResult = main.TRUE
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
# Add a flow that connects host1 on port1 to host2 on port2
# send output on port2
@@ -424,21 +420,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -449,10 +445,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
@@ -472,29 +468,30 @@
# NOTE: I believe it doesn't matter which host name it is,
# as long as the src and dst are both specified
main.log.info( "Starting filter on host2" )
- main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac)
+ main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac )
main.log.info( "Sending packet to host2" )
main.h1.sendPacket()
main.log.info( "Checking filter for our packet" )
- stepResult = main.h2.checkFilter()
+ stepResult = main.h2.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h2.readPackets() )
- else: main.h2.killFilter()
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else:
+ main.h2.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully sent a packet",
onfail="Failed to send a packet" )
- def CASE1100( self, main ):
+ def CASE1400( self, main ):
'''
Add flows with IPv4 selectors and verify the flows
'''
@@ -503,7 +500,7 @@
main.case( "Verify flow IP selectors are correctly compiled" )
main.caseExplanation = "Install two flows with only IP selectors " +\
- "specified, then verify flows are added in ONOS, finally "+\
+ "specified, then verify flows are added in ONOS, finally " +\
"send a packet that only specifies the IP src and dst."
main.step( "Add flows with IPv4 addresses as the only selectors" )
@@ -511,12 +508,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
- stepResult = main.TRUE
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
# Add a flow that connects host1 on port1 to host2 on port2
# send output on port2
@@ -524,16 +520,16 @@
egress = 2
ingress = 1
# IPv4 etherType = 0x800
- IPv4=2048
+ ethType = main.params[ 'TEST' ][ 'ip4Type' ]
# Add flows that connects host1 to host2
main.log.info( "Add flow with port ingress 1 to port egress 2" )
stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
egressPort=egress,
ingressPort=ingress,
- ethType=IPv4,
- ipSrc=("IPV4_SRC", main.h1.hostIp+"/32"),
- ipDst=("IPV4_DST", main.h2.hostIp+"/32"),
+ ethType=ethType,
+ ipSrc=( "IPV4_SRC", main.h1.hostIp+"/32" ),
+ ipDst=( "IPV4_DST", main.h2.hostIp+"/32" ),
debug=main.debug )
utilities.assert_equals( expect=main.TRUE,
@@ -548,21 +544,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -573,10 +569,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
@@ -594,29 +590,151 @@
main.log.info( "Starting filter on host2" )
# Defaults to ip
- main.h2.startFilter()
+ main.h2.startFilter( )
main.log.info( "Sending packet to host2" )
- main.h1.sendPacket()
+ main.h1.sendPacket( )
main.log.info( "Checking filter for our packet" )
- stepResult = main.h2.checkFilter()
+ stepResult = main.h2.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h2.readPackets() )
- else: main.h2.killFilter()
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else: main.h2.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully sent a packet",
onfail="Failed to send a packet" )
- def CASE1200( self, main ):
+ def CASE1500 (self, main ):
+ """
+ Add flow with IPv6 selector and verify the flow
+ """
+ import json
+ import time
+ main.case( "Verify IPv6 selector is correctly compiled" )
+ main.caseExplanation = "Install two flows with only IP selectors " + \
+ "specified, then verify flows are added in ONOS, finally " + \
+ "send a packet that only specifies the IP src and dst."
+
+ main.step( "Add flows with IPv6 addresses as the only selectors" )
+
+ main.log.info( "Creating host components" )
+ main.Scapy.createHostComponent( "h5" )
+ main.Scapy.createHostComponent( "h6" )
+ hosts = [ main.h5, main.h6 ]
+
+ for host in hosts:
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( IPv6=True )
+
+ # Add a flow that connects host1 on port1 to host2 on port2
+ # send output on port2
+ # recieve input on port1
+ egress = 6
+ ingress = 5
+ # IPv6 etherType = 0x86DD
+ ethType = main.params[ 'TEST' ][ 'ip6Type' ]
+
+ # Add flows that connects host1 to host2
+ main.log.info( "Add flow with port ingress 5 to port egress 6" )
+ stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+ egressPort=egress,
+ ingressPort=ingress,
+ ethType=ethType,
+ ipSrc=( "IPV6_SRC", main.h5.hostIp + "/128" ),
+ ipDst=( "IPV6_DST", main.h6.hostIp + "/128" ),
+ debug=main.debug )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully added flows",
+ onfail="Failed add flows" )
+
+ # Giving ONOS time to add the flow
+ time.sleep( main.addFlowSleep )
+
+ main.step( "Check flow is in the ADDED state" )
+
+ main.log.info( "Get the flows from ONOS" )
+ try:
+ flows = json.loads( main.ONOSrest.flows( ) )
+
+ stepResult = main.TRUE
+ for f in flows:
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
+ stepResult = main.FALSE
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+ except TypeError:
+ main.log.error( "No Flows found by the REST API" )
+ stepResult = main.FALSE
+ except ValueError:
+ main.log.error( "Problem getting Flows state from REST API. Exiting test" )
+ main.cleanup( )
+ main.exit( )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in the ADDED state",
+ onfail="All flows are NOT in the ADDED state" )
+
+ main.step( "Check flows are in Mininet's flow table" )
+
+ # get the flow IDs that were added through rest
+ main.log.info( "Getting the flow IDs from ONOS" )
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+ # convert the flowIDs to ints then hex and finally back to strings
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+ stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in mininet",
+ onfail="All flows are NOT in mininet" )
+
+ main.step( "Send a packet to verify the flow is correct" )
+
+ main.log.info( "Constructing packet" )
+ # No need for the MAC src dst
+ main.h5.buildEther( dst=main.h6.hostMac )
+ main.h5.buildIPv6( src=main.h5.hostIp, dst=main.h6.hostIp )
+
+ main.log.info( "Starting filter on host6" )
+ # Defaults to ip
+ main.h6.startFilter( pktFilter="ip6" )
+ main.log.info( "Sending packet to host6" )
+ main.h5.sendPacket( )
+
+ main.log.info( "Checking filter for our packet" )
+ stepResult = main.h6.checkFilter( )
+ if stepResult:
+ main.log.info( "Packet: %s" % main.h6.readPackets( ) )
+ else:
+ main.h6.killFilter( )
+
+ main.log.info( "Clean up host components" )
+ for host in hosts:
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h5" )
+ main.Mininet1.removeHostComponent( "h6" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully sent a packet",
+ onfail="Failed to send a packet" )
+
+
+ def CASE1100( self, main ):
'''
Add flow with VLAN selector and verify the flow
'''
@@ -632,12 +750,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h3" )
main.Scapy.createHostComponent( "h4" )
- hosts = [main.h3, main.h4]
- stepResult = main.TRUE
+ hosts = [ main.h3, main.h4 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
main.step( "Add a flow with the VLAN tag as the only selector" )
@@ -648,7 +765,7 @@
egress = 4
ingress = 3
# VLAN ethType = 0x8100
- ethType = 33024
+ ethType = main.params[ 'TEST' ][ 'vlanType' ]
# Add only one flow because we don't need a response
main.log.info( "Add flow with port ingress 1 to port egress 2" )
@@ -672,21 +789,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -697,10 +814,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
@@ -712,29 +829,29 @@
main.step( "Send a packet to verify the flow are correct" )
# The receiving interface
- recIface = "{}-eth0.{}".format(main.h4.name, vlan)
+ recIface = "{}-eth0.{}".format( main.h4.name, vlan )
main.log.info( "Starting filter on host2" )
# Filter is setup to catch any packet on the vlan interface with the correct vlan tag
- main.h4.startFilter( ifaceName=recIface, pktFilter="" )
+ main.h4.startFilter( ifaceName=recIface, pktFilter = "" )
# Broadcast the packet on the vlan interface. We only care if the flow forwards
# the packet with the correct vlan tag, not if the mac addr is correct
- sendIface = "{}-eth0.{}".format(main.h3.name, vlan)
+ sendIface = "{}-eth0.{}".format( main.h3.name, vlan )
main.log.info( "Broadcasting the packet with a vlan tag" )
main.h3.sendPacket( iface=sendIface,
- packet="Ether()/Dot1Q(vlan={})".format(vlan) )
+ packet="Ether()/Dot1Q(vlan={})".format( vlan ) )
main.log.info( "Checking filter for our packet" )
- stepResult = main.h4.checkFilter()
+ stepResult = main.h4.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h4.readPackets() )
- else: main.h4.killFilter()
+ main.log.info( "Packet: %s" % main.h4.readPackets( ) )
+ else: main.h4.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h3")
- main.Mininet1.removeHostComponent("h4")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h3" )
+ main.Mininet1.removeHostComponent( "h4" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -750,7 +867,7 @@
main.case( "Verify the MPLS selector is correctly compiled on the flow." )
main.caseExplanation = "Install one flow with an MPLS selector, " +\
- "verify the flow is added in ONOS, and finally "+\
+ "verify the flow is added in ONOS, and finally " +\
"send a packet via scapy that has a MPLS label."
main.step( "Add a flow with a MPLS selector" )
@@ -758,12 +875,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
- stepResult = main.TRUE
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
+ host.startHostCli( )
host.startScapy( main.dependencyPath )
- host.updateSelf()
+ host.updateSelf( )
# ports
egress = 2
@@ -794,21 +910,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -819,10 +935,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=True )
@@ -838,26 +954,26 @@
main.log.info( "Constructing packet" )
main.log.info( "Sending packet to host2" )
- main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format(mplsLabel) )
+ main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format( mplsLabel ) )
main.log.info( "Checking filter for our packet" )
- stepResult = main.h2.checkFilter()
+ stepResult = main.h2.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h2.readPackets() )
- else: main.h2.killFilter()
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else: main.h2.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully sent a packet",
onfail="Failed to send a packet" )
- def CASE1400( self, main ):
+ def CASE1700( self, main ):
'''
Add flows with a TCP selector and verify the flow
'''
@@ -866,7 +982,7 @@
main.case( "Verify the TCP selector is correctly compiled on the flow" )
main.caseExplanation = "Install a flow with only the TCP selector " +\
- "specified, verify the flow is added in ONOS, and finally "+\
+ "specified, verify the flow is added in ONOS, and finally " +\
"send a TCP packet to verify the TCP selector is compiled correctly."
main.step( "Add a flow with a TCP selector" )
@@ -874,12 +990,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
- stepResult = main.TRUE
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
# Add a flow that connects host1 on port1 to host2 on port2
egress = 2
@@ -912,21 +1027,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -937,10 +1052,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
@@ -962,26 +1077,26 @@
main.h2.startFilter( pktFilter="tcp" )
main.log.info( "Sending packet to host2" )
- main.h1.sendPacket()
+ main.h1.sendPacket( )
main.log.info( "Checking filter for our packet" )
- stepResult = main.h2.checkFilter()
+ stepResult = main.h2.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h2.readPackets() )
- else: main.h2.killFilter()
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else: main.h2.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully sent a packet",
onfail="Failed to send a packet" )
- def CASE1500( self, main ):
+ def CASE1600( self, main ):
'''
Add flows with a UDP selector and verify the flow
'''
@@ -990,7 +1105,7 @@
main.case( "Verify the UDP selector is correctly compiled on the flow" )
main.caseExplanation = "Install a flow with only the UDP selector " +\
- "specified, verify the flow is added in ONOS, and finally "+\
+ "specified, verify the flow is added in ONOS, and finally " +\
"send a UDP packet to verify the UDP selector is compiled correctly."
main.step( "Add a flow with a UDP selector" )
@@ -998,12 +1113,11 @@
main.log.info( "Creating host components" )
main.Scapy.createHostComponent( "h1" )
main.Scapy.createHostComponent( "h2" )
- hosts = [main.h1, main.h2]
- stepResult = main.TRUE
+ hosts = [ main.h1, main.h2 ]
for host in hosts:
- host.startHostCli()
- host.startScapy()
- host.updateSelf()
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
# Add a flow that connects host1 on port1 to host2 on port2
egress = 2
@@ -1036,21 +1150,21 @@
main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if "ADDED" not in f.get("state"):
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
stepResult = main.FALSE
- main.log.error( "Flow: %s in state: %s" % (f.get("id"), f.get("state")) )
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -1061,10 +1175,10 @@
# get the flow IDs that were added through rest
main.log.info( "Getting the flow IDs from ONOS" )
- flowIds = [ f.get("id") for f in flows if "rest" in f.get("appId") ]
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
# convert the flowIDs to ints then hex and finally back to strings
- flowIds = [str(hex(int(x))) for x in flowIds]
- main.log.info( "ONOS flow IDs: {}".format(flowIds) )
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
@@ -1086,48 +1200,290 @@
main.h2.startFilter( pktFilter="udp" )
main.log.info( "Sending packet to host2" )
- main.h1.sendPacket()
+ main.h1.sendPacket( )
main.log.info( "Checking filter for our packet" )
- stepResult = main.h2.checkFilter()
+ stepResult = main.h2.checkFilter( )
if stepResult:
- main.log.info( "Packet: %s" % main.h2.readPackets() )
- else: main.h2.killFilter()
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else: main.h2.killFilter( )
main.log.info( "Clean up host components" )
for host in hosts:
- host.stopScapy()
- main.Mininet1.removeHostComponent("h1")
- main.Mininet1.removeHostComponent("h2")
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully sent a packet",
onfail="Failed to send a packet" )
-
- def CASE2000( self, main ):
+ def CASE1900( self, main ):
+ '''
+ Add flows with a ICMPv4 selector and verify the flow
+ '''
import json
+ import time
- main.case( "Delete flows that were added through rest" )
- main.step("Deleting flows")
+ main.case( "Verify the ICMPv4 selector is correctly compiled on the flow" )
+ main.caseExplanation = "Install a flow with only the ICMPv4 selector " +\
+ "specified, verify the flow is added in ONOS, and finally " +\
+ "send a IMCPv4 packet to verify the ICMPv4 selector is compiled correctly."
- main.log.info( "Getting flows" )
+ main.step( "Add a flow with a ICMPv4 selector" )
+
+ main.log.info( "Creating host components" )
+ main.Scapy.createHostComponent( "h1" )
+ main.Scapy.createHostComponent( "h2" )
+ hosts = [ main.h1, main.h2 ]
+ for host in hosts:
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
+
+ # Add a flow that connects host1 on port1 to host2 on port2
+ egress = 2
+ ingress = 1
+ # IPv4 etherType
+ ethType = main.params[ 'TEST' ][ 'ip4Type' ]
+ # IP protocol
+ ipProto = main.params[ 'TEST' ][ 'icmpProto' ]
+
+ main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
+ stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+ egressPort=egress,
+ ingressPort=ingress,
+ ethType=ethType,
+ ipProto=ipProto,
+ debug=main.debug )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully added flows",
+ onfail="Failed add flows" )
+
+ # Giving ONOS time to add the flow
+ time.sleep( main.addFlowSleep )
+
+ main.step( "Check flow is in the ADDED state" )
+
+ main.log.info( "Get the flows from ONOS" )
try:
- flows = json.loads( main.ONOSrest.flows() )
+ flows = json.loads( main.ONOSrest.flows( ) )
stepResult = main.TRUE
for f in flows:
- if "rest" in f.get("appId"):
- if main.debug: main.log.debug( "Flow to be deleted:\n{}".format( main.ONOSrest.pprint(f) ) )
- stepResult = stepResult and main.ONOSrest.removeFlow( f.get("deviceId"), f.get("id") )
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
+ stepResult = main.FALSE
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
except TypeError:
main.log.error( "No Flows found by the REST API" )
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanup( )
+ main.exit( )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in the ADDED state",
+ onfail="All flows are NOT in the ADDED state" )
+
+ main.step( "Check flows are in Mininet's flow table" )
+
+ # get the flow IDs that were added through rest
+ main.log.info( "Getting the flow IDs from ONOS" )
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+ # convert the flowIDs to ints then hex and finally back to strings
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+ stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in mininet",
+ onfail="All flows are NOT in mininet" )
+
+ main.step( "Send a packet to verify the flow is correct" )
+
+ main.log.info( "Constructing packet" )
+ # No need for the MAC src dst
+ main.h1.buildEther( dst=main.h2.hostMac )
+ main.h1.buildIP( dst=main.h2.hostIp )
+ main.h1.buildICMP( )
+
+ main.log.info( "Starting filter on host2" )
+ # Defaults to ip
+ main.h2.startFilter( pktFilter="icmp" )
+
+ main.log.info( "Sending packet to host2" )
+ main.h1.sendPacket( )
+
+ main.log.info( "Checking filter for our packet" )
+ stepResult = main.h2.checkFilter( )
+ if stepResult:
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else: main.h2.killFilter( )
+
+ main.log.info( "Clean up host components" )
+ for host in hosts:
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully sent a packet",
+ onfail="Failed to send a packet" )
+
+ def CASE2000( self, main ):
+ '''
+ Add flows with a ICMPv6 selector and verify the flow
+ '''
+ import json
+ import time
+
+ main.case( "Verify the ICMPv6 selector is correctly compiled on the flow" )
+ main.caseExplanation = "Install a flow with only the ICMPv6 selector " +\
+ "specified, verify the flow is added in ONOS, and finally " +\
+ "send a IMCPv6 packet to verify the ICMPv6 selector is compiled correctly."
+
+ main.step( "Add a flow with a ICMPv6 selector" )
+
+ main.log.info( "Creating host components" )
+ main.Scapy.createHostComponent( "h5" )
+ main.Scapy.createHostComponent( "h6" )
+ hosts =[ main.h5, main.h6 ]
+ for host in hosts:
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( IPv6=True )
+
+ # Add a flow that connects host1 on port1 to host2 on port2
+ egress =6
+ ingress =5
+ # IPv6 etherType
+ ethType = main.params[ 'TEST' ][ 'ip6Type' ]
+ # IP protocol
+ ipProto = main.params[ 'TEST' ][ 'icmp6Proto' ]
+
+ main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
+ stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+ egressPort=egress,
+ ingressPort=ingress,
+ ethType=ethType,
+ ipProto=ipProto,
+ debug=main.debug )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully added flows",
+ onfail="Failed add flows" )
+
+ # Giving ONOS time to add the flow
+ time.sleep( main.addFlowSleep )
+
+ main.step( "Check flow is in the ADDED state" )
+
+ main.log.info( "Get the flows from ONOS" )
+ try:
+ flows = json.loads( main.ONOSrest.flows( ) )
+
+ stepResult = main.TRUE
+ for f in flows:
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
+ stepResult = main.FALSE
+ main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+ except TypeError:
+ main.log.error( "No Flows found by the REST API" )
+ stepResult = main.FALSE
+ except ValueError:
+ main.log.error( "Problem getting Flows state from REST API. Exiting test" )
+ main.cleanup( )
+ main.exit( )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in the ADDED state",
+ onfail="All flows are NOT in the ADDED state" )
+
+ main.step( "Check flows are in Mininet's flow table" )
+
+ # get the flow IDs that were added through rest
+ main.log.info( "Getting the flow IDs from ONOS" )
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+ # convert the flowIDs to ints then hex and finally back to strings
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+ stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in mininet",
+ onfail="All flows are NOT in mininet" )
+
+ main.step( "Send a packet to verify the flow is correct" )
+
+ main.log.info( "Constructing packet" )
+ # No need for the MAC src dst
+ main.h5.buildEther( dst=main.h6.hostMac )
+ main.h5.buildIPv6( dst=main.h6.hostIp )
+ main.h5.buildICMP( ipVersion=6 )
+
+ main.log.info( "Starting filter on host2" )
+ # Defaults to ip
+ main.h6.startFilter( pktFilter="icmp6" )
+
+ main.log.info( "Sending packet to host2" )
+ main.h5.sendPacket( )
+
+ main.log.info( "Checking filter for our packet" )
+ stepResult = main.h6.checkFilter( )
+ if stepResult:
+ main.log.info( "Packet: %s" % main.h6.readPackets( ) )
+ else: main.h6.killFilter( )
+
+ main.log.info( "Clean up host components" )
+ for host in hosts:
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h5" )
+ main.Mininet1.removeHostComponent( "h6" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully sent a packet",
+ onfail="Failed to send a packet" )
+
+ def CASE3000( self, main ):
+ '''
+ Delete flow
+ '''
+ import json
+
+ main.case( "Delete flows that were added through rest" )
+ main.step( "Deleting flows" )
+
+ main.log.info( "Getting flows" )
+ try:
+ flows = json.loads( main.ONOSrest.flows( ) )
+
+ stepResult = main.TRUE
+ for f in flows:
+ if "rest" in f.get( "appId" ):
+ if main.debug: main.log.debug( "Flow to be deleted:\n{}".format( main.ONOSrest.pprint( f ) ) )
+ stepResult = stepResult and main.ONOSrest.removeFlow( f.get( "deviceId" ), f.get( "id" ) )
+ except TypeError:
+ main.log.error( "No Flows found by the REST API" )
+ stepResult = main.FALSE
+ except ValueError:
+ main.log.error( "Problem getting Flows state from REST API. Exiting test" )
+ main.cleanup( )
+ main.exit( )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -1136,11 +1492,254 @@
time.sleep( main.delFlowSleep )
+
+ def CASE1200(self, main ):
+ '''
+ Add flows with a ARP selector and verify the flow
+ '''
+ import json
+ import time
+
+ main.case( "Verify flow IP selectors are correctly compiled" )
+ main.caseExplanation = "Install two flows with only IP selectors " + \
+ "specified, then verify flows are added in ONOS, finally " + \
+ "send a packet that only specifies the IP src and dst."
+
+ main.step( "Add flows with ARP addresses as the only selectors" )
+
+ main.log.info( "Creating host components" )
+ main.Scapy.createHostComponent( "h1" )
+ main.Scapy.createHostComponent( "h2" )
+ hosts = [ main.h1, main.h2 ]
+ for host in hosts:
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
+
+ # Add a flow that connects host1 on port1 to host2 on port2
+ # send output on port2
+ # recieve input on port1
+ egress = 2
+ ingress = 1
+ # ARP etherType = 0x0806
+ ethType = main.params[ 'TEST' ][ 'arpType' ]
+
+ # Add flows that connects host1 to host2
+ main.log.info( "Add flow with port ingress 1 to port egress 2" )
+ stepResult = main.ONOSrest.addFlow(deviceId=main.swDPID,
+ egressPort=egress,
+ ingressPort=ingress,
+ ethType=ethType,
+ priority=40001,
+ debug=main.debug )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully added flows",
+ onfail="Failed add flows" )
+
+ # Giving ONOS time to add the flow
+ time.sleep( main.addFlowSleep )
+
+ main.step( "Check flow is in the ADDED state" )
+
+ main.log.info( "Get the flows from ONOS" )
+ try:
+ flows = json.loads( main.ONOSrest.flows( ) )
+
+ stepResult = main.TRUE
+ for f in flows:
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
+ stepResult = main.FALSE
+ main.log.error("Flow: %s in state: %s" % ( f.get("id"), f.get( "state" ) ) )
+ except TypeError:
+ main.log.error( "No Flows found by the REST API" )
+ stepResult = main.FALSE
+ except ValueError:
+ main.log.error( "Problem getting Flows state from REST API. Exiting test" )
+ main.cleanup( )
+ main.exit( )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in the ADDED state",
+ onfail="All flows are NOT in the ADDED state" )
+
+ main.step( "Check flows are in Mininet's flow table" )
+
+ # get the flow IDs that were added through rest
+ main.log.info( "Getting the flow IDs from ONOS" )
+ flowIds = [f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+ # convert the flowIDs to ints then hex and finally back to strings
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info("ONOS flow IDs: {}".format( flowIds ) )
+
+ stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in mininet",
+ onfail="All flows are NOT in mininet" )
+
+ main.step( "Send a packet to verify the flow is correct" )
+
+ main.log.info( "Constructing packet" )
+ # No need for the MAC src dst
+ main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac )
+ main.h1.buildARP( pdst=main.h2.hostIp )
+
+ main.log.info( "Starting filter on host2" )
+ # Defaults to ip
+ main.h2.startFilter( pktFilter="arp" )
+
+ main.log.info( "Sending packet to host2" )
+ main.h1.sendPacket( )
+
+ main.log.info( "Checking filter for our packet" )
+ stepResult = main.h2.checkFilter( )
+ if stepResult:
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else:
+ main.h2.killFilter( )
+
+ main.log.info( "Clean up host components" )
+ for host in hosts:
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully sent a packet",
+ onfail="Failed to send a packet" )
+
+ def CASE1800( self, main ):
+ '''
+ Add flows with a SCTP selector and verify the flow
+ '''
+ import json
+ import time
+
+ main.case( "Verify the UDP selector is correctly compiled on the flow" )
+ main.caseExplanation = "Install a flow with only the UDP selector " + \
+ "specified, verify the flow is added in ONOS, and finally " + \
+ "send a UDP packet to verify the UDP selector is compiled correctly."
+
+ main.step( "Add a flow with a SCTP selector" )
+
+ main.log.info( "Creating host components" )
+ main.Scapy.createHostComponent( "h1" )
+ main.Scapy.createHostComponent( "h2" )
+ hosts = [ main.h1, main.h2 ]
+ for host in hosts:
+ host.startHostCli( )
+ host.startScapy( )
+ host.updateSelf( )
+
+ # Add a flow that connects host1 on port1 to host2 on port2
+ egress = 2
+ ingress = 1
+ # IPv4 etherType
+ ethType = main.params[ 'TEST' ][ 'ip4Type' ]
+ # IP protocol
+ ipProto = main.params[ 'TEST' ][ 'sctpProto' ]
+
+ main.log.info("Add a flow that connects host1 on port1 to host2 on port2")
+ stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
+ egressPort=egress,
+ ingressPort=ingress,
+ ethType=ethType,
+ ipProto=ipProto,
+ debug=main.debug )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully added flows",
+ onfail="Failed add flows" )
+
+ # Giving ONOS time to add the flow
+ time.sleep( main.addFlowSleep )
+
+ main.step( "Check flow is in the ADDED state" )
+
+ main.log.info( "Get the flows from ONOS" )
+ try:
+ flows = json.loads( main.ONOSrest.flows( ) )
+
+ stepResult = main.TRUE
+ for f in flows:
+ if "rest" in f.get( "appId" ):
+ if "ADDED" not in f.get( "state" ):
+ stepResult = main.FALSE
+ main.log.error("Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
+ except TypeError:
+ main.log.error( "No Flows found by the REST API" )
+ stepResult = main.FALSE
+ except ValueError:
+ main.log.error( "Problem getting Flows state from REST API. Exiting test" )
+ main.cleanup( )
+ main.exit( )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in the ADDED state",
+ onfail="All flows are NOT in the ADDED state" )
+
+ main.step( "Check flows are in Mininet's flow table" )
+
+ # get the flow IDs that were added through rest
+ main.log.info( "Getting the flow IDs from ONOS" )
+ flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
+ # convert the flowIDs to ints then hex and finally back to strings
+ flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
+ main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
+
+ stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="All flows are in mininet",
+ onfail="All flows are NOT in mininet" )
+
+ main.step( "Send a packet to verify the flow is correct" )
+
+ main.log.info( "Constructing packet" )
+ # No need for the MAC src dst
+ main.h1.buildEther( dst=main.h2.hostMac )
+ main.h1.buildIP( dst=main.h2.hostIp )
+ main.h1.buildSCTP( )
+
+ main.log.info( "Starting filter on host2" )
+ # Defaults to ip
+ main.h2.startFilter( pktFilter="sctp" )
+
+ main.log.info( "Sending packet to host2" )
+ main.h1.sendPacket( )
+
+ main.log.info( "Checking filter for our packet" )
+ stepResult = main.h2.checkFilter( )
+ if stepResult:
+ main.log.info( "Packet: %s" % main.h2.readPackets( ) )
+ else:
+ main.h2.killFilter( )
+
+ main.log.info( "Clean up host components" )
+ for host in hosts:
+ host.stopScapy( )
+ main.Mininet1.removeHostComponent( "h1" )
+ main.Mininet1.removeHostComponent( "h2" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully sent a packet",
+ onfail="Failed to send a packet" )
+
def CASE100( self, main ):
'''
Report errors/warnings/exceptions
'''
- main.log.info("Error report: \n" )
+ main.log.info( "Error report: \n" )
main.ONOSbench.logReport( main.ONOSip[ 0 ],
[ "INFO",
"FOLLOWER",
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/flow-2sw.py b/TestON/tests/FUNC/FUNCflow/dependencies/flow-2sw.py
deleted file mode 100755
index 2299d9e..0000000
--- a/TestON/tests/FUNC/FUNCflow/dependencies/flow-2sw.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/python
-
-"""
-Custom topology for Mininet
-"""
-from mininet.topo import Topo
-from mininet.net import Mininet
-from mininet.node import Host, RemoteController
-from mininet.node import Node
-from mininet.node import CPULimitedHost
-from mininet.link import TCLink
-from mininet.cli import CLI
-from mininet.log import setLogLevel
-from mininet.util import dumpNodeConnections
-from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
-
-class MyTopo( Topo ):
-
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.1/24' )
- host2=self.addHost( 'h2', ip='10.1.0.2/24' )
- #host3=self.addHost( 'h3', ip='10.1.0.3/24', v6Addr='1000::3/64' )
- #host4=self.addHost( 'h4', ip='10.1.0.4/24', v6Addr='1000::4/64' )
-
- s1 = self.addSwitch( 's1' )
- #s2 = self.addSwitch( 's2' )
-
- self.addLink(s1, host1)
- self.addLink(s1, host2)
- #self.addLink(s1, host3)
- #self.addLink(s1, host4)
-
-
- topos = { 'mytopo': ( lambda: MyTopo() ) }
-
-def setupNetwork():
- "Create network"
- topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
- network.start()
- CLI( network )
- network.stop()
-
-if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
- setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py b/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
index f9d58c1..6222d75 100755
--- a/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
+++ b/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
@@ -48,6 +48,9 @@
host3=self.addHost( 'h3', ip='10.0.0.3/24', cls=VLANHost, vlan=10 )
host4=self.addHost( 'h4', ip='10.0.0.4/24', cls=VLANHost, vlan=10 )
+ #IPv6 hosts
+ host5=self.addHost( 'h5', ip='10.0.0.5/24', cls=IPv6Host, v6Addr='1000::5/64')
+ host6=self.addHost( 'h6', ip='10.0.0.6/24', cls=IPv6Host, v6Addr='1000::6/64')
s1 = self.addSwitch( 's1' )
@@ -55,6 +58,8 @@
self.addLink(s1, host2)
self.addLink(s1, host3)
self.addLink(s1, host4)
+ self.addLink(s1, host5)
+ self.addLink(s1, host6)
topos = { 'mytopo': ( lambda: MyTopo() ) }
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index 967dea5..9135daf 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -270,7 +270,7 @@
scpResult = main.TRUE
copyResult = main.TRUE
for i in range( main.numCtrls ):
- main.node = main.CLIs[ i ]
+ main.node = main.CLIs2[ i ]
ip = main.ONOSip[ i ]
main.node.ip_address = ip
scpResult = scpResult and main.ONOSbench.scp( main.node ,