New (remote) api to add nodes/members to the existing ONOS cluster
Change-Id: Ie09a13f80e5436416dc4d7bb3481ac9e50cfac3f
diff --git a/src/test/utils/CordContainer.py b/src/test/utils/CordContainer.py
index 2ab077b..28a733c 100644
--- a/src/test/utils/CordContainer.py
+++ b/src/test/utils/CordContainer.py
@@ -465,6 +465,18 @@
onos.install_cord_apps(onos.ipaddr)
@classmethod
+ def add_cluster(cls, count = 1, network_cfg = None):
+ if not cls.cluster_instances or Onos.cluster_mode is False:
+ return
+ for i in range(count):
+ name = '{}-{}'.format(Onos.NAME, len(cls.cluster_instances)+1)
+ onos = cls(name = name, image = Onos.IMAGE, tag = Onos.TAG, prefix = Container.IMAGE_PREFIX,
+ cluster = True, network_cfg = network_cfg)
+ cls.cluster_instances.append(onos)
+
+ cls.setup_cluster(cls.cluster_instances)
+
+ @classmethod
def restart_cluster(cls, network_cfg = None):
if cls.cluster_mode is False:
return