update package names;
fix licensing;
fix test and lint when run from symlinked path

Change-Id: I87c53e873f88272ee5a25b67774fa361c961a2ef
diff --git a/Makefile b/Makefile
index 4ef3f1c..9c6aa7f 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,29 @@
 $(error "***** Please set your GOPATH environment variable")
 endif
 
-ifneq ($(GOPATH)/src/github.com/ciena/voltctl,$(shell pwd))
-$(warning "***** Your GOPATH environment variable may not be set correctly. Your current directory should be $$GOPATH/src/github.com/ciena/voltctl")
+ifneq ($(GOPATH)/src/github.com/opencord/voltctl,$(shell pwd))
+$(warning "***** Your GOPATH environment variable may not be set correctly. Your current directory should be $$GOPATH/src/github.com/opencord/voltctl")
 endif
 
 help:
 
 internal/pkg/commands/voltha_v1_pb.go: assets/protosets/voltha_v1.pb
-	@echo "package commands" > $@
+	@echo "/*" > $@
+	@echo " * Copyright 2019-present Open Networking Foundation" >> $@
+	@echo " *" >> $@
+	@echo " * Licensed under the Apache License, Version 2.0 (the "License");" >> $@
+	@echo " * you may not use this file except in compliance with the License." >> $@
+	@echo " * You may obtain a copy of the License at" >> $@
+	@echo " *" >> $@
+	@echo " * http://www.apache.org/licenses/LICENSE-2.0" >> $@
+	@echo " *" >> $@
+	@echo " * Unless required by applicable law or agreed to in writing, software" >> $@
+	@echo " * distributed under the License is distributed on an "AS IS" BASIS," >> $@
+	@echo " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied." >> $@
+	@echo " * See the License for the specific language governing permissions and" >> $@
+	@echo " * limitations under the License." >> $@
+	@echo " */" >> $@
+	@echo "package commands" >> $@
 	@echo "" >> $@
 	@echo "var V1Descriptor = []byte{" >> $@
 	hexdump -ve '1/1 "0x%02x,"' assets/protosets/voltha_v1.pb | fold -w 60 -s >> $@
@@ -17,7 +32,22 @@
 	@go fmt $@
 
 internal/pkg/commands/voltha_v2_pb.go: assets/protosets/voltha_v2.pb
-	@echo "package commands" > $@
+	@echo "/*" > $@
+	@echo " * Copyright 2019-present Open Networking Foundation" >> $@
+	@echo " *" >> $@
+	@echo " * Licensed under the Apache License, Version 2.0 (the "License");" >> $@
+	@echo " * you may not use this file except in compliance with the License." >> $@
+	@echo " * You may obtain a copy of the License at" >> $@
+	@echo " *" >> $@
+	@echo " * http://www.apache.org/licenses/LICENSE-2.0" >> $@
+	@echo " *" >> $@
+	@echo " * Unless required by applicable law or agreed to in writing, software" >> $@
+	@echo " * distributed under the License is distributed on an "AS IS" BASIS," >> $@
+	@echo " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied." >> $@
+	@echo " * See the License for the specific language governing permissions and" >> $@
+	@echo " * limitations under the License." >> $@
+	@echo " */" >> $@
+	@echo "package commands" >> $@
 	@echo "" >> $@
 	@echo "var V2Descriptor = []byte{" >> $@
 	hexdump -ve '1/1 "0x%02x,"' assets/protosets/voltha_v2.pb | fold -w 60 -s >> $@
@@ -26,7 +56,7 @@
 
 encode-protosets: internal/pkg/commands/voltha_v1_pb.go internal/pkg/commands/voltha_v2_pb.go
 
-VERSION=$(shell cat $(GOPATH)/src/github.com/ciena/voltctl/VERSION)
+VERSION=$(shell cat $(GOPATH)/src/github.com/opencord/voltctl/VERSION)
 GITCOMMIT=$(shell git rev-parse HEAD)
 ifeq ($(shell git ls-files --others --modified --exclude-standard 2>/dev/null | wc -l | sed -e 's/ //g'),0)
 GITDIRTY=false
@@ -43,13 +73,13 @@
 BUILDTIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
 
 LDFLAGS=-ldflags \
-	'-X "github.com/ciena/voltctl/internal/pkg/cli/version.Version=$(VERSION)"  \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.VcsRef=$(GITCOMMIT)"  \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.VcsDirty=$(GITDIRTY)"  \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.GoVersion=$(GOVERSION)"  \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.Os=$(HOST_OS)" \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.Arch=$(HOST_ARCH)" \
-	 -X "github.com/ciena/voltctl/internal/pkg/cli/version.BuildTime=$(BUILDTIME)"'
+	'-X "github.com/opencord/voltctl/internal/pkg/cli/version.Version=$(VERSION)"  \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.VcsRef=$(GITCOMMIT)"  \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.VcsDirty=$(GITDIRTY)"  \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.GoVersion=$(GOVERSION)"  \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.Os=$(HOST_OS)" \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.Arch=$(HOST_ARCH)" \
+	 -X "github.com/opencord/voltctl/internal/pkg/cli/version.BuildTime=$(BUILDTIME)"'
 
 # Release related items
 # Generates binaries in $RELEASE_DIR with name $RELEASE_NAME-$RELEASE_OS_ARCH
@@ -84,18 +114,24 @@
 	       cmd/voltctl/voltctl.go
 
 run: dependencies
-	GOPATH=$(GOPATH) go run $(LDFLAGS) github.com/ciena/voltctl/cmd/voltctl $(CMD) 
+	GOPATH=$(GOPATH) go run $(LDFLAGS) github.com/opencord/voltctl/cmd/voltctl $(CMD)
 
 lint: dependencies
-	GOPATH=$(GOPATH) find $(GOPATH)/src/github.com/ciena/voltctl -name "*.go" -not -path '$(GOPATH)/src/github.com/ciena/voltctl/vendor/*' | xargs gofmt -l
-	GOPATH=$(GOPATH) go vet github.com/ciena/voltctl/...
+	GOPATH=$(GOPATH) find $(GOPATH)/src/github.com/opencord/voltctl -name "*.go" -not -path '$(GOPATH)/src/github.com/opencord/voltctl/vendor/*' | xargs gofmt -l
+	GOPATH=$(GOPATH) go vet ./...
 	dep check
 
 test: dependencies
-	GOPATH=$(GOPATH) go test $(TEST_ARGS) -cover -coverprofile=voltctl.cp github.com/ciena/voltctl/...
+	@mkdir -p ./tests/results
+	@set +e; \
+	GOPATH=$(GOPATH) go test -v -coverprofile ./tests/results/go-test-coverage.out -covermode count  ./... 2>&1 | tee ./tests/results/go-test-results.out ;\
+	RETURN=$$? ;\
+	go-junit-report < ./tests/results/go-test-results.out > ./tests/results/go-test-results.xml ;\
+	gocover-cobertura < ./tests/results/go-test-coverage.out > ./tests/results/go-test-coverage.xml ;\
+	exit $$RETURN
 
 view-coverage:
-	GOPATH=$(GOPATH) go tool cover -html voltctl.cp
+	GOPATH=$(GOPATH) go tool cover -html ./tests/results/go-test-coverage.out
 
 clean:
 	rm -rf voltctl voltctl.cp release