Patch for the OFAgent itests for new voltha which loads config from consul.
Edited ReadME accordingly.
Change-Id: Icf6cb1251b04d2c4d616c951c4a2c40db26fb749
diff --git a/compose/docker-compose-ofagent-test.yml b/compose/docker-compose-ofagent-test.yml
index 836bfc6..4632cfc 100644
--- a/compose/docker-compose-ofagent-test.yml
+++ b/compose/docker-compose-ofagent-test.yml
@@ -1,18 +1,58 @@
version: '2'
services:
+ consul:
+ image: consul:latest
+ command: agent -server -bootstrap -client 0.0.0.0 -ui
+ ports:
+ - "8300:8300"
+ - "8400:8400"
+ - "8500:8500"
+ - "8600:8600/udp"
+ environment:
+ #SERVICE_53_IGNORE: "yes"
+ SERVICE_8300_IGNORE: "yes"
+ SERVICE_8400_IGNORE: "yes"
+ SERVICE_8500_NAME: "consul-rest"
+ #
+ # Registrator
+ #
+ registrator:
+ image: gliderlabs/registrator:latest
+ command: [
+ "-ip=${DOCKER_HOST_IP}",
+ "-retry-attempts", "100",
+ "-cleanup",
+ # "-internal",
+ "consul://consul:8500"
+ ]
+ links:
+ - consul
+ volumes:
+ - "/var/run/docker.sock:/tmp/docker.sock"
+ #
+ # Voltha server instance(s)
+ #
voltha:
image: cord/voltha
command: [
"/voltha/voltha/main.py",
+ "-v",
+ "--consul=${DOCKER_HOST_IP}:8500",
"--rest-port=8880",
"--grpc-port=50555",
- "--instance-id-is-container-name"
+ "--backend=consul",
+ "-v"
]
+
ports:
- 8880:8880
- 50055:50555
- 18880
+ depends_on:
+ - consul
+ links:
+ - consul
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
#
diff --git a/tests/itests/README.md b/tests/itests/README.md
index 658d95e..dff4850 100644
--- a/tests/itests/README.md
+++ b/tests/itests/README.md
@@ -23,8 +23,24 @@
. ./env.sh
nosetests -s tests/itests/docutests/build_md_test.py
```
-* **Ofagent_multicontroller_failover**: TODO
+* **Ofagent_multicontroller_failover**: This tests the OFAgent capability
+to work seamlessly with multiple ONOS controllers. Note that no dockers
+containers should be running(to avoid host side port usage conflicts).
+Also note this test takes a while to run (close to 5 mins).
+The steps it follows are
+ * Spawns three ONOS controllers and clusters them.
+ * Spawns required Voltha components.
+ * OFagent establishes connection with the three spawned controllers.
+ * Adds simulated OLT and enables it.
+ * Identifies the ONOS controller having the Mastership role for the
+ above added OLT and kills it.
+ * Tests if new master is chosen among the remaining two ONOS controllers.
+```
+cd /cord/incubator/voltha
+. ./env.sh
+nosetests -s tests/itests/ofagent/test_ofagent_multicontroller_failover.py
+```
* **Frameio**: This tests the packet send/receive/filter capabilities of the
FrameIOManager. This test needs to run as root.
```
diff --git a/tests/itests/ofagent/onos-form-cluster b/tests/itests/ofagent/onos-form-cluster
old mode 100644
new mode 100755