VOL-3419: Replicate voltha flows in openolt agent
- Use the flow_id, symmetric_flow_id, replication_flag and pbit_to_gemport_map
coming in Flow proto messge to replicate the flow as needed
- Use the CreateQueues and RemoveQueues messages to setup and remove gem_ports
- Use latest gRPC version 1.31.1 which allows fine tuning of gRPC threadpools
which allows for greating performance.
- Performance numbers when tested with openolt-scale-tester has been better with
using latest gRPC and threadpool tuning when compared to earlier. It is to be
noted that the performance is better even with openolt-agent replicating the flow
now.
- Scale tests with 512 subscribers have been successfull with BAL3.4.7.5 version
- Use openolt proto version 4.0.0
- Use openolt-test (for unit test) image version 2.0.1 (which bundles latest gRPC version 1.31.1)
- These changes are NOT backward compatible and openolt-agent will have a major
version bump to 3.0.0
Change-Id: I715c804bdf342e60d08cab6c59e1c21b8c5ac1f4
diff --git a/agent/test/Makefile b/agent/test/Makefile
index 0272102..e54da02 100644
--- a/agent/test/Makefile
+++ b/agent/test/Makefile
@@ -21,31 +21,8 @@
TOP_DIR=`pwd`
OPENOLTDEVICE ?= asfvolt16
-OPENOLT_PROTO_VER ?= v3.4.5
+OPENOLT_PROTO_VER ?= v4.0.2
-GTEST_VER ?= release-1.8.0
-gtest-target = /usr/local/lib/libgtest.a
-
-CMOCK_VER ?= 0207b30
-cmock-target = /usr/local/include/cmock/cmock.h
-
-GMOCK_GLOBAL_VER ?= 1.0.2
-gmock-global-target = /usr/local/include/gmock-global/gmock-global.h
-
-
-# GRPC installation
-GRPC_ADDR = https://github.com/grpc/grpc
-GRPC_DST = /tmp/grpc
-GRPC_VER ?= v1.10.x
-grpc-cpp-plugin-bin = /usr/local/bin/grpc_cpp_plugin
-
-# Protobuf installation
-PROTOBUF_VER ?= 3.5.0
-PROTOBUF_ADDR = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VER)/protobuf-cpp-$(PROTOBUF_VER).tar.gz
-PROTOBUF_DST = /tmp/protobuf-$(PROTOBUF_VER)
-protoc-bin = /usr/local/bin/protoc
-
-#
########################################################################
##
##
@@ -60,7 +37,7 @@
CXXFLAGS += -std=c++11 -fpermissive -Wno-literal-suffix
CXXFLAGS += -DTEST_MODE -DENABLE_LOG
LDFLAGS += -lpthread -lm `pkg-config --libs protobuf grpc++ grpc` -ldl -lgpr
-CXXFLAGSDEVICE = -I../device -I../device/$(OPENOLTDEVICE) -I../device/generic
+CXXFLAGSDEVICE = -I../device -I../device/$(OPENOLTDEVICE)
export CXX CXXFLAGS OPENOLT_PROTO_VER
@@ -73,52 +50,6 @@
CXXFLAGS += $(BAL_INC)
-prereqs-system:
- sudo apt-get -q -y install git pkg-config build-essential autoconf libtool libgflags-dev libgtest-dev clang libc++-dev unzip docker.io
- sudo apt-get install -y build-essential autoconf libssl-dev gawk debhelper dh-systemd init-system-helpers curl cmake ccache g++-4.9
-
-prereqs-local: $(protoc-bin) $(grpc-cpp-plugin-bin) prereqs-test-lib
-
-$(protoc-bin):
- # Install protobuf
- rm -rf $(PROTOBUF_DST)
- cd /tmp && wget $(PROTOBUF_ADDR)
- cd /tmp && tar -zxvf protobuf-cpp-$(PROTOBUF_VER).tar.gz
- cd $(PROTOBUF_DST) && ./autogen.sh
- cd $(PROTOBUF_DST) && ./configure
- make -C $(PROTOBUF_DST)
- sudo make -C $(PROTOBUF_DST) install
-
-$(grpc-cpp-plugin-bin):
- # Install GRPC, protoc
- rm -rf $(GRPC_DST)
- cd /tmp && git clone -b $(GRPC_VER) $(GRPC_ADDR) $(GRPC_DST)
- cd $(GRPC_DST) && git submodule update --init
- make -C $(GRPC_DST)
- sudo make -C $(GRPC_DST) install
-
-prereqs-test-lib: $(gtest-target) $(cmock-target) $(gmock-global-target)
-
-$(gtest-target):
- # Install gtest
- rm -rf /tmp/googletest && cd /tmp && git clone https://github.com/google/googletest.git
- cd /tmp/googletest && git checkout $(GTEST_VER)
- cd /tmp/googletest && cmake CMakeLists.txt
- make -C /tmp/googletest
- sudo make -C /tmp/googletest install
-
-$(cmock-target):
- # Install c-mock
- rm -rf /tmp/C-Mock && cd /tmp && git clone https://github.com/hjagodzinski/C-Mock.git
- cd /tmp/C-Mock && git checkout $(CMOCK_VER)
- sudo make -C /tmp/C-Mock install
-
-$(gmock-global-target):
- # Install gmock-global
- rm -rf /tmp/gmock-global && cd /tmp && git clone https://github.com/apriorit/gmock-global.git
- cd /tmp/gmock-global && git checkout $(GMOCK_GLOBAL_VER)
- sudo cp -rf /tmp/gmock-global/include/gmock-global /usr/local/include/
-
########################################################################
##
##
diff --git a/agent/test/README.md b/agent/test/README.md
index 92ec74e..84bddb7 100644
--- a/agent/test/README.md
+++ b/agent/test/README.md
@@ -26,24 +26,6 @@
unit tests will be run. Note that you will need access to internet to download
the voltha/openolt-test docker container for the first time.
-If you choose not to use docker container packaged with pre-requisite software
-for building and running unit tests, you may install the pre-requisite software
-directly on the host system using procedure below. However this procedure is
-NOT RECOMMENDED as software being installed via this procedure may conflict
-or overwrite the software that may already exist on the host system.
-
-```shell
-$ cd agent/test
-# Run Autoconfig to generate the appropriate makefile scaffolding for the desired target
-./configure
-# This will build pre-requisite software to build openolt. Needed once only.
-$ make prereq
-# This will install gtest and c-mock libraries. Needed once only
-$ make prereq-mock-lib
-# This will build and run the unit test cases
-$ make test
-```
-
Once you have successfully built and run the unit-test, the test report will be
available in `test_openolt_report_xunit.xml` file in `agent/test`. To clean
all build artifacts and test reports, do `make clean` from openolt agent root