Allow use of onos docker for existing tests
- Allow Cluster to pull/build onos docker
- Connect clidriver to cli runnning in docker
- Some changes for debugability in components
- To use, set the useDocker and diffCliHosts tags in the cluster
component to True, then define parameters in the params file
- Update all SR Stratum tests to use the tost docker image
- NOTE: Since the tost-onos image doesn't have openflow installe, we are
currently only using docker for the bmv2 and tofino switches
Change-Id: If900b0bdbf9a41b8885c692ccba18a3b1bc580cc
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
index 9219001..9b1a5c9 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
@@ -23,8 +23,6 @@
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py,stratum.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
- <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
- <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -33,9 +31,21 @@
<home>/home/root/</home>
</MN_DOCKER>
+ <CLUSTER>
+ # Params for onos docker
+ <dockerSkipBuild>True</dockerSkipBuild>
+ <dockerBuildCmd>make ONOS_BRANCH=master DOCKER_TAG=TestON-master onos-build trellis-control-build trellis-t3-build tost-build</dockerBuildCmd> # If using another cmd like make
+ <dockerBuildTimeout>1200</dockerBuildTimeout>
+ <dockerFilePath>~/tost-onos</dockerFilePath>
+ <dockerImageTag>tost:TestON-master</dockerImageTag>
+ <dockerOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/cluster.json:/root/onos/config/cluster.json </dockerOptions> # We start the container detached, so the docker component can connect to cli instead of logs
+ <atomixImageTag>atomix/atomix:3.1.5</atomixImageTag>
+ <atomixOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/atomix.json:/opt/atomix/conf/atomix.json </atomixOptions>
+ </CLUSTER>
+
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric,segmentrouting,t3</cellApps>
</ENV>
<ONOS_Configuration>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo
index 82c7b3a..78792d0 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo
@@ -8,6 +8,8 @@
<connect_order>1</connect_order>
<home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
<COMPONENTS>
+ <useDocker></useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
<cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
<diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
<karaf_username></karaf_username>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.0x1.physical b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.0x1.physical
index d103eae..d6828b3 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.0x1.physical
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.0x1.physical
@@ -8,12 +8,14 @@
<connect_order>1</connect_order>
<home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
<COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
<cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
- <diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
<karaf_username></karaf_username>
<karaf_password></karaf_password>
- <web_user></web_user>
- <web_pass></web_pass>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
<rest_port></rest_port>
<prompt></prompt> # TODO: we technically need a few of these, one per component
<onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.physical b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.physical
index 905d24b..37e1830 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.physical
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.topo.physical
@@ -8,6 +8,8 @@
<connect_order>1</connect_order>
<home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
<COMPONENTS>
+ <useDocker></useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
<cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
<diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
<karaf_username></karaf_username>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
index 6f12598..e7e1564 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
@@ -17,12 +17,11 @@
<useCommonTopo>True</useCommonTopo>
<useBmv2>True</useBmv2>
<bmv2SwitchType>stratum</bmv2SwitchType>
+ <switchPrefix>bmv2</switchPrefix>
<stratumRoot>~/stratum</stratumRoot>
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py,stratum.py</lib>
<conf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</conf>
- <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
- <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -31,9 +30,21 @@
<home>/home/root/</home>
</MN_DOCKER>
+ <CLUSTER>
+ # Params for onos docker
+ <dockerSkipBuild>True</dockerSkipBuild>
+ <dockerBuildCmd>make ONOS_BRANCH=master DOCKER_TAG=TestON-master onos-build trellis-control-build trellis-t3-build tost-build</dockerBuildCmd> # If using another cmd like make
+ <dockerBuildTimeout>1200</dockerBuildTimeout>
+ <dockerFilePath>~/tost-onos</dockerFilePath>
+ <dockerImageTag>tost:TestON-master</dockerImageTag>
+ <dockerOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/cluster.json:/root/onos/config/cluster.json </dockerOptions> # We start the container detached, so the docker component can connect to cli instead of logs
+ <atomixImageTag>atomix/atomix:3.1.5</atomixImageTag>
+ <atomixOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/atomix.json:/opt/atomix/conf/atomix.json </atomixOptions>
+ </CLUSTER>
+
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.topo.docker b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
index 38edc6f..835baff 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
@@ -17,12 +17,11 @@
<useCommonTopo>True</useCommonTopo>
<useBmv2>True</useBmv2>
<bmv2SwitchType>stratum</bmv2SwitchType>
+ <switchPrefix>bmv2</switchPrefix>
<stratumRoot>~/stratum</stratumRoot>
<topology>hagg_fabric.py</topology>
<lib>routinglib.py,trellislib.py,trellis_fabric.py,stratum.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
- <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
- <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -31,9 +30,21 @@
<home>/home/root/</home>
</MN_DOCKER>
+ <CLUSTER>
+ # Params for onos docker
+ <dockerSkipBuild>True</dockerSkipBuild>
+ <dockerBuildCmd>make ONOS_BRANCH=master DOCKER_TAG=TestON-master onos-build trellis-control-build trellis-t3-build tost-build</dockerBuildCmd> # If using another cmd like make
+ <dockerBuildTimeout>1200</dockerBuildTimeout>
+ <dockerFilePath>~/tost-onos</dockerFilePath>
+ <dockerImageTag>tost:TestON-master</dockerImageTag>
+ <dockerOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/cluster.json:/root/onos/config/cluster.json </dockerOptions> # We start the container detached, so the docker component can connect to cli instead of logs
+ <atomixImageTag>atomix/atomix:3.1.5</atomixImageTag>
+ <atomixOptions>-d --rm --network host -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys -v /tmp/atomix.json:/opt/atomix/conf/atomix.json </atomixOptions>
+ </CLUSTER>
+
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,fpm,dhcprelay,hostprovider,netcfghostprovider,lldpprovider,routeradvertisement,hostprobingprovider,drivers.bmv2,pipelines.fabric,segmentrouting,t3</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.topo.docker b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.topo.docker
new file mode 100644
index 0000000..a6f21d7
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.topo.docker
@@ -0,0 +1,39 @@
+<TOPOLOGY>
+ <COMPONENT>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosClusterDriver</type>
+ <connect_order>1</connect_order>
+ <home></home> # defines where onos home is on the build machine. Defaults to "~/onos/" if empty.
+ <COMPONENTS>
+ <useDocker>True</useDocker> # Whether to use docker for ONOS nodes
+ <docker_prompt>~/onos#</docker_prompt>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost>True</diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+ <karaf_username></karaf_username>
+ <karaf_password></karaf_password>
+ <web_user>sdn</web_user>
+ <web_pass>rocks</web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
+ <nodes>3</nodes> # number of nodes in the cluster
+ </COMPONENTS>
+ </ONOScell>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>MininetCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/</home>
+ <prompt></prompt>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Dockerfile b/TestON/tests/USECASE/SegmentRouting/dependencies/Dockerfile
index 4b714c5..bed2f54 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Dockerfile
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Dockerfile
@@ -5,7 +5,7 @@
RUN ln -s /root/* .
RUN chmod 777 $HOME
-RUN install_packages python-pip openvswitch-switch vim quagga isc-dhcp-server isc-dhcp-client iptables vlan
+RUN install_packages python-pip openvswitch-switch vim quagga isc-dhcp-server isc-dhcp-client iptables vlan vzctl
RUN pip install ipaddress
RUN ln -s $HOME /var/run/quagga
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index d4a7b7e..8fa0b96 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -86,7 +86,7 @@
main.stratumRoot = main.params[ 'DEPENDENCY'][ 'stratumRoot'] if 'stratumRoot' in main.params[ 'DEPENDENCY' ] else None
main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
- main.trellisOar = main.params[ 'DEPENDENCY' ][ 'trellisOar' ]
+ main.trellisOar = main.params[ 'DEPENDENCY' ][ 'trellisOar' ] if 'trellisOar' in main.params[ 'DEPENDENCY' ] else None
main.t3Oar = main.params[ 'DEPENDENCY' ][ 't3Oar' ] if 't3Oar' in main.params[ 'DEPENDENCY' ] else None
stepResult = main.testSetUp.envSetup( False )
@@ -141,7 +141,9 @@
main.cleanAndExit()
# Install segmentrouting and t3 app
- appInstallResult = main.ONOSbench.onosAppInstall( main.Cluster.runningNodes[0].ipAddress, main.trellisOar)
+ appInstallResult = main.TRUE
+ if main.trellisOar:
+ appInstallResult = appInstallResult and main.ONOSbench.onosAppInstall( main.Cluster.runningNodes[0].ipAddress, main.trellisOar)
if main.t3Oar:
appInstallResult = appInstallResult and main.ONOSbench.onosAppInstall( main.Cluster.runningNodes[0].ipAddress, main.t3Oar)
utilities.assert_equals( expect=main.TRUE, actual=appInstallResult,
@@ -235,18 +237,6 @@
if 'MN_DOCKER' in main.params and main.params['MN_DOCKER']['args']:
destDir = "/tmp/mn_conf/"
# Try to ensure the destination exists
- main.log.info( "Create folder for network config files" )
- handle = main.Mininet1.handle
- handle.sendline( "mkdir -p %s" % destDir )
- handle.expect( [ main.Mininet1.prompt, main.Mininet1.dockerPrompt ] )
- main.log.debug( handle.before + handle.after )
- # Make sure permissions are correct
- handle.sendline( "sudo chown %s:%s %s" % ( main.Mininet1.user_name, main.Mininet1.user_name, destDir ) )
- handle.expect( [ main.Mininet1.prompt, main.Mininet1.dockerPrompt ] )
- main.log.debug( handle.before + handle.after )
- handle.sendline( "sudo chmod -R a+rwx %s" % ( destDir ) )
- handle.expect( [ main.Mininet1.prompt, main.Mininet1.dockerPrompt ] )
- main.log.debug( handle.before + handle.after )
for conf in main.topologyConf.split(","):
# Update zebra configurations with correct ONOS instance IP
if conf in [ "zebradbgp1.conf", "zebradbgp2.conf" ]:
@@ -272,7 +262,7 @@
onfail="Failed to copy topo files" )
if main.stratumRoot:
main.Mininet1.handle.sendline( "export STRATUM_ROOT=" + str( main.stratumRoot ) )
- main.Mininet1.handle.expect( main.Mininet1.prompt )
+ main.Mininet1.handle.expect( main.Mininet1.Prompt() )
main.step( "Starting Mininet Topology" )
arg = "--onos-ip=%s %s" % (",".join([ctrl.ipAddress for ctrl in main.Cluster.runningNodes]), args)
main.topology = topology
@@ -287,9 +277,11 @@
if not topoResult:
main.cleanAndExit()
if main.useBmv2:
+ main.step( "Configure switches in ONOS" )
# Upload the net-cfg file created for each switch
filename = "onos-netcfg.json"
switchPrefix = main.params[ 'DEPENDENCY' ].get( 'switchPrefix', "bmv2" )
+ switchNetCfg = main.TRUE
for switch in main.Mininet1.getSwitches( switchRegex=r"(StratumBmv2Switch)|(Bmv2Switch)" ).keys():
path = "/tmp/mn-stratum/%s/" % switch
dstPath = "/tmp/"
@@ -299,6 +291,7 @@
"%s%s" % ( dstPath, dstFileName ),
"from" )
main.ONOSbench1.handle.sendline( "sudo sed -i 's/localhost/%s/g' %s%s" % ( main.Mininet1.ip_address, dstPath, dstFileName ) )
+ main.ONOSbench1.handle.expect( main.ONOSbench1.prompt )
# Configure managementAddress
main.ONOSbench1.handle.sendline( "sudo sed -i 's/localhost/%s/g' %s%s" % ( main.Mininet1.ip_address, dstPath, dstFileName ) )
main.ONOSbench1.handle.expect( main.ONOSbench1.prompt )
@@ -311,7 +304,19 @@
main.ONOSbench1.handle.sendline( "sudo sed -i '/\"basic\"/a\ \"name\": \"%s\",' %s%s" % ( switch, dstPath, dstFileName ) )
main.ONOSbench1.handle.expect( main.ONOSbench1.prompt )
main.log.debug( main.ONOSbench1.handle.before + main.ONOSbench1.handle.after )
- main.ONOSbench1.onosNetCfg( main.ONOSserver1.ip_address, dstPath, dstFileName )
+ node = main.Cluster.active(0)
+ switchNetCfg = switchNetCfg and node.onosNetCfg( node.server.ip_address,
+ dstPath,
+ dstFileName,
+ user=node.REST.user_name,
+ password=node.REST.pwd )
+ # Stop test if we fail to push switch netcfg
+ utilities.assert_equals( expect=main.TRUE,
+ actual=switchNetCfg,
+ onpass="Successfully pushed switch netcfg",
+ onfail="Failed to configure switches in onos" )
+ if not switchNetCfg:
+ main.cleanAndExit()
# Make sure hosts make some noise
Testcaselib.discoverHosts( main )
@@ -1594,56 +1599,36 @@
main.log.info( "Creating Mininet Docker" )
handle = main.Mininet1.handle
- main.Mininet1.dockerPrompt = '#'
# build docker image
- buildOutput = ""
- try:
- handle.sendline( " docker build -t trellis_mininet %s/../dependencies/" % main.testDir )
- handle.expect( "Successfully built", timeout=600 )
- buildOutput = handle.before + str( handle.after )
- handle.expect( main.Mininet1.prompt )
- buildOutput += handle.before
- main.log.debug( buildOutput )
- except pexpect.TIMEOUT as e:
- main.log.error( e )
- buildOutput += handle.before
- main.log.debug( buildOutput )
+ dockerFilePath = "%s/../dependencies/" % main.testDir
+ dockerName = "trellis_mininet"
+ # TODO: assert on these docker calls
+ main.Mininet1.dockerBuild( dockerFilePath, dockerName )
confDir = "/tmp/mn_conf/"
# Try to ensure the destination exists
main.log.info( "Create folder for network config files" )
handle.sendline( "mkdir -p %s" % confDir )
- handle.expect( main.Mininet1.prompt )
+ handle.expect( main.Mininet1.Prompt() )
main.log.debug( handle.before + handle.after )
# Make sure permissions are correct
handle.sendline( "sudo chown %s:%s %s" % ( main.Mininet1.user_name, main.Mininet1.user_name, confDir ) )
- handle.expect( main.Mininet1.prompt )
+ handle.expect( main.Mininet1.Prompt() )
handle.sendline( "sudo chmod -R a+rwx %s" % ( confDir ) )
- handle.expect( main.Mininet1.prompt )
+ handle.expect( main.Mininet1.Prompt() )
main.log.debug( handle.before + handle.after )
# Stop any leftover container
- handle.sendline( "docker stop trellis_mininet" )
- handle.expect( main.Mininet1.bashPrompt )
- main.log.debug( handle.before )
+ main.Mininet1.dockerStop( dockerName )
# Start docker container
- handle.sendline( "docker run --name trellis_mininet %s %s" % ( main.params[ 'MN_DOCKER' ][ 'args' ], main.params[ 'MN_DOCKER' ][ 'name' ] ) )
- i = handle.expect( [ main.Mininet1.bashPrompt, "Error response from daemon: Conflict. The container name" ] )
- output = handle.before + handle.after
- main.log.debug( repr(output) )
- if i == 1:
+ runResponse = main.Mininet1.dockerRun( main.params[ 'MN_DOCKER' ][ 'name' ],
+ dockerName,
+ main.params[ 'MN_DOCKER' ][ 'args' ] )
+ if runResponse == main.FALSE:
main.log.error( "Docker container already running, aborting test" )
main.cleanup()
main.exit()
- handle.sendline( "docker attach trellis_mininet" )
- handle.expect( main.Mininet1.dockerPrompt )
- main.log.debug( handle.before + handle.after )
- handle.sendline( "sysctl -w net.ipv4.ip_forward=0" )
- handle.sendline( "sysctl -w net.ipv4.conf.all.forwarding=0" )
- handle.expect( main.Mininet1.dockerPrompt )
- main.log.debug( handle.before + handle.after )
- # We should be good to go
- main.Mininet1.prompt = main.Mininet1.dockerPrompt
+ main.Mininet1.dockerAttach( dockerName, dockerPrompt='~#' )
main.Mininet1.sudoRequired = False
# Fow when we create component handles
@@ -1659,19 +1644,12 @@
if hasattr( main, 'Mininet1' ):
if 'MN_DOCKER' in main.params and main.params['MN_DOCKER']['args']:
- main.log.info( "Deleting Mininet Docker" )
+ main.log.info( "Exiting from Mininet Docker" )
# Detach from container
handle = main.Mininet1.handle
try:
- handle.sendline( "exit" ) # ctrl-p ctrk-q to detach from container
- main.log.debug( "sleeping %i seconds" % ( 5 ) )
- time.sleep(5)
- handle.expect( main.Mininet1.dockerPrompt )
- main.log.debug( handle.before + handle.after )
- main.Mininet1.prompt = main.Mininet1.bashPrompt
- handle.expect( main.Mininet1.prompt )
- main.log.debug( handle.before + handle.after )
+ main.Mininet1.dockerDisconnect()
main.Mininet1.sudoRequired = True
except Exception as e:
main.log.error( e )