Fix for ONOS-5578
Change-Id: Ibf52263b7a3eaabe4d633aa4bba0781534c82781
diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
new file mode 100644
index 0000000..290a26a
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
@@ -0,0 +1,31 @@
+def addBucket( main , egressPort = "" ):
+ """
+ Description:
+ Create a single bucket which can be added to a Group.
+ Optional:
+ * egressPort: port of egress device
+ Returns:
+ * Returns a Bucket
+ * Returns None in case of error
+ Note:
+ The ip and port option are for the requests input's ip and port
+ of the ONOS node.
+ """
+ try:
+
+ bucket = {
+ "treatment":{ "instructions":[] }
+ }
+ if egressPort:
+ bucket[ 'treatment' ][ 'instructions' ].append( {
+ "type":"OUTPUT",
+ "port":egressPort } )
+ return bucket
+
+ except ( AttributeError, TypeError ):
+ main.log.exception( self.name + ": Object not as expected" )
+ return None
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup()
+ main.exit()