system-test docker-compose uses golang openolt as the default

Added a python compose file if needed
Updated bbsim test to use current arguments

Change-Id: Ib25c9a29381633bdbd2fd8081fbe7fd9b9d940f5
diff --git a/compose/network-cfg-bbsim.json b/compose/network-cfg-bbsim.json
new file mode 100644
index 0000000..8e0baf3
--- /dev/null
+++ b/compose/network-cfg-bbsim.json
@@ -0,0 +1,62 @@
+{
+  "devices" : {
+    "of:000000000a000001" : {
+      "accessDevice" : {
+        "uplink" : "65536",
+        "vlan" : "1"
+      },
+      "basic" : {
+        "driver" : "voltha"
+      }
+    }
+  },
+  "apps" : {
+    "org.opencord.dhcpl2relay" : {
+      "dhcpl2relay" : {
+        "useOltUplinkForServerPktInOut" : true
+      }
+    },
+    "org.opencord.aaa" : {
+      "AAA" : {
+        "radiusIp" : "172.16.0.1",
+        "radiusServerPort" : "1645",
+        "radiusSecret" : "secret",
+        "nasIp" : "172.16.0.10",
+        "radiusConnectionType" : "socket",
+        "packetCustomizer" : "att"
+      }
+    },
+    "org.opencord.sadis" : {
+      "sadis" : {
+        "integration" : {
+          "cache" : {
+            "enabled" : true,
+            "maxsize" : 50,
+            "ttl" : "PT1m"
+          }
+        },
+        "entries" : [ {
+          "id" : "BBSIMOLT000",
+          "uplinkPort" : 65536,
+          "hardwareIdentifier" : "00:00:0a:00:00:01",
+          "ipAddress" : "10.0.0.1",
+          "nasId" : "ATLEDGEVOLT1"
+        }, {
+          "id" : "BBSM00000001-1",
+          "cTag" : 900,
+          "sTag" : 900,
+          "nasPortId" : "BBSM00000001-1",
+          "circuitId" : "BBSM00000001-1",
+          "remoteId" : "ATLEDGEVOLT1-RID"
+        }, {
+          "id" : "BBSM00000002-1",
+          "cTag" : 901,
+          "sTag" : 901,
+          "nasPortId" : "BBSM00000002-1",
+          "circuitId" : "BBSM00000002-1",
+          "remoteId" : "ATLEDGEVOLT1-RID"
+        }]
+      }
+    }
+  }
+}
diff --git a/compose/system-test-bbsim.yml b/compose/system-test-bbsim.yml
index e2ae902..46464c0 100644
--- a/compose/system-test-bbsim.yml
+++ b/compose/system-test-bbsim.yml
@@ -29,6 +29,7 @@
     - 2181:2181
     networks:
     - default
+    restart: unless-stopped
 
 
   kafka:
@@ -45,6 +46,7 @@
      - 9092:9092
     networks:
     - default
+    restart: unless-stopped
 
 
   etcd:
@@ -66,10 +68,11 @@
     - 4001
     networks:
     - default
+    restart: unless-stopped
 
 
   rw_core:
-    image: voltha-rw-core
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-rw-core:${DOCKER_TAG}"
     entrypoint:
         - /app/rw_core
         - -kv_store_type=etcd
@@ -85,7 +88,6 @@
         - -kv_store_data_prefix=service/voltha
         - -in_competing_mode=false
         - -log_level=0
-        - -log_level=0
     volumes:
     - "/var/run/docker.sock:/tmp/docker.sock"
     ports:
@@ -96,12 +98,7 @@
 
 
   cli:
-    image: "${REGISTRY}${REPOSITORY}voltha-cli:latest"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-cli:${DOCKER_TAG}"
     environment:
       DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
     entrypoint:
@@ -111,15 +108,11 @@
     - default
     ports:
     - "5022:22"
+    restart: unless-stopped
 
 
   ofagent:
