VOL-3510:Implement Device Management Interface (dmi) on bbsim
Change-Id: If3ff7e8b085b173fd44a37bd005cc2087dff4c63
diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh
index 0e73707..e12024f 100644
--- a/vendor/google.golang.org/grpc/vet.sh
+++ b/vendor/google.golang.org/grpc/vet.sh
@@ -1,20 +1,22 @@
#!/bin/bash
-if [[ `uname -a` = *"Darwin"* ]]; then
- echo "It seems you are running on Mac. This script does not work on Mac. See https://github.com/grpc/grpc-go/issues/2047"
- exit 1
-fi
-
set -ex # Exit on error; debugging enabled.
set -o pipefail # Fail a pipe if any sub-command fails.
+# not makes sure the command passed to it does not exit with a return code of 0.
+not() {
+ # This is required instead of the earlier (! $COMMAND) because subshells and
+ # pipefail don't work the same on Darwin as in Linux.
+ ! "$@"
+}
+
die() {
echo "$@" >&2
exit 1
}
fail_on_output() {
- tee /dev/stderr | (! read)
+ tee /dev/stderr | not read
}
# Check to make sure it's safe to modify the user's git repo.
@@ -60,7 +62,7 @@
unzip ${PROTOC_FILENAME}
bin/protoc --version
popd
- elif ! which protoc > /dev/null; then
+ elif not which protoc > /dev/null; then
die "Please install protoc into your path"
fi
fi
@@ -70,21 +72,21 @@
fi
# - Ensure all source files contain a copyright message.
-(! git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go')
+not git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go'
# - Make sure all tests in grpc and grpc/test use leakcheck via Teardown.
-(! grep 'func Test[^(]' *_test.go)
-(! grep 'func Test[^(]' test/*.go)
+not grep 'func Test[^(]' *_test.go
+not grep 'func Test[^(]' test/*.go
# - Do not import x/net/context.
-(! git grep -l 'x/net/context' -- "*.go")
+not git grep -l 'x/net/context' -- "*.go"
# - Do not import math/rand for real library code. Use internal/grpcrand for
# thread safety.
-git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test')
+git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test'
# - Ensure all ptypes proto packages are renamed when importing.
-(! git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go")
+not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go"
# - Check imports that are illegal in appengine (until Go 1.11).
# TODO: Remove when we drop Go 1.10 support
@@ -92,9 +94,9 @@
# - gofmt, goimports, golint (with exceptions for generated code), go vet.
gofmt -s -d -l . 2>&1 | fail_on_output
-goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go")
-golint ./... 2>&1 | (! grep -vE "(_mock|\.pb)\.go:")
-go vet -all .
+goimports -l . 2>&1 | not grep -vE "(_mock|\.pb)\.go"
+golint ./... 2>&1 | not grep -vE "(_mock|\.pb)\.go:"
+go vet -all ./...
misspell -error .
@@ -119,9 +121,9 @@
SC_OUT="$(mktemp)"
staticcheck -go 1.9 -checks 'inherit,-ST1015' ./... > "${SC_OUT}" || true
# Error if anything other than deprecation warnings are printed.
-(! grep -v "is deprecated:.*SA1019" "${SC_OUT}")
+not grep -v "is deprecated:.*SA1019" "${SC_OUT}"
# Only ignore the following deprecated types/fields/functions.
-(! grep -Fv '.HandleResolvedAddrs
+not grep -Fv '.HandleResolvedAddrs
.HandleSubConnStateChange
.HeaderMap
.NewAddress
@@ -151,9 +153,11 @@
grpc.WithServiceConfig
grpc.WithTimeout
http.CloseNotifier
+info.SecurityVersion
naming.Resolver
naming.Update
naming.Watcher
resolver.Backend
resolver.GRPCLB' "${SC_OUT}"
-)
+
+echo SUCCESS