[VOL-2252] Using omci-sim v0.0.1
 Adding Makefile support to load a development version of the omci-sim library

Change-Id: I341f626adaec35e697eb24470594942463d8f9a8
diff --git a/Makefile b/Makefile
index a7e62f6..9f4d103 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@
 fmt:
 	go fmt ./...
 
-docker-build: # @HELP Build the BBSim docker container (contains BBSimCtl too)
+docker-build: local-omci-sim# @HELP Build the BBSim docker container (contains BBSimCtl too)
 	docker build -t ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG} -f build/package/Dockerfile .
 
 docker-push: # @HELP Push the docker container to a registry
@@ -137,6 +137,12 @@
         {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
     '
 
+## Local Development Helpers
+local-omci-sim:
+ifdef LOCAL_OMCI_SIM
+	mkdir -p vendor/github.com/opencord/omci-sim/
+	cp -r ${LOCAL_OMCI_SIM}/* vendor/github.com/opencord/omci-sim/
+endif
 
 # Internals
 
diff --git a/build/package/Dockerfile b/build/package/Dockerfile
index 86e15bb..ef69a0c 100644
--- a/build/package/Dockerfile
+++ b/build/package/Dockerfile
@@ -36,13 +36,8 @@
 ENV GO111MODULE=on
 ENV GOPROXY=https://proxy.golang.org
 
-# build the protos
-COPY Makefile ./
-COPY api ./api
-
 # copy and build
 COPY . ./
-RUN make dep  # we cannot vendor dependencies unless the code is there
 RUN make protos
 RUN make build-bbsim
 RUN make build-bbsimctl
diff --git a/docs/source/development-dependencies.rst b/docs/source/development-dependencies.rst
index 0a5e2ac..3ca51c5 100644
--- a/docs/source/development-dependencies.rst
+++ b/docs/source/development-dependencies.rst
@@ -3,24 +3,9 @@
 Development dependencies
 ========================
 
-To use a patched version of the ``omci-sim`` library:
+If you want to test local changes in the ``omci-sim`` library you can
+rebuild the BBSim container using a local version of the library with this command:
 
 .. code:: bash
 
-   make dep
-   cd vendor/github.com/opencord/
-   rm -rf omci-sim/
-   git clone https://gerrit.opencord.org/omci-sim
-   cd omci-sim
-
-Once done, go to ``gerrit.opencord.org`` and locate the patch you want
-to get. Click on the download URL and copy the ``Checkout`` command.
-
-It should look something like:
-
-::
-
-   git fetch ssh://teone@gerrit.opencord.org:29418/omci-sim refs/changes/67/15067/1 && git checkout FETCH_HEAD
-
-Then just execute that command in the ``omci-sim`` folder inside the
-vendored dependencies.
+   LOCAL_OMCI_SIM=<path-to-omci-sim-library> make docker-build
diff --git a/go.mod b/go.mod
index d2c4eef..80a1e62 100644
--- a/go.mod
+++ b/go.mod
@@ -13,7 +13,7 @@
 	github.com/jhump/protoreflect v1.5.0
 	github.com/looplab/fsm v0.1.0
 	github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4
-	github.com/opencord/omci-sim v0.0.0-20191011202236-3687c57a7252
+	github.com/opencord/omci-sim v0.0.1
 	github.com/opencord/voltha-protos/v2 v2.1.0
 	github.com/pkg/errors v0.8.1 // indirect
 	github.com/sirupsen/logrus v1.4.2
diff --git a/go.sum b/go.sum
index dad1ad7..f69d693 100644
--- a/go.sum
+++ b/go.sum
@@ -41,8 +41,8 @@
 github.com/looplab/fsm v0.1.0/go.mod h1:m2VaOfDHxqXBBMgc26m6yUOwkFn8H2AlJDE+jd/uafI=
 github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4 h1:Odib2px8tyALzdbyztAAqdxmpmQ/pJahJ7uz8kN/rvk=
 github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4/go.mod h1:/+3S0pwQUy7HeKnH0KfKp5W6hmh/LdZzuZTNT/m7vA4=
-github.com/opencord/omci-sim v0.0.0-20191011202236-3687c57a7252 h1:CMRqdJmtqku04ImHZW5NtdRlc6RRcdxLOn5Ep/b9HBg=
-github.com/opencord/omci-sim v0.0.0-20191011202236-3687c57a7252/go.mod h1:ToOkj7hkHgoet9XQDadKMhYqgA7qItZsi2j1Pk/mX6Y=
+github.com/opencord/omci-sim v0.0.1 h1:kME5SsHxoayQGyY4UYe4eUxaWJJoCflAVul0vy8JBr8=
+github.com/opencord/omci-sim v0.0.1/go.mod h1:ToOkj7hkHgoet9XQDadKMhYqgA7qItZsi2j1Pk/mX6Y=
 github.com/opencord/voltha-protos/v2 v2.1.0 h1:Ppl4/3OBwgGuLk0ob9vIEwMGGRC2sqe7WWoxh0Uq/n0=
 github.com/opencord/voltha-protos/v2 v2.1.0/go.mod h1:6kOcfYi1CadWowFxI2SH5wLfHrsRECZLZlD2MFK6WDI=
 github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
diff --git a/vendor/github.com/opencord/omci-sim/CODE_OF_CONDUCT.md b/vendor/github.com/opencord/omci-sim/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..626cd61
--- /dev/null
+++ b/vendor/github.com/opencord/omci-sim/CODE_OF_CONDUCT.md
@@ -0,0 +1,3 @@
+We expect all ONF employees, member companies, and participants to abide by our [Code of Conduct](https://www.opennetworking.org/wp-content/themes/onf/img/onf-code-of-conduct.pdf).
+
+If you are being harassed, notice that someone else is being harassed, or have any other concerns involving someone’s welfare, please notify a member of the ONF team or email [conduct@opennetworking.org](conduct@opennetworking.org). 
diff --git a/vendor/github.com/opencord/omci-sim/README.md b/vendor/github.com/opencord/omci-sim/README.md
index 7183f6e..c3930c5 100644
--- a/vendor/github.com/opencord/omci-sim/README.md
+++ b/vendor/github.com/opencord/omci-sim/README.md
@@ -1,3 +1,5 @@
-# omci-sim
+# Omci-sim
 
-Test
+This library is a dump of the OMCI messages reported by an ALPHA device
+and it is currently used by [BBSim](github.com/opencord/bbsim) to 
+emulate OMCI responses during [VOLTHA](docs.voltha.org) scale tests.
diff --git a/vendor/github.com/opencord/omci-sim/VERSION b/vendor/github.com/opencord/omci-sim/VERSION
index c0ab82c..8acdd82 100644
--- a/vendor/github.com/opencord/omci-sim/VERSION
+++ b/vendor/github.com/opencord/omci-sim/VERSION
@@ -1 +1 @@
-0.0.1-dev
+0.0.1
diff --git a/vendor/github.com/opencord/omci-sim/omci_handlers.go b/vendor/github.com/opencord/omci-sim/omci_handlers.go
index 67a57e7..de62498 100644
--- a/vendor/github.com/opencord/omci-sim/omci_handlers.go
+++ b/vendor/github.com/opencord/omci-sim/omci_handlers.go
@@ -37,6 +37,7 @@
 	SynchronizeTime:  syncTime,
 	Delete:           delete,
 	Reboot:           reboot,
+	Test: testHandler,
 }
 
 func mibReset(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
@@ -564,3 +565,22 @@
 	return pkt, nil
 }
 
+func testHandler(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
+	var pkt []byte
+	pkt = []byte{
+		0x20, 0x52, 0x45, 0x43, 0x56, 0x00, 0x20, 0x53,
+		0x45, 0x4e, 0x44, 0x00, 0x88, 0xb5, 0x02, 0x3f,
+		0x1b, 0x0a, 0x01, 0x07, 0x80, 0x01, 0x01, 0x00,
+		0xa5, 0x03, 0xe0, 0x0b, 0x05, 0x0b, 0x2b, 0x09,
+		0x1c, 0xd0, 0x0c, 0x32, 0x80, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x28, 0xf8, 0x13, 0x1b, 0x36,}
+
+	log.WithFields(log.Fields{
+		"IntfId": key.IntfId,
+		"OnuId": key.OnuId,
+	}).Trace("Omci Test")
+	return pkt, nil
+}
+
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 5adc681..c327981 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,6 +1,6 @@
 # github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1
-github.com/aead/cmac/aes
 github.com/aead/cmac
+github.com/aead/cmac/aes
 # github.com/cboling/omci v0.1.0
 github.com/cboling/omci
 github.com/cboling/omci/generated
@@ -12,21 +12,21 @@
 github.com/golang/glog
 # github.com/golang/protobuf v1.3.2
 github.com/golang/protobuf/descriptor
+github.com/golang/protobuf/jsonpb
 github.com/golang/protobuf/proto
 github.com/golang/protobuf/protoc-gen-go
 github.com/golang/protobuf/protoc-gen-go/descriptor
-github.com/golang/protobuf/jsonpb
-github.com/golang/protobuf/ptypes/any
-github.com/golang/protobuf/ptypes/duration
-github.com/golang/protobuf/ptypes/timestamp
-github.com/golang/protobuf/ptypes/wrappers
-github.com/golang/protobuf/ptypes
-github.com/golang/protobuf/ptypes/struct
-github.com/golang/protobuf/ptypes/empty
 github.com/golang/protobuf/protoc-gen-go/generator
+github.com/golang/protobuf/protoc-gen-go/generator/internal/remap
 github.com/golang/protobuf/protoc-gen-go/grpc
 github.com/golang/protobuf/protoc-gen-go/plugin
-github.com/golang/protobuf/protoc-gen-go/generator/internal/remap
+github.com/golang/protobuf/ptypes
+github.com/golang/protobuf/ptypes/any
+github.com/golang/protobuf/ptypes/duration
+github.com/golang/protobuf/ptypes/empty
+github.com/golang/protobuf/ptypes/struct
+github.com/golang/protobuf/ptypes/timestamp
+github.com/golang/protobuf/ptypes/wrappers
 # github.com/google/go-cmp v0.2.0
 github.com/google/go-cmp/cmp
 github.com/google/go-cmp/cmp/internal/diff
@@ -37,33 +37,33 @@
 github.com/google/gopacket/layers
 github.com/google/gopacket/pcap
 # github.com/grpc-ecosystem/grpc-gateway v1.11.3
+github.com/grpc-ecosystem/grpc-gateway/codegenerator
+github.com/grpc-ecosystem/grpc-gateway/internal
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/generator
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/gengateway
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/httprule
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/genswagger
+github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options
 github.com/grpc-ecosystem/grpc-gateway/runtime
 github.com/grpc-ecosystem/grpc-gateway/utilities
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
-github.com/grpc-ecosystem/grpc-gateway/internal
-github.com/grpc-ecosystem/grpc-gateway/codegenerator
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/gengateway
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/genswagger
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/httprule
-github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/generator
 # github.com/jessevdk/go-flags v1.4.0
 github.com/jessevdk/go-flags
 # github.com/jhump/protoreflect v1.5.0
-github.com/jhump/protoreflect/desc
-github.com/jhump/protoreflect/dynamic
-github.com/jhump/protoreflect/desc/internal
-github.com/jhump/protoreflect/internal
 github.com/jhump/protoreflect/codec
+github.com/jhump/protoreflect/desc
+github.com/jhump/protoreflect/desc/internal
+github.com/jhump/protoreflect/dynamic
+github.com/jhump/protoreflect/internal
 # github.com/konsorten/go-windows-terminal-sequences v1.0.1
 github.com/konsorten/go-windows-terminal-sequences
 # github.com/looplab/fsm v0.1.0
 github.com/looplab/fsm
 # github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4
 github.com/opencord/cordctl/pkg/format
-# github.com/opencord/omci-sim v0.0.0-20191011202236-3687c57a7252
+# github.com/opencord/omci-sim v0.0.1
 github.com/opencord/omci-sim
 # github.com/opencord/voltha-protos/v2 v2.1.0
 github.com/opencord/voltha-protos/v2/go/openolt
@@ -73,38 +73,38 @@
 # github.com/sirupsen/logrus v1.4.2
 github.com/sirupsen/logrus
 # golang.org/x/net v0.0.0-20190724013045-ca1201d0de80
-golang.org/x/net/trace
-golang.org/x/net/internal/timeseries
-golang.org/x/net/http2
-golang.org/x/net/http2/hpack
 golang.org/x/net/context
 golang.org/x/net/http/httpguts
+golang.org/x/net/http2
+golang.org/x/net/http2/hpack
 golang.org/x/net/idna
+golang.org/x/net/internal/timeseries
+golang.org/x/net/trace
 # golang.org/x/sys v0.0.0-20190422165155-953cdadca894
 golang.org/x/sys/unix
 # golang.org/x/text v0.3.0
 golang.org/x/text/secure/bidirule
+golang.org/x/text/transform
 golang.org/x/text/unicode/bidi
 golang.org/x/text/unicode/norm
-golang.org/x/text/transform
 # google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610
 google.golang.org/genproto/googleapis/api/annotations
 google.golang.org/genproto/googleapis/api/httpbody
-google.golang.org/genproto/protobuf/field_mask
 google.golang.org/genproto/googleapis/rpc/status
+google.golang.org/genproto/protobuf/field_mask
 # google.golang.org/grpc v1.22.1
 google.golang.org/grpc
-google.golang.org/grpc/codes
-google.golang.org/grpc/grpclog
-google.golang.org/grpc/status
-google.golang.org/grpc/reflection
-google.golang.org/grpc/metadata
 google.golang.org/grpc/balancer
+google.golang.org/grpc/balancer/base
 google.golang.org/grpc/balancer/roundrobin
+google.golang.org/grpc/binarylog/grpc_binarylog_v1
+google.golang.org/grpc/codes
 google.golang.org/grpc/connectivity
 google.golang.org/grpc/credentials
+google.golang.org/grpc/credentials/internal
 google.golang.org/grpc/encoding
 google.golang.org/grpc/encoding/proto
+google.golang.org/grpc/grpclog
 google.golang.org/grpc/internal
 google.golang.org/grpc/internal/backoff
 google.golang.org/grpc/internal/balancerload
@@ -113,26 +113,26 @@
 google.golang.org/grpc/internal/envconfig
 google.golang.org/grpc/internal/grpcrand
 google.golang.org/grpc/internal/grpcsync
+google.golang.org/grpc/internal/syscall
 google.golang.org/grpc/internal/transport
 google.golang.org/grpc/keepalive
+google.golang.org/grpc/metadata
 google.golang.org/grpc/naming
 google.golang.org/grpc/peer
+google.golang.org/grpc/reflection
+google.golang.org/grpc/reflection/grpc_reflection_v1alpha
 google.golang.org/grpc/resolver
 google.golang.org/grpc/resolver/dns
 google.golang.org/grpc/resolver/passthrough
 google.golang.org/grpc/serviceconfig
 google.golang.org/grpc/stats
+google.golang.org/grpc/status
 google.golang.org/grpc/tap
-google.golang.org/grpc/reflection/grpc_reflection_v1alpha
-google.golang.org/grpc/balancer/base
-google.golang.org/grpc/credentials/internal
-google.golang.org/grpc/binarylog/grpc_binarylog_v1
-google.golang.org/grpc/internal/syscall
 # gopkg.in/yaml.v2 v2.2.2
 gopkg.in/yaml.v2
 # gotest.tools v2.2.0+incompatible
 gotest.tools/assert
 gotest.tools/assert/cmp
+gotest.tools/internal/difflib
 gotest.tools/internal/format
 gotest.tools/internal/source
-gotest.tools/internal/difflib