-    image: "${REGISTRY}${REPOSITORY}voltha-ofagent:latest"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-ofagent:${DOCKER_TAG}"
     command: [
       "/ofagent/ofagent/main.py",
       "--consul=${DOCKER_HOST_IP}:8500",
@@ -135,35 +128,42 @@
     restart: unless-stopped
 
 
-  adapter_openolt:
-    image: "${REGISTRY}${REPOSITORY}voltha-openolt-adapter${TAG}"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
-    command: [
-      "/voltha/adapters/openolt/main.py",
-      "-v",
-      "--name=openolt",
-      "--kafka_adapter=${DOCKER_HOST_IP}:9092",
-      "--kafka_cluster=${DOCKER_HOST_IP}:9092",
-      "--backend=etcd",
-      "--etcd=${DOCKER_HOST_IP}:2379",
-      "--core_topic=rwcore"
-    ]
+  onos:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-onos:${DOCKER_TAG}"
+    ports:
+    - "8101:8101" # ssh
+    - "6653:6653" # OF
+    - "8181:8181" # UI
+    environment:
+      ONOS_APPS: 'drivers,openflow-base'
+    volumes:
+    - "/var/run/docker.sock:/tmp/docker.sock"
+    - "./network-cfg-bbsim.json:/root/onos/config/network-cfg.json"
     networks:
     - default
     restart: unless-stopped
 
 
+  adapter_openolt:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openolt-adapter:${DOCKER_TAG}"
+    command: [
+      "/app/openolt",
+      "--kafka_adapter_host=${DOCKER_HOST_IP}",
+      "--kafka_adapter_port=9092",
+      "--kafka_cluster_host=${DOCKER_HOST_IP}",
+      "--kafka_cluster_port=9092",
+      "--core_topic=rwcore",
+      "--kv_store_host=${DOCKER_HOST_IP}",
+      "--kv_store_port=2379"
+    ]
+    ports:
+      - "50062:50062"
+    networks:
+    - default
+
+
   adapter_openonu:
-    image: "${REGISTRY}${REPOSITORY}voltha-openonu-adapter${TAG}"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openonu-adapter:${DOCKER_TAG}"
     command: [
       "/voltha/adapters/brcm_openomci_onu/main.py",
       "-v",
@@ -176,20 +176,21 @@
     ]
     networks:
     - default
-    restart: unless-stopped
+
 
   bbsim:
     image: "voltha/voltha-bbsim:latest"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
+    privileged: true
     command: [
-      "./bbsim"
+      "./bbsim",
+      "-m",
+      "both",
+      "-i",
+      "1",
+      "-n",
+      "1"
     ]
-    networks:
-    - default
     ports:
     - "50060:50060"
-    restart: unless-stopped
+    networks:
+    - default
diff --git a/compose/system-test-openolt-go.yml b/compose/system-test-openolt-go.yml
index bac3c35..8bbe8b6 100644
--- a/compose/system-test-openolt-go.yml
+++ b/compose/system-test-openolt-go.yml
@@ -139,7 +139,7 @@
 
 
   onos:
-    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha/voltha-onos:2.0.0"
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-onos:${DOCKER_TAG}"
     ports:
     - "8101:8101" # ssh
     - "6653:6653" # OF
@@ -156,11 +156,6 @@
 
   adapter_openolt:
     image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openolt-adapter:${DOCKER_TAG}-go"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
     command: [
       "/app/openolt",
       "--kafka_adapter_host=${DOCKER_HOST_IP}",
@@ -175,16 +170,10 @@
       - "50062:50062"
     networks:
     - default
-    restart: unless-stopped
 
 
   adapter_openonu:
     image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openonu-adapter:${DOCKER_TAG}"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
     command: [
       "/voltha/adapters/brcm_openomci_onu/main.py",
       "-v",
@@ -197,4 +186,3 @@
     ]
     networks:
     - default
-    restart: unless-stopped
diff --git a/compose/system-test-openolt-py.yml b/compose/system-test-openolt-py.yml
new file mode 100644
index 0000000..edd6eb7
--- /dev/null
+++ b/compose/system-test-openolt-py.yml
@@ -0,0 +1,186 @@
+---
+# Copyright 2018 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '2'
+
+networks:
+  default:
+    driver: bridge
+
+services:
+
+  zookeeper:
+    image: "wurstmeister/zookeeper:latest"
+    environment:
+      SERVICE_2181_NAME: "zookeeper"
+    ports:
+    - 2181:2181
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  kafka:
+    image: "wurstmeister/kafka:2.11-2.0.1"
+    environment:
+      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://${DOCKER_HOST_IP}:9092
+      KAFKA_LISTENERS: PLAINTEXT://:9092
+      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+      KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
+      SERVICE_9092_NAME: "kafka"
+    volumes:
+      - /var/run/docker.sock:/var/run/docker.sock
+    ports:
+     - 9092:9092
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  etcd:
+    image: "quay.io/coreos/etcd:v3.2.9"
+    command: [
+      "etcd",
+      "--name=etcd0",
+      "--advertise-client-urls=http://${DOCKER_HOST_IP}:2379,http://${DOCKER_HOST_IP}:4001",
+      "--listen-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001",
+      "--initial-advertise-peer-urls=http://${DOCKER_HOST_IP}:2380",
+      "--listen-peer-urls=http://0.0.0.0:2380",
+      "--initial-cluster-token=etcd-cluster-1",
+      "--initial-cluster=etcd0=http://${DOCKER_HOST_IP}:2380",
+      "--initial-cluster-state=new"
+    ]
+    ports:
+    - "2379:2379"
+    - 2380
+    - 4001
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  rw_core:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-rw-core:${DOCKER_TAG}"
+    entrypoint:
+        - /app/rw_core
+        - -kv_store_type=etcd
+        - -kv_store_host=${DOCKER_HOST_IP}
+        - -kv_store_port=2379
+        - -grpc_port=50057
+        - -banner=true
+        - -kafka_adapter_host=${DOCKER_HOST_IP}
+        - -kafka_adapter_port=9092
+        - -kafka_cluster_host=${DOCKER_HOST_IP}
+        - -kafka_cluster_port=9092
+        - -rw_core_topic=rwcore
+        - -kv_store_data_prefix=service/voltha
+        - -in_competing_mode=false
+        - -log_level=0
+    volumes:
+    - "/var/run/docker.sock:/tmp/docker.sock"
+    ports:
+      - 50057:50057
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  cli:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-cli:${DOCKER_TAG}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "10m"
+        max-file: "3"
+    environment:
+      DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
+    entrypoint:
+    - /voltha/python/cli/setup.sh
+    - -g ${DOCKER_HOST_IP}:50057
+    networks:
+    - default
+    ports:
+    - "5022:22"
+    restart: unless-stopped
+
+
+  ofagent:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-ofagent:${DOCKER_TAG}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "10m"
+        max-file: "3"
+    command: [
+      "/ofagent/ofagent/main.py",
+      "--consul=${DOCKER_HOST_IP}:8500",
+      "--controller=${DOCKER_HOST_IP}:6653",
+      "--grpc-endpoint=${DOCKER_HOST_IP}:50057",
+      "--instance-id-is-container-name",
+      "-v"
+    ]
+    volumes:
+    - "/var/run/docker.sock:/tmp/docker.sock"
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  onos:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-onos:${DOCKER_TAG}"
+    ports:
+    - "8101:8101" # ssh
+    - "6653:6653" # OF
+    - "8181:8181" # UI
+    environment:
+      ONOS_APPS: 'drivers,openflow-base'
+    volumes:
+    - "/var/run/docker.sock:/tmp/docker.sock"
+    - "./network-cfg.json:/root/onos/config/network-cfg.json"
+    networks:
+    - default
+    restart: unless-stopped
+
+
+  adapter_openolt:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openolt-adapter:${DOCKER_TAG}-py"
+    command: [
+      "/voltha/adapters/openolt/main.py",
+      "-v",
+      "--name=openolt",
+      "--kafka_adapter=${DOCKER_HOST_IP}:9092",
+      "--kafka_cluster=${DOCKER_HOST_IP}:9092",
+      "--backend=etcd",
+      "--etcd=${DOCKER_HOST_IP}:2379",
+      "--core_topic=rwcore"
+    ]
+    networks:
+    - default
+
+
+  adapter_openonu:
+    image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openonu-adapter:${DOCKER_TAG}"
+    command: [
+      "/voltha/adapters/brcm_openomci_onu/main.py",
+      "-v",
+      "--name=brcm_openomci_onu",
+      "--kafka_adapter=${DOCKER_HOST_IP}:9092",
+      "--kafka_cluster=${DOCKER_HOST_IP}:9092",
+      "--backend=etcd",
+      "--etcd=${DOCKER_HOST_IP}:2379",
+      "--core_topic=rwcore"
+    ]
+    networks:
+    - default
diff --git a/compose/system-test.yml b/compose/system-test.yml
index 71dea7c..2f5c446 100644
--- a/compose/system-test.yml
+++ b/compose/system-test.yml
@@ -156,33 +156,24 @@
 
   adapter_openolt:
     image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openolt-adapter:${DOCKER_TAG}"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
     command: [
-      "/voltha/adapters/openolt/main.py",
-      "-v",
-      "--name=openolt",
-      "--kafka_adapter=${DOCKER_HOST_IP}:9092",
-      "--kafka_cluster=${DOCKER_HOST_IP}:9092",
-      "--backend=etcd",
-      "--etcd=${DOCKER_HOST_IP}:2379",
-      "--core_topic=rwcore"
+      "/app/openolt",
+      "--kafka_adapter_host=${DOCKER_HOST_IP}",
+      "--kafka_adapter_port=9092",
+      "--kafka_cluster_host=${DOCKER_HOST_IP}",
+      "--kafka_cluster_port=9092",
+      "--core_topic=rwcore",
+      "--kv_store_host=${DOCKER_HOST_IP}",
+      "--kv_store_port=2379"
     ]
+    ports:
+      - "50062:50062"
     networks:
     - default
-    restart: unless-stopped
 
 
   adapter_openonu:
     image: "${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-openonu-adapter:${DOCKER_TAG}"
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "10m"
-        max-file: "3"
     command: [
       "/voltha/adapters/brcm_openomci_onu/main.py",
       "-v",
@@ -195,4 +186,3 @@
     ]
     networks:
     - default
-    restart: unless-stopped