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
diff --git a/cmd/voltctl/voltctl.go b/cmd/voltctl/voltctl.go
index d8e227f..5469cd0 100644
--- a/cmd/voltctl/voltctl.go
+++ b/cmd/voltctl/voltctl.go
@@ -16,8 +16,8 @@
package main
import (
- "github.com/ciena/voltctl/internal/pkg/commands"
flags "github.com/jessevdk/go-flags"
+ "github.com/opencord/voltctl/internal/pkg/commands"
"os"
"path"
)
diff --git a/internal/pkg/commands/adapter.go b/internal/pkg/commands/adapter.go
index 5b372a1..e848565 100644
--- a/internal/pkg/commands/adapter.go
+++ b/internal/pkg/commands/adapter.go
@@ -17,11 +17,11 @@
import (
"context"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
"github.com/fullstorydev/grpcurl"
flags "github.com/jessevdk/go-flags"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
)
const (
diff --git a/internal/pkg/commands/command.go b/internal/pkg/commands/command.go
index 2672f19..43ead45 100644
--- a/internal/pkg/commands/command.go
+++ b/internal/pkg/commands/command.go
@@ -18,9 +18,9 @@
import (
"encoding/json"
"fmt"
- "github.com/ciena/voltctl/pkg/filter"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/order"
+ "github.com/opencord/voltctl/pkg/filter"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/order"
"google.golang.org/grpc"
"gopkg.in/yaml.v2"
"io/ioutil"
diff --git a/internal/pkg/commands/completion.go b/internal/pkg/commands/completion.go
index 3299a65..c044b6a 100644
--- a/internal/pkg/commands/completion.go
+++ b/internal/pkg/commands/completion.go
@@ -17,8 +17,8 @@
import (
"fmt"
- "github.com/ciena/voltctl/internal/pkg/completion"
flags "github.com/jessevdk/go-flags"
+ "github.com/opencord/voltctl/internal/pkg/completion"
)
type BashOptions struct{}
diff --git a/internal/pkg/commands/components.go b/internal/pkg/commands/components.go
index 0f5bb76..2de4ee7 100644
--- a/internal/pkg/commands/components.go
+++ b/internal/pkg/commands/components.go
@@ -17,9 +17,9 @@
import (
"fmt"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
flags "github.com/jessevdk/go-flags"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
diff --git a/internal/pkg/commands/devicegroups.go b/internal/pkg/commands/devicegroups.go
index 0bec3ac..c499afc 100644
--- a/internal/pkg/commands/devicegroups.go
+++ b/internal/pkg/commands/devicegroups.go
@@ -17,11 +17,11 @@
import (
"context"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
"github.com/fullstorydev/grpcurl"
flags "github.com/jessevdk/go-flags"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
)
const (
diff --git a/internal/pkg/commands/devices.go b/internal/pkg/commands/devices.go
index a6836cf..9f836b4 100644
--- a/internal/pkg/commands/devices.go
+++ b/internal/pkg/commands/devices.go
@@ -18,11 +18,11 @@
import (
"context"
"fmt"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
"github.com/fullstorydev/grpcurl"
flags "github.com/jessevdk/go-flags"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
"strings"
)
diff --git a/internal/pkg/commands/flows.go b/internal/pkg/commands/flows.go
index 55766b0..ccdfc05 100644
--- a/internal/pkg/commands/flows.go
+++ b/internal/pkg/commands/flows.go
@@ -18,10 +18,10 @@
import (
"context"
"fmt"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
"github.com/fullstorydev/grpcurl"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
"sort"
"strings"
)
diff --git a/internal/pkg/commands/logicaldevices.go b/internal/pkg/commands/logicaldevices.go
index 91bd7e1..ce09035 100644
--- a/internal/pkg/commands/logicaldevices.go
+++ b/internal/pkg/commands/logicaldevices.go
@@ -18,11 +18,11 @@
import (
"context"
"fmt"
- "github.com/ciena/voltctl/pkg/format"
- "github.com/ciena/voltctl/pkg/model"
"github.com/fullstorydev/grpcurl"
flags "github.com/jessevdk/go-flags"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/pkg/format"
+ "github.com/opencord/voltctl/pkg/model"
"strings"
)
diff --git a/internal/pkg/commands/version.go b/internal/pkg/commands/version.go
index 0d1f280..1ca0fbf 100644
--- a/internal/pkg/commands/version.go
+++ b/internal/pkg/commands/version.go
@@ -18,11 +18,11 @@
import (
"context"
"encoding/json"
- "github.com/ciena/voltctl/internal/pkg/cli/version"
- "github.com/ciena/voltctl/pkg/format"
"github.com/fullstorydev/grpcurl"
flags "github.com/jessevdk/go-flags"
"github.com/jhump/protoreflect/dynamic"
+ "github.com/opencord/voltctl/internal/pkg/cli/version"
+ "github.com/opencord/voltctl/pkg/format"
"strings"
)
diff --git a/internal/pkg/commands/voltha_v1_pb.go b/internal/pkg/commands/voltha_v1_pb.go
index 8d8e8b8..e57bf55 100644
--- a/internal/pkg/commands/voltha_v1_pb.go
+++ b/internal/pkg/commands/voltha_v1_pb.go
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * 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.
+ */
package commands
var V1Descriptor = []byte{
diff --git a/internal/pkg/commands/voltha_v2_pb.go b/internal/pkg/commands/voltha_v2_pb.go
index 022e360..3e83596 100644
--- a/internal/pkg/commands/voltha_v2_pb.go
+++ b/internal/pkg/commands/voltha_v2_pb.go
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * 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.
+ */
package commands
var V2Descriptor = []byte{
diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_test.go
index c4c02f5..3a718e0 100644
--- a/pkg/filter/filter_test.go
+++ b/pkg/filter/filter_test.go
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * 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.
+ */
+
package filter
import (
diff --git a/pkg/order/order_test.go b/pkg/order/order_test.go
index 484d0a6..eba6fe2 100644
--- a/pkg/order/order_test.go
+++ b/pkg/order/order_test.go
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * 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.
+ */
+
package order
import (