From cf505c925898755ae6a3144b5849bc60387a97f5 Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Fri, 28 Apr 2017 12:48:42 -0400 Subject: [PATCH 1/3] build/test: some fixups for the google import. * Fix TestEnvironment::runfilesDirectory() to use TEST_RUNDIR, rather than the other way around. * Remove use of diff -Z in hotrestart_test, since it's not needed and isn't supported by all versions of diff. * Add license directives to all files. --- BUILD | 1 + bazel/BUILD | 2 ++ ci/build_container/BUILD | 2 ++ ci/build_container/build_recipes/BUILD | 2 ++ ci/prebuilt/BUILD | 2 ++ configs/BUILD | 2 ++ examples/BUILD | 2 ++ include/envoy/access_log/BUILD | 2 ++ include/envoy/api/BUILD | 2 ++ include/envoy/buffer/BUILD | 2 ++ include/envoy/common/BUILD | 2 ++ include/envoy/event/BUILD | 2 ++ include/envoy/filesystem/BUILD | 2 ++ include/envoy/grpc/BUILD | 2 ++ include/envoy/http/BUILD | 2 ++ include/envoy/init/BUILD | 2 ++ include/envoy/json/BUILD | 2 ++ include/envoy/local_info/BUILD | 2 ++ include/envoy/mongo/BUILD | 2 ++ include/envoy/network/BUILD | 2 ++ include/envoy/ratelimit/BUILD | 2 ++ include/envoy/redis/BUILD | 2 ++ include/envoy/router/BUILD | 2 ++ include/envoy/runtime/BUILD | 2 ++ include/envoy/server/BUILD | 2 ++ include/envoy/ssl/BUILD | 2 ++ include/envoy/stats/BUILD | 2 ++ include/envoy/thread/BUILD | 2 ++ include/envoy/thread_local/BUILD | 2 ++ include/envoy/tracing/BUILD | 2 ++ include/envoy/upstream/BUILD | 2 ++ source/common/access_log/BUILD | 2 ++ source/common/api/BUILD | 2 ++ source/common/buffer/BUILD | 2 ++ source/common/common/BUILD | 2 ++ source/common/dynamo/BUILD | 2 ++ source/common/event/BUILD | 2 ++ source/common/filesystem/BUILD | 2 ++ source/common/filter/BUILD | 2 ++ source/common/filter/auth/BUILD | 2 ++ source/common/grpc/BUILD | 2 ++ source/common/http/BUILD | 2 ++ source/common/http/access_log/BUILD | 2 ++ source/common/http/filter/BUILD | 2 ++ source/common/http/http1/BUILD | 2 ++ source/common/http/http2/BUILD | 2 ++ source/common/json/BUILD | 2 ++ source/common/local_info/BUILD | 2 ++ source/common/memory/BUILD | 2 ++ source/common/mongo/BUILD | 2 ++ source/common/network/BUILD | 2 ++ source/common/profiler/BUILD | 2 ++ source/common/ratelimit/BUILD | 2 ++ source/common/redis/BUILD | 2 ++ source/common/router/BUILD | 2 ++ source/common/runtime/BUILD | 2 ++ source/common/ssl/BUILD | 2 ++ source/common/stats/BUILD | 2 ++ source/common/thread_local/BUILD | 2 ++ source/common/tracing/BUILD | 2 ++ source/common/upstream/BUILD | 2 ++ source/exe/BUILD | 2 ++ source/server/BUILD | 2 ++ source/server/config/http/BUILD | 2 ++ source/server/config/network/BUILD | 2 ++ source/server/http/BUILD | 2 ++ test/BUILD | 2 ++ test/common/access_log/BUILD | 2 ++ test/common/api/BUILD | 2 ++ test/common/common/BUILD | 2 ++ test/common/dynamo/BUILD | 2 ++ test/common/event/BUILD | 2 ++ test/common/filesystem/BUILD | 2 ++ test/common/filter/BUILD | 2 ++ test/common/filter/auth/BUILD | 2 ++ test/common/grpc/BUILD | 2 ++ test/common/http/BUILD | 2 ++ test/common/http/access_log/BUILD | 2 ++ test/common/http/filter/BUILD | 2 ++ test/common/http/http1/BUILD | 2 ++ test/common/http/http2/BUILD | 2 ++ test/common/json/BUILD | 2 ++ test/common/json/config_schemas_test_data/BUILD | 2 ++ test/common/mongo/BUILD | 2 ++ test/common/network/BUILD | 2 ++ test/common/ratelimit/BUILD | 2 ++ test/common/redis/BUILD | 2 ++ test/common/router/BUILD | 2 ++ test/common/runtime/BUILD | 2 ++ test/common/ssl/BUILD | 2 ++ test/common/ssl/test_data/BUILD | 2 ++ test/common/stats/BUILD | 2 ++ test/common/tracing/BUILD | 2 ++ test/common/upstream/BUILD | 2 ++ test/config/integration/BUILD | 2 ++ test/config/integration/certs/BUILD | 2 ++ test/config_test/BUILD | 2 ++ test/exe/BUILD | 2 ++ test/integration/BUILD | 2 ++ test/integration/hotrestart_test.sh | 4 ++-- test/main.cc | 4 +++- test/mocks/BUILD | 2 ++ test/mocks/access_log/BUILD | 2 ++ test/mocks/api/BUILD | 2 ++ test/mocks/buffer/BUILD | 2 ++ test/mocks/event/BUILD | 2 ++ test/mocks/filesystem/BUILD | 2 ++ test/mocks/grpc/BUILD | 2 ++ test/mocks/http/BUILD | 2 ++ test/mocks/init/BUILD | 2 ++ test/mocks/local_info/BUILD | 2 ++ test/mocks/network/BUILD | 2 ++ test/mocks/ratelimit/BUILD | 2 ++ test/mocks/redis/BUILD | 2 ++ test/mocks/router/BUILD | 2 ++ test/mocks/runtime/BUILD | 2 ++ test/mocks/server/BUILD | 2 ++ test/mocks/ssl/BUILD | 2 ++ test/mocks/stats/BUILD | 2 ++ test/mocks/thread_local/BUILD | 2 ++ test/mocks/tracing/BUILD | 2 ++ test/mocks/upstream/BUILD | 2 ++ test/proto/BUILD | 2 ++ test/server/BUILD | 2 ++ test/server/config/http/BUILD | 2 ++ test/server/config/network/BUILD | 2 ++ test/server/http/BUILD | 2 ++ test/test_common/BUILD | 2 ++ test/test_common/environment.cc | 17 ++++++++--------- test/test_common/environment.h | 6 ++++++ test/tools/router_check/BUILD | 2 ++ test/tools/router_check/json/BUILD | 2 ++ test/tools/router_check/test/BUILD | 2 ++ tools/BUILD | 2 ++ 134 files changed, 278 insertions(+), 12 deletions(-) diff --git a/BUILD b/BUILD index e69de29bb2d1d..779d1695d3b7c 100644 --- a/BUILD +++ b/BUILD @@ -0,0 +1 @@ +licenses(["notice"]) # Apache 2 diff --git a/bazel/BUILD b/bazel/BUILD index 64474a35ddb95..3a88d84ac3373 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + package(default_visibility = ["//visibility:public"]) exports_files([ diff --git a/ci/build_container/BUILD b/ci/build_container/BUILD index 64405a4106f6d..9c7fd8d73f9a9 100644 --- a/ci/build_container/BUILD +++ b/ci/build_container/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/ci/build_container/build_recipes/BUILD b/ci/build_container/build_recipes/BUILD index 67a90527d8394..4678729957f0c 100644 --- a/ci/build_container/build_recipes/BUILD +++ b/ci/build_container/build_recipes/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/ci/prebuilt/BUILD b/ci/prebuilt/BUILD index 53dc4ff4b374c..bfe5796ab0523 100644 --- a/ci/prebuilt/BUILD +++ b/ci/prebuilt/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/configs/BUILD b/configs/BUILD index e0402e85c2755..50774a9d4610d 100644 --- a/configs/BUILD +++ b/configs/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/examples/BUILD b/examples/BUILD index f1dc97d56b5f3..23c50f75f6c1f 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/include/envoy/access_log/BUILD b/include/envoy/access_log/BUILD index 295e52b02de58..44e37955a3cd5 100644 --- a/include/envoy/access_log/BUILD +++ b/include/envoy/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/api/BUILD b/include/envoy/api/BUILD index 588b64209891d..06105e6188241 100644 --- a/include/envoy/api/BUILD +++ b/include/envoy/api/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/buffer/BUILD b/include/envoy/buffer/BUILD index 2a11a0e5a59ed..084ed91ebf24f 100644 --- a/include/envoy/buffer/BUILD +++ b/include/envoy/buffer/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/common/BUILD b/include/envoy/common/BUILD index 658055793f3b5..9d86b6ac6f3bf 100644 --- a/include/envoy/common/BUILD +++ b/include/envoy/common/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/event/BUILD b/include/envoy/event/BUILD index 316407a91dd87..670a23683ea93 100644 --- a/include/envoy/event/BUILD +++ b/include/envoy/event/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/filesystem/BUILD b/include/envoy/filesystem/BUILD index 618787f55d65e..f1ec7b079e033 100644 --- a/include/envoy/filesystem/BUILD +++ b/include/envoy/filesystem/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/grpc/BUILD b/include/envoy/grpc/BUILD index b8f9d6b3d0703..e8d0855242f8b 100644 --- a/include/envoy/grpc/BUILD +++ b/include/envoy/grpc/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/http/BUILD b/include/envoy/http/BUILD index 971b0576787c2..df656c13ec1fc 100644 --- a/include/envoy/http/BUILD +++ b/include/envoy/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/init/BUILD b/include/envoy/init/BUILD index 6d282ef0a6c58..cfa069239b96f 100644 --- a/include/envoy/init/BUILD +++ b/include/envoy/init/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/json/BUILD b/include/envoy/json/BUILD index f148a34ad5f1a..89c21942185a4 100644 --- a/include/envoy/json/BUILD +++ b/include/envoy/json/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/local_info/BUILD b/include/envoy/local_info/BUILD index db2d95df33dfe..0c576e36cd602 100644 --- a/include/envoy/local_info/BUILD +++ b/include/envoy/local_info/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/mongo/BUILD b/include/envoy/mongo/BUILD index eb8784f6ce350..67bce936d3757 100644 --- a/include/envoy/mongo/BUILD +++ b/include/envoy/mongo/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/network/BUILD b/include/envoy/network/BUILD index 163eaf5ae4454..270a45cf96f6e 100644 --- a/include/envoy/network/BUILD +++ b/include/envoy/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/ratelimit/BUILD b/include/envoy/ratelimit/BUILD index eda2b8e3396bc..e9f796598b2a4 100644 --- a/include/envoy/ratelimit/BUILD +++ b/include/envoy/ratelimit/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/redis/BUILD b/include/envoy/redis/BUILD index 993f24e315c09..ec0de4d1444c3 100644 --- a/include/envoy/redis/BUILD +++ b/include/envoy/redis/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/router/BUILD b/include/envoy/router/BUILD index 85b3461d0576a..b5225af034fef 100644 --- a/include/envoy/router/BUILD +++ b/include/envoy/router/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/runtime/BUILD b/include/envoy/runtime/BUILD index c2dedcf2d2b51..b0ac6abca285a 100644 --- a/include/envoy/runtime/BUILD +++ b/include/envoy/runtime/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/server/BUILD b/include/envoy/server/BUILD index a53c6549d18a1..bccdaef807374 100644 --- a/include/envoy/server/BUILD +++ b/include/envoy/server/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/ssl/BUILD b/include/envoy/ssl/BUILD index 1902346c94056..f6b94ea22bd9a 100644 --- a/include/envoy/ssl/BUILD +++ b/include/envoy/ssl/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/stats/BUILD b/include/envoy/stats/BUILD index de7d331ccc1b7..5ed8d0a807171 100644 --- a/include/envoy/stats/BUILD +++ b/include/envoy/stats/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/thread/BUILD b/include/envoy/thread/BUILD index 770c6a89d8749..e4908ace36f39 100644 --- a/include/envoy/thread/BUILD +++ b/include/envoy/thread/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/thread_local/BUILD b/include/envoy/thread_local/BUILD index 41f93b5afc917..d5fbfb396718b 100644 --- a/include/envoy/thread_local/BUILD +++ b/include/envoy/thread_local/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/tracing/BUILD b/include/envoy/tracing/BUILD index a4be1b7a044cd..b56162b6826d8 100644 --- a/include/envoy/tracing/BUILD +++ b/include/envoy/tracing/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/include/envoy/upstream/BUILD b/include/envoy/upstream/BUILD index 412ed6183ebbd..77dd3fe7fef3c 100644 --- a/include/envoy/upstream/BUILD +++ b/include/envoy/upstream/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/access_log/BUILD b/source/common/access_log/BUILD index 06057dfd98726..f2e3237c87b6f 100644 --- a/source/common/access_log/BUILD +++ b/source/common/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/api/BUILD b/source/common/api/BUILD index 26f08cf5ef30b..20603858e2fdb 100644 --- a/source/common/api/BUILD +++ b/source/common/api/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/buffer/BUILD b/source/common/buffer/BUILD index d32d1764de18e..8752531a62b83 100644 --- a/source/common/buffer/BUILD +++ b/source/common/buffer/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/common/BUILD b/source/common/common/BUILD index eeed5c52cc3ba..7eb6ca5291f7a 100644 --- a/source/common/common/BUILD +++ b/source/common/common/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/dynamo/BUILD b/source/common/dynamo/BUILD index 8e2ecf5f17e39..6936833f6aa2d 100644 --- a/source/common/dynamo/BUILD +++ b/source/common/dynamo/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/event/BUILD b/source/common/event/BUILD index 2ada8dd1839cb..72b2a3b33828a 100644 --- a/source/common/event/BUILD +++ b/source/common/event/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/filesystem/BUILD b/source/common/filesystem/BUILD index 7ab4102c99f0d..e8fee8c73b2ea 100644 --- a/source/common/filesystem/BUILD +++ b/source/common/filesystem/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/filter/BUILD b/source/common/filter/BUILD index 5dfc363edf1eb..6c5caadc901b4 100644 --- a/source/common/filter/BUILD +++ b/source/common/filter/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/filter/auth/BUILD b/source/common/filter/auth/BUILD index eb82361919ab6..06da99b813ce2 100644 --- a/source/common/filter/auth/BUILD +++ b/source/common/filter/auth/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/grpc/BUILD b/source/common/grpc/BUILD index 574cf84b0c661..f4f1b6c13e119 100644 --- a/source/common/grpc/BUILD +++ b/source/common/grpc/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/http/BUILD b/source/common/http/BUILD index efcdfdb37cf57..ee0e8ca4743cc 100644 --- a/source/common/http/BUILD +++ b/source/common/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/http/access_log/BUILD b/source/common/http/access_log/BUILD index 7c92e0d8bd71c..8d069a7c21b57 100644 --- a/source/common/http/access_log/BUILD +++ b/source/common/http/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/http/filter/BUILD b/source/common/http/filter/BUILD index 497930173cebd..d01ea3ca42076 100644 --- a/source/common/http/filter/BUILD +++ b/source/common/http/filter/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/http/http1/BUILD b/source/common/http/http1/BUILD index 5fbd7712d569c..ae14242637ecb 100644 --- a/source/common/http/http1/BUILD +++ b/source/common/http/http1/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/http/http2/BUILD b/source/common/http/http2/BUILD index 124079e4d7fae..247c8c06ecdb0 100644 --- a/source/common/http/http2/BUILD +++ b/source/common/http/http2/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/json/BUILD b/source/common/json/BUILD index bdb5d7bdf448d..590a783ececac 100644 --- a/source/common/json/BUILD +++ b/source/common/json/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/local_info/BUILD b/source/common/local_info/BUILD index 539c135f7a777..76334e2d44ead 100644 --- a/source/common/local_info/BUILD +++ b/source/common/local_info/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/memory/BUILD b/source/common/memory/BUILD index 320018709ff73..30e2487125960 100644 --- a/source/common/memory/BUILD +++ b/source/common/memory/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/mongo/BUILD b/source/common/mongo/BUILD index 61fdf90361127..3c600139f7e17 100644 --- a/source/common/mongo/BUILD +++ b/source/common/mongo/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/network/BUILD b/source/common/network/BUILD index a576dfe951147..be48c5eb2b5d8 100644 --- a/source/common/network/BUILD +++ b/source/common/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/profiler/BUILD b/source/common/profiler/BUILD index 07a18fe90c8ef..c853cfea30c39 100644 --- a/source/common/profiler/BUILD +++ b/source/common/profiler/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/ratelimit/BUILD b/source/common/ratelimit/BUILD index 3293b82793364..a60bfb2bf1db4 100644 --- a/source/common/ratelimit/BUILD +++ b/source/common/ratelimit/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/redis/BUILD b/source/common/redis/BUILD index 32c56d134105a..f1be6dabf374e 100644 --- a/source/common/redis/BUILD +++ b/source/common/redis/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/router/BUILD b/source/common/router/BUILD index 0d1a3579763ab..d91f5a8c68585 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/runtime/BUILD b/source/common/runtime/BUILD index 154602358d1b0..42ede0d891c51 100644 --- a/source/common/runtime/BUILD +++ b/source/common/runtime/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/ssl/BUILD b/source/common/ssl/BUILD index 7148deb7a4094..4622bc03112bc 100644 --- a/source/common/ssl/BUILD +++ b/source/common/ssl/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/stats/BUILD b/source/common/stats/BUILD index 6babe318acfc3..fc5c56157019b 100644 --- a/source/common/stats/BUILD +++ b/source/common/stats/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/thread_local/BUILD b/source/common/thread_local/BUILD index eaa5967f583d7..79ca1161e0e07 100644 --- a/source/common/thread_local/BUILD +++ b/source/common/thread_local/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/tracing/BUILD b/source/common/tracing/BUILD index 64113a35fcb85..4fe2004c8b270 100644 --- a/source/common/tracing/BUILD +++ b/source/common/tracing/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/common/upstream/BUILD b/source/common/upstream/BUILD index 0afb8e2401342..4ff71b81fb3af 100644 --- a/source/common/upstream/BUILD +++ b/source/common/upstream/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/exe/BUILD b/source/exe/BUILD index ff429669ca339..41b8f5f0334c4 100644 --- a/source/exe/BUILD +++ b/source/exe/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_binary", diff --git a/source/server/BUILD b/source/server/BUILD index b34defa76aa57..ef72b4f7da889 100644 --- a/source/server/BUILD +++ b/source/server/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/server/config/http/BUILD b/source/server/config/http/BUILD index a0762d496cdf2..49800b12c3492 100644 --- a/source/server/config/http/BUILD +++ b/source/server/config/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/server/config/network/BUILD b/source/server/config/network/BUILD index cea790de6f3b3..6f91b01905345 100644 --- a/source/server/config/network/BUILD +++ b/source/server/config/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/source/server/http/BUILD b/source/server/http/BUILD index 7a6690b4e4222..bc4e6d643150b 100644 --- a/source/server/http/BUILD +++ b/source/server/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/test/BUILD b/test/BUILD index 50a63d4f51891..ccfb9691b2fa4 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test_library", diff --git a/test/common/access_log/BUILD b/test/common/access_log/BUILD index 9aa401204dd48..516ca06caadd4 100644 --- a/test/common/access_log/BUILD +++ b/test/common/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/api/BUILD b/test/common/api/BUILD index 1221802fcb811..0144845cbf774 100644 --- a/test/common/api/BUILD +++ b/test/common/api/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/common/BUILD b/test/common/common/BUILD index 2b56669a12a13..ed63418027d05 100644 --- a/test/common/common/BUILD +++ b/test/common/common/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/dynamo/BUILD b/test/common/dynamo/BUILD index 74e1275e09233..89b8760869ad5 100644 --- a/test/common/dynamo/BUILD +++ b/test/common/dynamo/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/event/BUILD b/test/common/event/BUILD index 7348783eb7274..7e3153c20d69a 100644 --- a/test/common/event/BUILD +++ b/test/common/event/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/filesystem/BUILD b/test/common/filesystem/BUILD index 169eeac4f362d..95388c7b20dbe 100644 --- a/test/common/filesystem/BUILD +++ b/test/common/filesystem/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/filter/BUILD b/test/common/filter/BUILD index 9b76a2c84b99b..b2eeb0e6091ef 100644 --- a/test/common/filter/BUILD +++ b/test/common/filter/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/filter/auth/BUILD b/test/common/filter/auth/BUILD index de2d45cebcfcd..690b9059fd78d 100644 --- a/test/common/filter/auth/BUILD +++ b/test/common/filter/auth/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/grpc/BUILD b/test/common/grpc/BUILD index 677da12c7d373..37b39fb54d7a7 100644 --- a/test/common/grpc/BUILD +++ b/test/common/grpc/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/http/BUILD b/test/common/http/BUILD index 1ee3aeceae911..dd7ab12537341 100644 --- a/test/common/http/BUILD +++ b/test/common/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/http/access_log/BUILD b/test/common/http/access_log/BUILD index 18fc4522b9b33..9b044a0d13734 100644 --- a/test/common/http/access_log/BUILD +++ b/test/common/http/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/http/filter/BUILD b/test/common/http/filter/BUILD index cb60753766760..ce7884d17176c 100644 --- a/test/common/http/filter/BUILD +++ b/test/common/http/filter/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/http/http1/BUILD b/test/common/http/http1/BUILD index 76a1f41d7e07a..8eb90fe55c5fc 100644 --- a/test/common/http/http1/BUILD +++ b/test/common/http/http1/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/http/http2/BUILD b/test/common/http/http2/BUILD index 140e8392b2b81..a9a3144bc506b 100644 --- a/test/common/http/http2/BUILD +++ b/test/common/http/http2/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/json/BUILD b/test/common/json/BUILD index c54c8098b54e9..88d5229dd10d4 100644 --- a/test/common/json/BUILD +++ b/test/common/json/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/json/config_schemas_test_data/BUILD b/test/common/json/config_schemas_test_data/BUILD index 2f30d5be34410..603cfa6adcca7 100644 --- a/test/common/json/config_schemas_test_data/BUILD +++ b/test/common/json/config_schemas_test_data/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/common/mongo/BUILD b/test/common/mongo/BUILD index 4c372ef254405..801d3edb00f2c 100644 --- a/test/common/mongo/BUILD +++ b/test/common/mongo/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/network/BUILD b/test/common/network/BUILD index 59fc1c3f795f2..bd93a3dd11bfa 100644 --- a/test/common/network/BUILD +++ b/test/common/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/ratelimit/BUILD b/test/common/ratelimit/BUILD index 025171226b9c8..29dcdbd7e9acf 100644 --- a/test/common/ratelimit/BUILD +++ b/test/common/ratelimit/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/redis/BUILD b/test/common/redis/BUILD index 30021830f95a6..2218b14d89642 100644 --- a/test/common/redis/BUILD +++ b/test/common/redis/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/router/BUILD b/test/common/router/BUILD index 3257dbf47221d..047ac27a0dc54 100644 --- a/test/common/router/BUILD +++ b/test/common/router/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/runtime/BUILD b/test/common/runtime/BUILD index 0a12153138b94..43e33097f0105 100644 --- a/test/common/runtime/BUILD +++ b/test/common/runtime/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/ssl/BUILD b/test/common/ssl/BUILD index 2bfdf91c3089d..424b298b81bdd 100644 --- a/test/common/ssl/BUILD +++ b/test/common/ssl/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/ssl/test_data/BUILD b/test/common/ssl/test_data/BUILD index 3be7faec45338..bec308fd6be6f 100644 --- a/test/common/ssl/test_data/BUILD +++ b/test/common/ssl/test_data/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/common/stats/BUILD b/test/common/stats/BUILD index bceb91e68459c..863a4477338e3 100644 --- a/test/common/stats/BUILD +++ b/test/common/stats/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/tracing/BUILD b/test/common/tracing/BUILD index e7872a46e6176..1f525bd0e2dde 100644 --- a/test/common/tracing/BUILD +++ b/test/common/tracing/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/common/upstream/BUILD b/test/common/upstream/BUILD index 89344e63301a2..262e0bd843c12 100644 --- a/test/common/upstream/BUILD +++ b/test/common/upstream/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/config/integration/BUILD b/test/config/integration/BUILD index e5ef8aa75d0f2..22c94a7596edc 100644 --- a/test/config/integration/BUILD +++ b/test/config/integration/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/config/integration/certs/BUILD b/test/config/integration/certs/BUILD index 0094262845829..3e7bb3b4b4f2e 100644 --- a/test/config/integration/certs/BUILD +++ b/test/config/integration/certs/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/config_test/BUILD b/test/config_test/BUILD index 67dd2e5ef5ab4..1cdd8530f876a 100644 --- a/test/config_test/BUILD +++ b/test/config_test/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/exe/BUILD b/test/exe/BUILD index 9b2d36eaac2c5..afd99286af1c4 100644 --- a/test/exe/BUILD +++ b/test/exe/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/integration/BUILD b/test/integration/BUILD index 38f64147fb731..f2d3249ee7a27 100644 --- a/test/integration/BUILD +++ b/test/integration/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/integration/hotrestart_test.sh b/test/integration/hotrestart_test.sh index e86637cfb7d4d..da912fa76b90a 100755 --- a/test/integration/hotrestart_test.sh +++ b/test/integration/hotrestart_test.sh @@ -50,7 +50,7 @@ echo "Checking that listener addresses have not changed" HOT_RESTART_JSON_1="${TEST_TMPDIR}"/hot_restart_1.json "${TEST_RUNDIR}"/tools/socket_passing.py "-o" "${UPDATED_HOT_RESTART_JSON}" "-a" "${ADMIN_ADDRESS_PATH_1}" \ "-u" "${HOT_RESTART_JSON_1}" -CONFIG_DIFF=$(diff -Z "${UPDATED_HOT_RESTART_JSON}" "${HOT_RESTART_JSON_1}") +CONFIG_DIFF=$(diff "${UPDATED_HOT_RESTART_JSON}" "${HOT_RESTART_JSON_1}") [[ -z "${CONFIG_DIFF}" ]] ADMIN_ADDRESS_PATH_2="${TEST_TMPDIR}"/admin_2.address @@ -66,7 +66,7 @@ echo "Checking that listener addresses have not changed" HOT_RESTART_JSON_2="${TEST_TMPDIR}"/hot_restart_2.json "${TEST_RUNDIR}"/tools/socket_passing.py "-o" "${UPDATED_HOT_RESTART_JSON}" "-a" "${ADMIN_ADDRESS_PATH_2}" \ "-u" "${HOT_RESTART_JSON_2}" -CONFIG_DIFF=$(diff -Z "${UPDATED_HOT_RESTART_JSON}" "${HOT_RESTART_JSON_2}") +CONFIG_DIFF=$(diff "${UPDATED_HOT_RESTART_JSON}" "${HOT_RESTART_JSON_2}") [[ -z "${CONFIG_DIFF}" ]] # First server should already be gone. diff --git a/test/main.cc b/test/main.cc index be7651f891322..85cd64a99f962 100644 --- a/test/main.cc +++ b/test/main.cc @@ -4,6 +4,8 @@ // The main entry point (and the rest of this file) should have no logic in it, // this allows overriding by site specific versions of main.cc. int main(int argc, char** argv) { - ::setenv("TEST_RUNDIR", TestEnvironment::runfilesDirectory().c_str(), 1); + ::setenv("TEST_RUNDIR", (TestEnvironment::getCheckedEnvVar("TEST_SRCDIR") + "/" + + TestEnvironment::getCheckedEnvVar("TEST_WORKSPACE")).c_str(), + 1); return TestRunner::RunTests(argc, argv); } diff --git a/test/mocks/BUILD b/test/mocks/BUILD index 525540533b7cc..aafea79471e1e 100644 --- a/test/mocks/BUILD +++ b/test/mocks/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test_library", diff --git a/test/mocks/access_log/BUILD b/test/mocks/access_log/BUILD index d86c374c113cd..afe9d42d3ac5f 100644 --- a/test/mocks/access_log/BUILD +++ b/test/mocks/access_log/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/api/BUILD b/test/mocks/api/BUILD index b11dd1bc5a854..95968c879a5aa 100644 --- a/test/mocks/api/BUILD +++ b/test/mocks/api/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/buffer/BUILD b/test/mocks/buffer/BUILD index 00f3d6e4fcc62..1a54634651e69 100644 --- a/test/mocks/buffer/BUILD +++ b/test/mocks/buffer/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/event/BUILD b/test/mocks/event/BUILD index 95e30e4d25f80..ddca9673bc387 100644 --- a/test/mocks/event/BUILD +++ b/test/mocks/event/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/filesystem/BUILD b/test/mocks/filesystem/BUILD index 285136144d9e1..edb14369c6b31 100644 --- a/test/mocks/filesystem/BUILD +++ b/test/mocks/filesystem/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/grpc/BUILD b/test/mocks/grpc/BUILD index 299c3344df33e..08552031d52fa 100644 --- a/test/mocks/grpc/BUILD +++ b/test/mocks/grpc/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/http/BUILD b/test/mocks/http/BUILD index e7ece190565dd..77944ae0e65a7 100644 --- a/test/mocks/http/BUILD +++ b/test/mocks/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/init/BUILD b/test/mocks/init/BUILD index 93a9cbc43f10d..682c862e1a4e7 100644 --- a/test/mocks/init/BUILD +++ b/test/mocks/init/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/local_info/BUILD b/test/mocks/local_info/BUILD index a42c77da3494a..497e56d044725 100644 --- a/test/mocks/local_info/BUILD +++ b/test/mocks/local_info/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/network/BUILD b/test/mocks/network/BUILD index 0e76d611ba5e1..ddc114a1b8af6 100644 --- a/test/mocks/network/BUILD +++ b/test/mocks/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/ratelimit/BUILD b/test/mocks/ratelimit/BUILD index f8d309c22e17e..480641069f9b6 100644 --- a/test/mocks/ratelimit/BUILD +++ b/test/mocks/ratelimit/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/redis/BUILD b/test/mocks/redis/BUILD index 35e2b35cb3c8e..5c3ede2d6db62 100644 --- a/test/mocks/redis/BUILD +++ b/test/mocks/redis/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/router/BUILD b/test/mocks/router/BUILD index 62c8cf0f33aa9..5f63fd44cf1de 100644 --- a/test/mocks/router/BUILD +++ b/test/mocks/router/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/runtime/BUILD b/test/mocks/runtime/BUILD index ff58f4c74d531..83764b6da39bb 100644 --- a/test/mocks/runtime/BUILD +++ b/test/mocks/runtime/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/server/BUILD b/test/mocks/server/BUILD index 284a9b75fc49c..2896da9505abb 100644 --- a/test/mocks/server/BUILD +++ b/test/mocks/server/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/ssl/BUILD b/test/mocks/ssl/BUILD index 5e0637ba65a35..fffa33cfe06e4 100644 --- a/test/mocks/ssl/BUILD +++ b/test/mocks/ssl/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/stats/BUILD b/test/mocks/stats/BUILD index a5376051934ce..7fb05372b8ded 100644 --- a/test/mocks/stats/BUILD +++ b/test/mocks/stats/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/thread_local/BUILD b/test/mocks/thread_local/BUILD index 533baf5b1b819..bc65c8da86c9d 100644 --- a/test/mocks/thread_local/BUILD +++ b/test/mocks/thread_local/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/tracing/BUILD b/test/mocks/tracing/BUILD index 41069e91dc37f..fcd4340bee7a8 100644 --- a/test/mocks/tracing/BUILD +++ b/test/mocks/tracing/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/mocks/upstream/BUILD b/test/mocks/upstream/BUILD index c02dca38846f4..dc2864c1a42a2 100644 --- a/test/mocks/upstream/BUILD +++ b/test/mocks/upstream/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_mock", diff --git a/test/proto/BUILD b/test/proto/BUILD index dbe270301f70d..551b549b5f4e8 100644 --- a/test/proto/BUILD +++ b/test/proto/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/test/server/BUILD b/test/server/BUILD index 98fa39cacb3c4..cd69413edef37 100644 --- a/test/server/BUILD +++ b/test/server/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/server/config/http/BUILD b/test/server/config/http/BUILD index e3319f56def0e..373c8530f4379 100644 --- a/test/server/config/http/BUILD +++ b/test/server/config/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/server/config/network/BUILD b/test/server/config/network/BUILD index aa6bb72a352fe..d825cfc00d67c 100644 --- a/test/server/config/network/BUILD +++ b/test/server/config/network/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/server/http/BUILD b/test/server/http/BUILD index fbaff7ffbc975..bffff2096c66c 100644 --- a/test/server/http/BUILD +++ b/test/server/http/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_test", diff --git a/test/test_common/BUILD b/test/test_common/BUILD index 7c20a302b1572..81f15aa255843 100644 --- a/test/test_common/BUILD +++ b/test/test_common/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/test/test_common/environment.cc b/test/test_common/environment.cc index 1e37c06a2014c..2cec70f18c211 100644 --- a/test/test_common/environment.cc +++ b/test/test_common/environment.cc @@ -18,13 +18,6 @@ namespace { -std::string getCheckedEnvVar(const std::string& var) { - // Bazel style temp dirs. Should be set by test runner or Bazel. - const char* path = ::getenv(var.c_str()); - RELEASE_ASSERT(path != nullptr); - return std::string(path); -} - std::string getOrCreateUnixDomainSocketDirectory() { const char* path = ::getenv("TEST_UDSDIR"); if (path != nullptr) { @@ -44,6 +37,13 @@ char** argv_; } // namespace +std::string TestEnvironment::getCheckedEnvVar(const std::string& var) { + // Bazel style temp dirs. Should be set by test runner or Bazel. + const char* path = ::getenv(var.c_str()); + RELEASE_ASSERT(path != nullptr); + return std::string(path); +} + void TestEnvironment::initializeOptions(int argc, char** argv) { argc_ = argc; argv_ = argv; @@ -60,8 +60,7 @@ const std::string& TestEnvironment::temporaryDirectory() { } const std::string& TestEnvironment::runfilesDirectory() { - static const std::string* runfiles_directory = - new std::string(getCheckedEnvVar("TEST_SRCDIR") + "/" + getCheckedEnvVar("TEST_WORKSPACE")); + static const std::string* runfiles_directory = new std::string(getCheckedEnvVar("TEST_RUNDIR")); return *runfiles_directory; } diff --git a/test/test_common/environment.h b/test/test_common/environment.h index db6dd118b7b5d..aff1a404b7688 100644 --- a/test/test_common/environment.h +++ b/test/test_common/environment.h @@ -26,6 +26,12 @@ class TestEnvironment { */ static Server::Options& getOptions(); + /** + * Obtain the value of an environment variable, die if not available. + * @return std::string with the value of the environment variable. + */ + static std::string getCheckedEnvVar(const std::string& var); + /** * Obtain a private writable temporary directory. * @return const std::string& with the path to the temporary directory. diff --git a/test/tools/router_check/BUILD b/test/tools/router_check/BUILD index 4a678c086a2c5..00b79868f9f96 100644 --- a/test/tools/router_check/BUILD +++ b/test/tools/router_check/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_binary", diff --git a/test/tools/router_check/json/BUILD b/test/tools/router_check/json/BUILD index fb3af6c918616..aa9c4ccf695c3 100644 --- a/test/tools/router_check/json/BUILD +++ b/test/tools/router_check/json/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", diff --git a/test/tools/router_check/test/BUILD b/test/tools/router_check/test/BUILD index ac98dec7aac13..5cb500c94d139 100644 --- a/test/tools/router_check/test/BUILD +++ b/test/tools/router_check/test/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", diff --git a/tools/BUILD b/tools/BUILD index d516bf1c4ea1f..fa3e910f5fb8a 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -1,3 +1,5 @@ +licenses(["notice"]) # Apache 2 + load( "//bazel:envoy_build_system.bzl", "envoy_package", From e6c77f8d4ec723df9e05d8a5b688a5fc95c96077 Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Fri, 28 Apr 2017 13:54:20 -0400 Subject: [PATCH 2/3] Check/fix automation for BUILD license files. --- tools/check_format.py | 7 +++++++ tools/envoy_build_fixer.py | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 tools/envoy_build_fixer.py diff --git a/tools/check_format.py b/tools/check_format.py index 6d67c6dda7eec..3e6f4b27ac827 100755 --- a/tools/check_format.py +++ b/tools/check_format.py @@ -10,6 +10,8 @@ CLANG_FORMAT_PATH = os.getenv("CLANG-FORMAT", "clang-format-3.6") BUILDIFIER_PATH = os.getenv("BUILDIFIER", "/usr/lib/go/bin/buildifier") +ENVOY_BUILD_FIXER_PATH = os.path.join( + os.path.dirname(os.path.abspath(sys.argv[0])), "envoy_build_fixer.py") HEADER_ORDER_PATH = os.path.join( os.path.dirname(os.path.abspath(sys.argv[0])), "header_order.py") @@ -24,6 +26,9 @@ def printError(error): def checkFilePath(file_path): if os.path.basename(file_path) == "BUILD": + if os.system("%s %s | diff -q %s - > /dev/null" % + (ENVOY_BUILD_FIXER_PATH, file_path, file_path)) != 0: + printError("envoy_build_fixer check failed for file: %s" % (file_path)) if os.system("cat %s | %s -mode=fix | diff -q %s - > /dev/null" % (file_path, BUILDIFIER_PATH, file_path)) != 0: printError("buildifier check failed for file: %s" % (file_path)) @@ -40,6 +45,8 @@ def checkFilePath(file_path): def fixFilePath(file_path): if os.path.basename(file_path) == "BUILD": + if os.system("%s %s %s" % (ENVOY_BUILD_FIXER_PATH, file_path, file_path)) != 0: + printError("envoy_build_fixer rewrite failed for file: %s" % (file_path)) if os.system("%s -mode=fix %s" % (BUILDIFIER_PATH, file_path)) != 0: printError("buildifier rewrite failed for file: %s" % (file_path)) return diff --git a/tools/envoy_build_fixer.py b/tools/envoy_build_fixer.py new file mode 100755 index 0000000000000..19e2ec16b6fa9 --- /dev/null +++ b/tools/envoy_build_fixer.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +# Enforce license headers on Envoy BUILD files (maybe more later?) + +import sys + +LICENSE_STRING = 'licenses(["notice"]) # Apache 2\n' + +def FixBuild(path): + with open(path, 'r') as f: + contents = f.read() + + if not contents.startswith(LICENSE_STRING): + return LICENSE_STRING + contents + return contents + +if __name__ == '__main__': + if len(sys.argv) == 2: + sys.stdout.write(FixBuild(sys.argv[1])) + sys.exit(0) + elif len(sys.argv) == 3: + reorderd_source = FixBuild(sys.argv[1]) + with open(sys.argv[2], 'w') as f: + f.write(reorderd_source) + sys.exit(0) + print 'Usage: %s []' % sys.argv[0] + sys.exit(1) From e2db7180d139690e00e5630e85ec899a75bf9c31 Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Fri, 28 Apr 2017 14:17:08 -0400 Subject: [PATCH 3/3] Fix bad license lines as well. --- tools/envoy_build_fixer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/envoy_build_fixer.py b/tools/envoy_build_fixer.py index 19e2ec16b6fa9..422316d6143c9 100755 --- a/tools/envoy_build_fixer.py +++ b/tools/envoy_build_fixer.py @@ -8,11 +8,12 @@ def FixBuild(path): with open(path, 'r') as f: - contents = f.read() + outlines = [LICENSE_STRING] + for line in f: + if not line.startswith('licenses'): + outlines.append(line) - if not contents.startswith(LICENSE_STRING): - return LICENSE_STRING + contents - return contents + return ''.join(outlines) if __name__ == '__main__': if len(sys.argv) == 2: