diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 34c691b669..02fc8a57bb 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -114,7 +114,7 @@ steps:
- ./scion.sh run
- tools/await-connectivity
- ./bin/end2end_integration || ( echo "^^^ +++" && false )
- - ./integration/revocation_test.sh
+ - ./tools/integration/revocation_test.sh
plugins:
- scionproto/metahook#v0.3.0:
post-command: |
@@ -163,8 +163,8 @@ steps:
- echo "--- run test"
- mkdir -p /tmp/test-artifacts/trc-ceremony
- export SAFEDIR="/tmp/test-artifacts/trc-ceremony"
- - ./scripts/cryptoplayground/trc_ceremony.sh
- - ./scripts/cryptoplayground/trc_ceremony_sensitive.sh
+ - ./tools/cryptoplayground/trc_ceremony.sh
+ - ./tools/cryptoplayground/trc_ceremony_sensitive.sh
timeout_in_minutes: 15
key: trc_ceremony_test
artifact_paths:
diff --git a/.buildkite/pipeline_lib.sh b/.buildkite/pipeline_lib.sh
index 8fb3a01508..82fca6f967 100644
--- a/.buildkite/pipeline_lib.sh
+++ b/.buildkite/pipeline_lib.sh
@@ -31,7 +31,7 @@ gen_acceptance() {
echo " - ${accept_dir}/ctl grun $name"
echo " key: ${name}_acceptance"
echo " env:"
- echo " PYTHONPATH: \"python/:.\""
+ echo " PYTHONPATH: \".\""
echo " ACCEPTANCE_DIR: \"$accept_dir\""
echo " artifact_paths:"
echo " - \"artifacts.out/**/*\""
diff --git a/BUILD.bazel b/BUILD.bazel
index 2b559c23cd..41b3bea81a 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,15 +1,15 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_go//go:def.bzl", "nogo")
-load("//lint:go_config.bzl", "go_lint_config")
-load("//lint/private/python:flake8_config.bzl", "flake8_lint_config")
+load("//tools/lint:go_config.bzl", "go_lint_config")
+load("//tools/lint/python:flake8_config.bzl", "flake8_lint_config")
load("//:nogo.bzl", "nogo_deps")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@cgrindel_bazel_starlib//updatesrc:defs.bzl", "updatesrc_update_all")
# gazelle:prefix github.com/scionproto/scion
-# gazelle:map_kind go_library go_library //lint:go.bzl
-# gazelle:map_kind go_test go_test //lint:go.bzl
+# gazelle:map_kind go_library go_library //tools/lint:go.bzl
+# gazelle:map_kind go_test go_test //tools/lint:go.bzl
# gazelle:exclude docker/_build/**
# gazelle:exclude proto/**
# gazelle:exclude doc/**
diff --git a/WORKSPACE b/WORKSPACE
index 06d71dfddc..db2197d56f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -83,7 +83,7 @@ load("@rules_python//python:pip.bzl", "pip_install")
pip_install(
name = "pip3_deps",
- requirements = "//env/pip3:requirements.txt",
+ requirements = "//tools/env/pip3:requirements.txt",
)
http_archive(
@@ -250,7 +250,7 @@ load("//:bbcp.bzl", "bbcp_repository")
bbcp_repository()
-load("//lint/private/python:deps.bzl", "python_lint_deps")
+load("//tools/lint/python:deps.bzl", "python_lint_deps")
python_lint_deps()
diff --git a/acceptance/BUILD.bazel b/acceptance/BUILD.bazel
index d83a61e04a..6d51ed86d5 100644
--- a/acceptance/BUILD.bazel
+++ b/acceptance/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/acceptance/cert_renewal/test.py b/acceptance/cert_renewal/test.py
index aa291e74cd..1001ee4221 100755
--- a/acceptance/cert_renewal/test.py
+++ b/acceptance/cert_renewal/test.py
@@ -28,7 +28,7 @@
from acceptance.common import base
from acceptance.common import docker
from acceptance.common import scion
-from python.lib import scion_addr
+from tools.topology.scion_addr import ISD_AS
import toml
logger = logging.getLogger(__name__)
@@ -117,7 +117,7 @@ def _run(self):
def _renewal_request(
self,
- isd_as: scion_addr.ISD_AS,
+ isd_as: ISD_AS,
mode: str = "--force",
):
as_dir = self._to_as_dir(isd_as)
@@ -182,7 +182,7 @@ def _check_key_cert(self, cs_configs: List[pathlib.Path]):
resp.reason)
continue
- isd_as = scion_addr.ISD_AS(cs_config.stem[2:-2])
+ isd_as = ISD_AS(cs_config.stem[2:-2])
as_dir = self._to_as_dir(isd_as)
chain_name = "ISD%s-AS%s.pem" % (isd_as.isd_str(),
isd_as.as_file_fmt())
@@ -223,7 +223,7 @@ def _extract_skid(self, file: pathlib.Path):
def _rel(self, path: pathlib.Path):
return path.relative_to(pathlib.Path(self.test_state.artifacts))
- def _to_as_dir(self, isd_as: scion_addr.ISD_AS) -> pathlib.Path:
+ def _to_as_dir(self, isd_as: ISD_AS) -> pathlib.Path:
return pathlib.Path("%s/gen/AS%s" %
(self.test_state.artifacts, isd_as.as_file_fmt()))
@@ -232,7 +232,7 @@ def _cs_configs(self) -> List[pathlib.Path]:
pathlib.Path("%s/gen" %
self.test_state.artifacts).glob("AS*/cs*.toml"))
- def _local_flags(self, isd_as: scion_addr.ISD_AS) -> List[str]:
+ def _local_flags(self, isd_as: ISD_AS) -> List[str]:
return [
"--local",
self.execute("tester_%s" % isd_as.file_fmt(), "sh", "-c",
diff --git a/acceptance/cmd/sig_ping_acceptance/BUILD.bazel b/acceptance/cmd/sig_ping_acceptance/BUILD.bazel
index 570438fe16..552e1efcf3 100644
--- a/acceptance/cmd/sig_ping_acceptance/BUILD.bazel
+++ b/acceptance/cmd/sig_ping_acceptance/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/acceptance/common/BUILD.bazel b/acceptance/common/BUILD.bazel
index 37a3c3dfaf..a1da9ca8a2 100644
--- a/acceptance/common/BUILD.bazel
+++ b/acceptance/common/BUILD.bazel
@@ -1,5 +1,5 @@
load("@pip3_deps//:requirements.bzl", "requirement")
-load("//lint:py.bzl", "py_library", "py_test")
+load("//tools/lint:py.bzl", "py_library", "py_test")
package(default_visibility = ["//visibility:public"])
@@ -39,7 +39,7 @@ py_library(
requirement("plumbum"),
requirement("toml"),
"log",
- "//python/lib:scion_addr",
+ "//tools/topology:py_default_library",
],
)
diff --git a/acceptance/common/raw.bzl b/acceptance/common/raw.bzl
index 9f75d44bac..99eaf25d5d 100644
--- a/acceptance/common/raw.bzl
+++ b/acceptance/common/raw.bzl
@@ -1,4 +1,4 @@
-load("//lint:py.bzl", "py_binary", "py_library", "py_test")
+load("//tools/lint:py.bzl", "py_binary", "py_library", "py_test")
load("@pip3_deps//:requirements.bzl", "requirement")
def raw_test(
diff --git a/acceptance/common/scion.py b/acceptance/common/scion.py
index 78826928bf..cad7e49855 100644
--- a/acceptance/common/scion.py
+++ b/acceptance/common/scion.py
@@ -24,8 +24,7 @@
from plumbum.path.local import LocalPath
from acceptance.common.log import LogExec
-from python.lib import scion_addr
-from python.lib.scion_addr import ISD_AS
+from tools.topology.scion_addr import ISD_AS
logger = logging.getLogger(__name__)
@@ -173,20 +172,20 @@ class ASList(object):
ASList is a list of AS separated by core and non-core ASes. It can be loaded
from the as_list.yml file created by the topology generator.
"""
- def __init__(self, cores: List[scion_addr.ISD_AS], non_cores: List[scion_addr.ISD_AS]):
+ def __init__(self, cores: List[ISD_AS], non_cores: List[ISD_AS]):
self.cores = cores
self.non_cores = non_cores
@property
- def all(self) -> List[scion_addr.ISD_AS]:
+ def all(self) -> List[ISD_AS]:
return self.cores + self.non_cores
@staticmethod
def load(file: str = "gen/as_list.yml") -> "ASList":
with open(file, "r") as content:
data = yaml.load(content, yaml.Loader)
- cores = [scion_addr.ISD_AS(raw) for raw in data["Core"]]
- non_cores = [scion_addr.ISD_AS(raw) for raw in data["Non-core"]]
+ cores = [ISD_AS(raw) for raw in data["Core"]]
+ non_cores = [ISD_AS(raw) for raw in data["Non-core"]]
return ASList(cores, non_cores)
diff --git a/acceptance/common/topogen.bzl b/acceptance/common/topogen.bzl
index 27b6fd9501..f6f4c1f0f7 100644
--- a/acceptance/common/topogen.bzl
+++ b/acceptance/common/topogen.bzl
@@ -1,4 +1,4 @@
-load("//lint:py.bzl", "py_binary", "py_library", "py_test")
+load("//tools/lint:py.bzl", "py_binary", "py_library", "py_test")
load("@pip3_deps//:requirements.bzl", "requirement")
def topogen_test(
@@ -47,13 +47,13 @@ def topogen_test(
common_args = [
"--executables=scion-pki:$(location //scion-pki/cmd/scion-pki)",
- "--executables=topogen:$(location //python/topology:topogen)",
+ "--executables=topogen:$(location //tools:topogen)",
"--topo=$(location %s)" % topo,
"--setup-params='%s'" % setup_params,
]
common_data = [
"//scion-pki/cmd/scion-pki",
- "//python/topology:topogen",
+ "//tools:topogen",
"//tools:docker_ip",
topo,
]
diff --git a/acceptance/topo_cs_reload/BUILD.bazel b/acceptance/topo_cs_reload/BUILD.bazel
index f9eeb6212a..36b3630c3c 100644
--- a/acceptance/topo_cs_reload/BUILD.bazel
+++ b/acceptance/topo_cs_reload/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_test")
+load("//tools/lint:go.bzl", "go_test")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
go_test(
diff --git a/acceptance/topo_daemon_reload/BUILD.bazel b/acceptance/topo_daemon_reload/BUILD.bazel
index 0a7238d4a5..c5d716361d 100644
--- a/acceptance/topo_daemon_reload/BUILD.bazel
+++ b/acceptance/topo_daemon_reload/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_test")
+load("//tools/lint:go.bzl", "go_test")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
go_test(
diff --git a/antlr/sequence/BUILD.bazel b/antlr/sequence/BUILD.bazel
index 92af5c0cda..345c5df360 100644
--- a/antlr/sequence/BUILD.bazel
+++ b/antlr/sequence/BUILD.bazel
@@ -1,5 +1,5 @@
-load("//lint:go.bzl", "go_library")
-load("//lint:go_config.bzl", "go_lint_config")
+load("//tools/lint:go.bzl", "go_library")
+load("//tools/lint:go_config.bzl", "go_lint_config")
load("@apple_rules_lint//lint:defs.bzl", "package_lint_config")
go_lint_config(
diff --git a/antlr/traffic_class/BUILD.bazel b/antlr/traffic_class/BUILD.bazel
index 037cdc2326..a4ce1db4ef 100644
--- a/antlr/traffic_class/BUILD.bazel
+++ b/antlr/traffic_class/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/BUILD.bazel b/control/BUILD.bazel
index 7b761fa2a5..d7b72fe234 100644
--- a/control/BUILD.bazel
+++ b/control/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/beacon/BUILD.bazel b/control/beacon/BUILD.bazel
index fe6c656fb9..3366d61fcd 100644
--- a/control/beacon/BUILD.bazel
+++ b/control/beacon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/beacon/beacondbtest/BUILD.bazel b/control/beacon/beacondbtest/BUILD.bazel
index c87a2f65a1..602bd3962c 100644
--- a/control/beacon/beacondbtest/BUILD.bazel
+++ b/control/beacon/beacondbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/beacon/mock_beacon/BUILD.bazel b/control/beacon/mock_beacon/BUILD.bazel
index f3ee2d0e94..341373e334 100644
--- a/control/beacon/mock_beacon/BUILD.bazel
+++ b/control/beacon/mock_beacon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/control/beaconing/BUILD.bazel b/control/beaconing/BUILD.bazel
index 8c88c7e473..515c9ef1cf 100644
--- a/control/beaconing/BUILD.bazel
+++ b/control/beaconing/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/beaconing/grpc/BUILD.bazel b/control/beaconing/grpc/BUILD.bazel
index fd4cde3669..ef8773add4 100644
--- a/control/beaconing/grpc/BUILD.bazel
+++ b/control/beaconing/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/beaconing/mock_beaconing/BUILD.bazel b/control/beaconing/mock_beaconing/BUILD.bazel
index 35e4f8635f..3cc4ff58b5 100644
--- a/control/beaconing/mock_beaconing/BUILD.bazel
+++ b/control/beaconing/mock_beaconing/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/control/cmd/control/BUILD.bazel b/control/cmd/control/BUILD.bazel
index 637e8d6e9d..803886c26d 100644
--- a/control/cmd/control/BUILD.bazel
+++ b/control/cmd/control/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/control/colibri/reservation/BUILD.bazel b/control/colibri/reservation/BUILD.bazel
index 040a23afe0..e4da7ae3e6 100644
--- a/control/colibri/reservation/BUILD.bazel
+++ b/control/colibri/reservation/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/conf/BUILD.bazel b/control/colibri/reservation/conf/BUILD.bazel
index 91d1c9427c..ff2704e92b 100644
--- a/control/colibri/reservation/conf/BUILD.bazel
+++ b/control/colibri/reservation/conf/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/e2e/BUILD.bazel b/control/colibri/reservation/e2e/BUILD.bazel
index 3ffac8639b..c56f5fb092 100644
--- a/control/colibri/reservation/e2e/BUILD.bazel
+++ b/control/colibri/reservation/e2e/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/reservationdbtest/BUILD.bazel b/control/colibri/reservation/reservationdbtest/BUILD.bazel
index 0b4a4f5b8e..76917fb9d7 100644
--- a/control/colibri/reservation/reservationdbtest/BUILD.bazel
+++ b/control/colibri/reservation/reservationdbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/segment/BUILD.bazel b/control/colibri/reservation/segment/BUILD.bazel
index 57c0077bca..99ca4a643c 100644
--- a/control/colibri/reservation/segment/BUILD.bazel
+++ b/control/colibri/reservation/segment/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/segment/admission/BUILD.bazel b/control/colibri/reservation/segment/admission/BUILD.bazel
index e42efe4523..bb24646544 100644
--- a/control/colibri/reservation/segment/admission/BUILD.bazel
+++ b/control/colibri/reservation/segment/admission/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/segment/admission/impl/BUILD.bazel b/control/colibri/reservation/segment/admission/impl/BUILD.bazel
index e252c988aa..69600c1f87 100644
--- a/control/colibri/reservation/segment/admission/impl/BUILD.bazel
+++ b/control/colibri/reservation/segment/admission/impl/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/segmenttest/BUILD.bazel b/control/colibri/reservation/segmenttest/BUILD.bazel
index 6ddd8772c6..9fb8c46299 100644
--- a/control/colibri/reservation/segmenttest/BUILD.bazel
+++ b/control/colibri/reservation/segmenttest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/sqlite/BUILD.bazel b/control/colibri/reservation/sqlite/BUILD.bazel
index e0d1910d0f..a9cef9dc8a 100644
--- a/control/colibri/reservation/sqlite/BUILD.bazel
+++ b/control/colibri/reservation/sqlite/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservation/test/BUILD.bazel b/control/colibri/reservation/test/BUILD.bazel
index 6142c71d1b..74bb10dd42 100644
--- a/control/colibri/reservation/test/BUILD.bazel
+++ b/control/colibri/reservation/test/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservationstorage/BUILD.bazel b/control/colibri/reservationstorage/BUILD.bazel
index 0d492bf7f3..1f749c5dc0 100644
--- a/control/colibri/reservationstorage/BUILD.bazel
+++ b/control/colibri/reservationstorage/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservationstorage/backend/BUILD.bazel b/control/colibri/reservationstorage/backend/BUILD.bazel
index 9125611462..c328c5ad98 100644
--- a/control/colibri/reservationstorage/backend/BUILD.bazel
+++ b/control/colibri/reservationstorage/backend/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/colibri/reservationstorage/backend/mock_backend/BUILD.bazel b/control/colibri/reservationstorage/backend/mock_backend/BUILD.bazel
index e6faee2196..b7aa9c6c38 100644
--- a/control/colibri/reservationstorage/backend/mock_backend/BUILD.bazel
+++ b/control/colibri/reservationstorage/backend/mock_backend/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/control/colibri/reservationstore/BUILD.bazel b/control/colibri/reservationstore/BUILD.bazel
index 1c2ba3ffbc..613b053c67 100644
--- a/control/colibri/reservationstore/BUILD.bazel
+++ b/control/colibri/reservationstore/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_test(
name = "go_default_test",
diff --git a/control/config/BUILD.bazel b/control/config/BUILD.bazel
index 5aec91be7b..c9295f61bc 100644
--- a/control/config/BUILD.bazel
+++ b/control/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/ifstate/BUILD.bazel b/control/ifstate/BUILD.bazel
index c239a5da79..df10c51193 100644
--- a/control/ifstate/BUILD.bazel
+++ b/control/ifstate/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/mgmtapi/BUILD.bazel b/control/mgmtapi/BUILD.bazel
index 19b71f358e..3580d478f8 100644
--- a/control/mgmtapi/BUILD.bazel
+++ b/control/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
genrule(
diff --git a/control/mgmtapi/mock_mgmtapi/BUILD.bazel b/control/mgmtapi/mock_mgmtapi/BUILD.bazel
index 48c3c01302..ef82e3b760 100644
--- a/control/mgmtapi/mock_mgmtapi/BUILD.bazel
+++ b/control/mgmtapi/mock_mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/control/onehop/BUILD.bazel b/control/onehop/BUILD.bazel
index c38434d2d2..0cd018e8a9 100644
--- a/control/onehop/BUILD.bazel
+++ b/control/onehop/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/segreg/grpc/BUILD.bazel b/control/segreg/grpc/BUILD.bazel
index 205a81062d..2d23c1c0f7 100644
--- a/control/segreg/grpc/BUILD.bazel
+++ b/control/segreg/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/segreq/BUILD.bazel b/control/segreq/BUILD.bazel
index c24bf6ac09..61a39ac332 100644
--- a/control/segreq/BUILD.bazel
+++ b/control/segreq/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/segreq/grpc/BUILD.bazel b/control/segreq/grpc/BUILD.bazel
index 9e9bf35fbe..90c67436ef 100644
--- a/control/segreq/grpc/BUILD.bazel
+++ b/control/segreq/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/segutil/BUILD.bazel b/control/segutil/BUILD.bazel
index 323a6e32e6..aafe6841a3 100644
--- a/control/segutil/BUILD.bazel
+++ b/control/segutil/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/trust/BUILD.bazel b/control/trust/BUILD.bazel
index de559c2215..97915b00a7 100644
--- a/control/trust/BUILD.bazel
+++ b/control/trust/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/trust/grpc/BUILD.bazel b/control/trust/grpc/BUILD.bazel
index b31bf43a9f..6bcd376c33 100644
--- a/control/trust/grpc/BUILD.bazel
+++ b/control/trust/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/control/trust/metrics/BUILD.bazel b/control/trust/metrics/BUILD.bazel
index dcef07c82b..a361183932 100644
--- a/control/trust/metrics/BUILD.bazel
+++ b/control/trust/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/control/trust/mock_trust/BUILD.bazel b/control/trust/mock_trust/BUILD.bazel
index 26588b7791..ab1c164e7d 100644
--- a/control/trust/mock_trust/BUILD.bazel
+++ b/control/trust/mock_trust/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/daemon/BUILD.bazel b/daemon/BUILD.bazel
index 4a5114cae3..bc532e5d79 100644
--- a/daemon/BUILD.bazel
+++ b/daemon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/daemon/cmd/daemon/BUILD.bazel b/daemon/cmd/daemon/BUILD.bazel
index c2ad63d947..91eef552bc 100644
--- a/daemon/cmd/daemon/BUILD.bazel
+++ b/daemon/cmd/daemon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
scion_go_binary(
diff --git a/daemon/config/BUILD.bazel b/daemon/config/BUILD.bazel
index cf2e354f94..f6ebff9e4e 100644
--- a/daemon/config/BUILD.bazel
+++ b/daemon/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/daemon/fetcher/BUILD.bazel b/daemon/fetcher/BUILD.bazel
index 53d62102d1..458f15cd00 100644
--- a/daemon/fetcher/BUILD.bazel
+++ b/daemon/fetcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/daemon/fetcher/mock_fetcher/BUILD.bazel b/daemon/fetcher/mock_fetcher/BUILD.bazel
index 47cfcdadb9..5b5a0dcbc8 100644
--- a/daemon/fetcher/mock_fetcher/BUILD.bazel
+++ b/daemon/fetcher/mock_fetcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/daemon/internal/servers/BUILD.bazel b/daemon/internal/servers/BUILD.bazel
index 344251ab6b..830f40cd7b 100644
--- a/daemon/internal/servers/BUILD.bazel
+++ b/daemon/internal/servers/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/daemon/mgmtapi/BUILD.bazel b/daemon/mgmtapi/BUILD.bazel
index 76f0eeeb6a..e2a25f9784 100644
--- a/daemon/mgmtapi/BUILD.bazel
+++ b/daemon/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
genrule(
diff --git a/dispatcher/BUILD.bazel b/dispatcher/BUILD.bazel
index af031d0f7f..8538e90bdd 100644
--- a/dispatcher/BUILD.bazel
+++ b/dispatcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/dispatcher/cmd/dispatcher/BUILD.bazel b/dispatcher/cmd/dispatcher/BUILD.bazel
index a6bc621443..f7a8f876c0 100644
--- a/dispatcher/cmd/dispatcher/BUILD.bazel
+++ b/dispatcher/cmd/dispatcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/dispatcher/config/BUILD.bazel b/dispatcher/config/BUILD.bazel
index 22684ef643..fe9bc729bf 100644
--- a/dispatcher/config/BUILD.bazel
+++ b/dispatcher/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/dispatcher/internal/metrics/BUILD.bazel b/dispatcher/internal/metrics/BUILD.bazel
index 304e9fca5f..1acf5d718d 100644
--- a/dispatcher/internal/metrics/BUILD.bazel
+++ b/dispatcher/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/dispatcher/internal/registration/BUILD.bazel b/dispatcher/internal/registration/BUILD.bazel
index e92ec728f8..70dc5a3245 100644
--- a/dispatcher/internal/registration/BUILD.bazel
+++ b/dispatcher/internal/registration/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/dispatcher/internal/respool/BUILD.bazel b/dispatcher/internal/respool/BUILD.bazel
index 6ec6ee0b41..ba4207764d 100644
--- a/dispatcher/internal/respool/BUILD.bazel
+++ b/dispatcher/internal/respool/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/dispatcher/mgmtapi/BUILD.bazel b/dispatcher/mgmtapi/BUILD.bazel
index 1f8b7a7357..85bbb74d85 100644
--- a/dispatcher/mgmtapi/BUILD.bazel
+++ b/dispatcher/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//rules_openapi:defs.bzl", "openapi_generate_go")
genrule(
diff --git a/dispatcher/network/BUILD.bazel b/dispatcher/network/BUILD.bazel
index 55c790b38e..f08a1a817a 100644
--- a/dispatcher/network/BUILD.bazel
+++ b/dispatcher/network/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/doc/build/setup.rst b/doc/build/setup.rst
index 4db7d62dc5..542f9630d8 100644
--- a/doc/build/setup.rst
+++ b/doc/build/setup.rst
@@ -34,7 +34,7 @@ Bazel & Co.
.. code-block:: bash
- ./env/deps
+ ./tools/install_deps
#. Install ``docker``.
Please follow the instructions for `docker-ce `_.
diff --git a/doc/contribute/git.rst b/doc/contribute/git.rst
index 62f87a16f1..212d16f76b 100644
--- a/doc/contribute/git.rst
+++ b/doc/contribute/git.rst
@@ -79,9 +79,6 @@ straight-forward:
#. Merge the upstream changes into your main branch: ``git merge --ff-only upstream/master``
#. Push the changes to your github fork: ``git push``
-A simple script to automate this can be found in the repo under
-``/scripts/mastersync.sh``.
-
.. _contribute-submit-pull-request:
Submitting a pull request
diff --git a/docker/tester.bzl b/docker/tester.bzl
index 89e5709012..3781c28e7d 100644
--- a/docker/tester.bzl
+++ b/docker/tester.bzl
@@ -1,5 +1,5 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
-load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
+load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs")
load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs")
@@ -42,9 +42,9 @@ def build_tester_image():
pkg_tar(
name = "integration",
srcs = [
- "//integration:bin_wrapper.sh",
+ "//tools/integration:bin_wrapper.sh",
],
- package_dir = "integration",
+ package_dir = "tools/integration",
)
pkg_tar(
diff --git a/env/deps b/env/deps
deleted file mode 100755
index 9617689f17..0000000000
--- a/env/deps
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-set -e
-
-BASE=$(dirname "$0")
-. $BASE/common.sh
-
-"$BASE/debian/deps"
-"$BASE/pip3/deps"
diff --git a/gateway/BUILD.bazel b/gateway/BUILD.bazel
index 54d3d16166..c6b37b49ea 100644
--- a/gateway/BUILD.bazel
+++ b/gateway/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/cmd/gateway/BUILD.bazel b/gateway/cmd/gateway/BUILD.bazel
index 1f31d93889..565138a633 100644
--- a/gateway/cmd/gateway/BUILD.bazel
+++ b/gateway/cmd/gateway/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/gateway/config/BUILD.bazel b/gateway/config/BUILD.bazel
index e4ded442db..ba502ad7e9 100644
--- a/gateway/config/BUILD.bazel
+++ b/gateway/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/config/configtest/BUILD.bazel b/gateway/config/configtest/BUILD.bazel
index 5622c1f92e..dea6207aa4 100644
--- a/gateway/config/configtest/BUILD.bazel
+++ b/gateway/config/configtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/gateway/control/BUILD.bazel b/gateway/control/BUILD.bazel
index e258e57c0e..1aba7ab520 100644
--- a/gateway/control/BUILD.bazel
+++ b/gateway/control/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/control/grpc/BUILD.bazel b/gateway/control/grpc/BUILD.bazel
index 9be45754d6..90bf20e99d 100644
--- a/gateway/control/grpc/BUILD.bazel
+++ b/gateway/control/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/control/grpc/mock_grpc/BUILD.bazel b/gateway/control/grpc/mock_grpc/BUILD.bazel
index 5c6fb9889f..1a5484e3ca 100644
--- a/gateway/control/grpc/mock_grpc/BUILD.bazel
+++ b/gateway/control/grpc/mock_grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/gateway/control/mock_control/BUILD.bazel b/gateway/control/mock_control/BUILD.bazel
index 30494a4647..2a4d1e2332 100644
--- a/gateway/control/mock_control/BUILD.bazel
+++ b/gateway/control/mock_control/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/gateway/dataplane/BUILD.bazel b/gateway/dataplane/BUILD.bazel
index a51c4b5a20..d6049a4214 100644
--- a/gateway/dataplane/BUILD.bazel
+++ b/gateway/dataplane/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/mgmtapi/BUILD.bazel b/gateway/mgmtapi/BUILD.bazel
index 44ab824920..ef7960e1dc 100644
--- a/gateway/mgmtapi/BUILD.bazel
+++ b/gateway/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
genrule(
diff --git a/gateway/mock_gateway/BUILD.bazel b/gateway/mock_gateway/BUILD.bazel
index 4282171dab..76afeae1bd 100644
--- a/gateway/mock_gateway/BUILD.bazel
+++ b/gateway/mock_gateway/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/gateway/pathhealth/BUILD.bazel b/gateway/pathhealth/BUILD.bazel
index 2d717568af..2bf91721df 100644
--- a/gateway/pathhealth/BUILD.bazel
+++ b/gateway/pathhealth/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/pathhealth/policies/BUILD.bazel b/gateway/pathhealth/policies/BUILD.bazel
index ebd88d8539..145fd1200e 100644
--- a/gateway/pathhealth/policies/BUILD.bazel
+++ b/gateway/pathhealth/policies/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/gateway/pktcls/BUILD.bazel b/gateway/pktcls/BUILD.bazel
index 472066a013..4e47fb9826 100644
--- a/gateway/pktcls/BUILD.bazel
+++ b/gateway/pktcls/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/pktcls/mock_pktcls/BUILD.bazel b/gateway/pktcls/mock_pktcls/BUILD.bazel
index f8f2c511a9..fcc185092e 100644
--- a/gateway/pktcls/mock_pktcls/BUILD.bazel
+++ b/gateway/pktcls/mock_pktcls/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/gateway/routemgr/BUILD.bazel b/gateway/routemgr/BUILD.bazel
index f51fb01ebb..5b53100710 100644
--- a/gateway/routemgr/BUILD.bazel
+++ b/gateway/routemgr/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/routing/BUILD.bazel b/gateway/routing/BUILD.bazel
index 7f76776cae..832377c1f2 100644
--- a/gateway/routing/BUILD.bazel
+++ b/gateway/routing/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/gateway/routing/internal/fuzz/BUILD.bazel b/gateway/routing/internal/fuzz/BUILD.bazel
index b52e11ba6c..b6d4eb1128 100644
--- a/gateway/routing/internal/fuzz/BUILD.bazel
+++ b/gateway/routing/internal/fuzz/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/gateway/routing/mock_routing/BUILD.bazel b/gateway/routing/mock_routing/BUILD.bazel
index ad17bab3cd..d785c6e174 100644
--- a/gateway/routing/mock_routing/BUILD.bazel
+++ b/gateway/routing/mock_routing/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/gateway/xnet/BUILD.bazel b/gateway/xnet/BUILD.bazel
index 3ce563850b..a2500c0524 100644
--- a/gateway/xnet/BUILD.bazel
+++ b/gateway/xnet/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/integration/BUILD.bazel b/integration/BUILD.bazel
deleted file mode 100644
index c32762877a..0000000000
--- a/integration/BUILD.bazel
+++ /dev/null
@@ -1 +0,0 @@
-exports_files(["bin_wrapper.sh"])
diff --git a/integration/common.sh b/integration/common.sh
deleted file mode 100755
index 2d55d9c6eb..0000000000
--- a/integration/common.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2018 ETH Zurich
-#
-# 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.
-
-set -o pipefail
-
-REV_BRS="*br1-ff00_0_110-3 *br2-ff00_0_222-2 *br1-ff00_0_111-2 *br1-ff00_0_111-3 *br1-ff00_0_131-2"
-REV_BRS="$REV_BRS *br2-ff00_0_220-2 *br2-ff00_0_210-4 *br2-ff00_0_212-1"
-
-log() {
- echo "========> ($(date -u --rfc-3339=seconds)) $@"
-}
-
-run() {
- local test="${1:?}"
- shift
- log "$test: starting"
- time "$@"
- local result=$?
- if [ $result -eq 0 ]; then
- log "$test: success"
- else
- log "$test: failure"
- fi
- return $result
-}
-
-is_docker_be() {
- [ -f gen/scion-dc.yml ]
-}
-
-usage() {
- echo "Usage: $0: [-b brs]"
- exit 1
-}
-
-opts() {
- while getopts ":b:" opt; do
- case "$opt" in
- b)
- REV_BRS="$OPTARG"
- ;;
- \?)
- echo "Invalid option: -$OPTARG" >&2
- usage
- ;;
- :)
- echo "Option -$OPTARG requires an argument." >&2
- usage
- ;;
- *)
- usage
- ;;
- esac
- done
- # Set if docker backend is used
- is_docker_be && DOCKER_ARGS="-d"
-}
-
-export PYTHONPATH=python/:.
diff --git a/integration/e2e_integration b/integration/e2e_integration
deleted file mode 100755
index 3bc2e05743..0000000000
--- a/integration/e2e_integration
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-# Copyright 2019 Anapaya Systems
-#
-# 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.
-
-. integration/common.sh
-
-MODE="$1"
-shift
-opts "$@"
-shift $((OPTIND-1))
-
-result=0
-
-case $MODE in
- core-core|noncore-localcore)
- run "E2E $MODE" ./bin/end2end_integration -subset "$MODE" -timeout 2500ms -log.console error $DOCKER_ARGS; result=$? ;;
- *)
- run "E2E $MODE" ./bin/end2end_integration -subset "$MODE" -log.console error $DOCKER_ARGS; result=$? ;;
-esac
-
-exit $result
diff --git a/integration/go_integration b/integration/go_integration
deleted file mode 100755
index f3f6582ef5..0000000000
--- a/integration/go_integration
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# Copyright 2018 ETH Zurich
-#
-# 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.
-
-. integration/common.sh
-
-opts "$@"
-shift $((OPTIND-1))
-
-result=0
-
-for i in ./bin/*_integration; do
- run "Go Integration: $i" "$i" $DOCKER_ARGS -log.console error
- result=$((result+$?))
-done
-
-exit $result
diff --git a/integration/integration_test.sh b/integration/integration_test.sh
deleted file mode 100755
index 1c32dcce4d..0000000000
--- a/integration/integration_test.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# Copyright 2018 ETH Zurich
-#
-# 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.
-
-set -o pipefail
-
-. integration/common.sh
-
-# Get BRS
-opts "$@"
-shift $((OPTIND-1))
-
-shutdown() {
- log "Scion status:"
- ./scion.sh status
- log "Stopping scion"
- ./scion.sh stop | grep -v "stopped"
- log "Scion stopped"
- if is_docker_be; then
- log "Stopping tester containers"
- ./tools/quiet ./tools/dc stop tester\*
- fi
-}
-
-log "Starting scion"
-./scion.sh run | grep -v "started" || exit 1
-
-log "Scion status:"
-./scion.sh status || exit 1
-if is_docker_be; then
- log "Starting tester containers"
- ./tools/quiet ./tools/dc start "tester*"
-fi
-
-sleep 5
-result=0
-
-# Run go integration tests
-integration/go_integration
-result=$((result+$?))
-
-integration/revocation_test.sh -b "$REV_BRS"
-result=$((result+$?))
-
-shutdown
-
-if [ $result -eq 0 ]; then
- log "All integration tests successful"
-else
- log "$result integration tests failed"
-fi
-exit $result
diff --git a/pkg/addr/BUILD.bazel b/pkg/addr/BUILD.bazel
index 2e708db8d8..6c003ea6f6 100644
--- a/pkg/addr/BUILD.bazel
+++ b/pkg/addr/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/daemon/BUILD.bazel b/pkg/daemon/BUILD.bazel
index 2e790067bc..ebd9c8fc4a 100644
--- a/pkg/daemon/BUILD.bazel
+++ b/pkg/daemon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/daemon/internal/metrics/BUILD.bazel b/pkg/daemon/internal/metrics/BUILD.bazel
index 9f5cfd5b57..9b34b080fd 100644
--- a/pkg/daemon/internal/metrics/BUILD.bazel
+++ b/pkg/daemon/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/daemon/mock_daemon/BUILD.bazel b/pkg/daemon/mock_daemon/BUILD.bazel
index 8c978f78df..0f6609a400 100644
--- a/pkg/daemon/mock_daemon/BUILD.bazel
+++ b/pkg/daemon/mock_daemon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/experimental/colibri/reservation/BUILD.bazel b/pkg/experimental/colibri/reservation/BUILD.bazel
index 41923e5859..622702e0c8 100644
--- a/pkg/experimental/colibri/reservation/BUILD.bazel
+++ b/pkg/experimental/colibri/reservation/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/experimental/epic/BUILD.bazel b/pkg/experimental/epic/BUILD.bazel
index c55e99f2f9..753ce3b34e 100644
--- a/pkg/experimental/epic/BUILD.bazel
+++ b/pkg/experimental/epic/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/experimental/hiddenpath/BUILD.bazel b/pkg/experimental/hiddenpath/BUILD.bazel
index 277b4fbe92..5da8e413a1 100644
--- a/pkg/experimental/hiddenpath/BUILD.bazel
+++ b/pkg/experimental/hiddenpath/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/experimental/hiddenpath/grpc/BUILD.bazel b/pkg/experimental/hiddenpath/grpc/BUILD.bazel
index 0369fe68c9..8c30cb583e 100644
--- a/pkg/experimental/hiddenpath/grpc/BUILD.bazel
+++ b/pkg/experimental/hiddenpath/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/experimental/hiddenpath/grpc/mock_grpc/BUILD.bazel b/pkg/experimental/hiddenpath/grpc/mock_grpc/BUILD.bazel
index 0b588679f4..5e6bd359f2 100644
--- a/pkg/experimental/hiddenpath/grpc/mock_grpc/BUILD.bazel
+++ b/pkg/experimental/hiddenpath/grpc/mock_grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/experimental/hiddenpath/mock_hiddenpath/BUILD.bazel b/pkg/experimental/hiddenpath/mock_hiddenpath/BUILD.bazel
index 84ffa86e98..f2e43bd5b1 100644
--- a/pkg/experimental/hiddenpath/mock_hiddenpath/BUILD.bazel
+++ b/pkg/experimental/hiddenpath/mock_hiddenpath/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/grpc/BUILD.bazel b/pkg/grpc/BUILD.bazel
index 97460eab2c..cfc10372e7 100644
--- a/pkg/grpc/BUILD.bazel
+++ b/pkg/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/log/BUILD.bazel b/pkg/log/BUILD.bazel
index c84b632459..2a4d62d051 100644
--- a/pkg/log/BUILD.bazel
+++ b/pkg/log/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/log/logtest/BUILD.bazel b/pkg/log/logtest/BUILD.bazel
index 33596ed49d..435e480ed1 100644
--- a/pkg/log/logtest/BUILD.bazel
+++ b/pkg/log/logtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/log/mock_log/BUILD.bazel b/pkg/log/mock_log/BUILD.bazel
index 83ba71dccf..58983b2a94 100644
--- a/pkg/log/mock_log/BUILD.bazel
+++ b/pkg/log/mock_log/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/log/testlog/BUILD.bazel b/pkg/log/testlog/BUILD.bazel
index 2f48fd2a35..1487ad93da 100644
--- a/pkg/log/testlog/BUILD.bazel
+++ b/pkg/log/testlog/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/metrics/BUILD.bazel b/pkg/metrics/BUILD.bazel
index 268cf0f029..52f2083b1e 100644
--- a/pkg/metrics/BUILD.bazel
+++ b/pkg/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/metrics/mock_metrics/BUILD.bazel b/pkg/metrics/mock_metrics/BUILD.bazel
index ad17ac9b33..4febac2935 100644
--- a/pkg/metrics/mock_metrics/BUILD.bazel
+++ b/pkg/metrics/mock_metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/private/common/BUILD.bazel b/pkg/private/common/BUILD.bazel
index a6902bcf02..1c39bcb1c6 100644
--- a/pkg/private/common/BUILD.bazel
+++ b/pkg/private/common/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/private/ctrl/path_mgmt/BUILD.bazel b/pkg/private/ctrl/path_mgmt/BUILD.bazel
index 77a6c62bfd..921b088259 100644
--- a/pkg/private/ctrl/path_mgmt/BUILD.bazel
+++ b/pkg/private/ctrl/path_mgmt/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/ctrl/path_mgmt/proto/BUILD.bazel b/pkg/private/ctrl/path_mgmt/proto/BUILD.bazel
index a02f284878..b2b0f22e77 100644
--- a/pkg/private/ctrl/path_mgmt/proto/BUILD.bazel
+++ b/pkg/private/ctrl/path_mgmt/proto/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/mocks/io/BUILD.bazel b/pkg/private/mocks/io/BUILD.bazel
index eb357d9989..bcbec0ec88 100644
--- a/pkg/private/mocks/io/BUILD.bazel
+++ b/pkg/private/mocks/io/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/mocks/io/mock_io/BUILD.bazel b/pkg/private/mocks/io/mock_io/BUILD.bazel
index e1a9d2af91..9a082b5410 100644
--- a/pkg/private/mocks/io/mock_io/BUILD.bazel
+++ b/pkg/private/mocks/io/mock_io/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/private/mocks/net/BUILD.bazel b/pkg/private/mocks/net/BUILD.bazel
index a98cec7087..9314a8850c 100644
--- a/pkg/private/mocks/net/BUILD.bazel
+++ b/pkg/private/mocks/net/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/mocks/net/mock_net/BUILD.bazel b/pkg/private/mocks/net/mock_net/BUILD.bazel
index a3b74a1db9..c86bd257e0 100644
--- a/pkg/private/mocks/net/mock_net/BUILD.bazel
+++ b/pkg/private/mocks/net/mock_net/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/private/prom/BUILD.bazel b/pkg/private/prom/BUILD.bazel
index 04aa5d3e89..1d7f2e8d91 100644
--- a/pkg/private/prom/BUILD.bazel
+++ b/pkg/private/prom/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/prom/promtest/BUILD.bazel b/pkg/private/prom/promtest/BUILD.bazel
index 064458bdab..2de1d90331 100644
--- a/pkg/private/prom/promtest/BUILD.bazel
+++ b/pkg/private/prom/promtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/serrors/BUILD.bazel b/pkg/private/serrors/BUILD.bazel
index 870e0399ad..d08177170c 100644
--- a/pkg/private/serrors/BUILD.bazel
+++ b/pkg/private/serrors/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/private/util/BUILD.bazel b/pkg/private/util/BUILD.bazel
index 9b7f2e97e4..0ee40d68a7 100644
--- a/pkg/private/util/BUILD.bazel
+++ b/pkg/private/util/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/private/xtest/BUILD.bazel b/pkg/private/xtest/BUILD.bazel
index 212a9c5256..8852de5462 100644
--- a/pkg/private/xtest/BUILD.bazel
+++ b/pkg/private/xtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/xtest/graph/BUILD.bazel b/pkg/private/xtest/graph/BUILD.bazel
index 0a2abb98b8..4c78296281 100644
--- a/pkg/private/xtest/graph/BUILD.bazel
+++ b/pkg/private/xtest/graph/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/private/xtest/graphupdater/BUILD.bazel b/pkg/private/xtest/graphupdater/BUILD.bazel
index afe3dac9ad..b113ab92bf 100644
--- a/pkg/private/xtest/graphupdater/BUILD.bazel
+++ b/pkg/private/xtest/graphupdater/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/pkg/private/xtest/matchers/BUILD.bazel b/pkg/private/xtest/matchers/BUILD.bazel
index 36c859d34b..b9c7c106ef 100644
--- a/pkg/private/xtest/matchers/BUILD.bazel
+++ b/pkg/private/xtest/matchers/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/private/xtest/mock_xtest/BUILD.bazel b/pkg/private/xtest/mock_xtest/BUILD.bazel
index 576a5559dc..442d9efb24 100644
--- a/pkg/private/xtest/mock_xtest/BUILD.bazel
+++ b/pkg/private/xtest/mock_xtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/proto/control_plane/mock_control_plane/BUILD.bazel b/pkg/proto/control_plane/mock_control_plane/BUILD.bazel
index b0aba72f52..230178045c 100644
--- a/pkg/proto/control_plane/mock_control_plane/BUILD.bazel
+++ b/pkg/proto/control_plane/mock_control_plane/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/proto/discovery/mock_discovery/BUILD.bazel b/pkg/proto/discovery/mock_discovery/BUILD.bazel
index fcad4db331..a2bfabea53 100644
--- a/pkg/proto/discovery/mock_discovery/BUILD.bazel
+++ b/pkg/proto/discovery/mock_discovery/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/proto/hidden_segment/mock_hidden_segment/BUILD.bazel b/pkg/proto/hidden_segment/mock_hidden_segment/BUILD.bazel
index 20125b3180..82c9cf4c7e 100644
--- a/pkg/proto/hidden_segment/mock_hidden_segment/BUILD.bazel
+++ b/pkg/proto/hidden_segment/mock_hidden_segment/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/scrypto/BUILD.bazel b/pkg/scrypto/BUILD.bazel
index 64b04cab3c..df3e1a58b4 100644
--- a/pkg/scrypto/BUILD.bazel
+++ b/pkg/scrypto/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/scrypto/cms/oid/BUILD.bazel b/pkg/scrypto/cms/oid/BUILD.bazel
index 52d65a490c..881c0a8917 100644
--- a/pkg/scrypto/cms/oid/BUILD.bazel
+++ b/pkg/scrypto/cms/oid/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/scrypto/cms/protocol/BUILD.bazel b/pkg/scrypto/cms/protocol/BUILD.bazel
index ee64abc967..9e0a6d5032 100644
--- a/pkg/scrypto/cms/protocol/BUILD.bazel
+++ b/pkg/scrypto/cms/protocol/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/scrypto/cppki/BUILD.bazel b/pkg/scrypto/cppki/BUILD.bazel
index bee6b2478e..a56ce70ff8 100644
--- a/pkg/scrypto/cppki/BUILD.bazel
+++ b/pkg/scrypto/cppki/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/scrypto/cppki/testdata/update_certs.sh b/pkg/scrypto/cppki/testdata/update_certs.sh
index faf611c03a..8488a178c4 100755
--- a/pkg/scrypto/cppki/testdata/update_certs.sh
+++ b/pkg/scrypto/cppki/testdata/update_certs.sh
@@ -2,7 +2,7 @@
set -eo pipefail
-PLAYGROUND=$(pwd)/../../../../scripts/cryptoplayground
+PLAYGROUND=$(pwd)/../../../../tools/cryptoplayground
PUBDIR="$SAFEDIR"
KEYDIR="$SAFEDIR"
diff --git a/pkg/scrypto/signed/BUILD.bazel b/pkg/scrypto/signed/BUILD.bazel
index 0dee82deb4..e08f1bd5e9 100644
--- a/pkg/scrypto/signed/BUILD.bazel
+++ b/pkg/scrypto/signed/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/segment/BUILD.bazel b/pkg/segment/BUILD.bazel
index 9622e6f4f9..c4185122dd 100644
--- a/pkg/segment/BUILD.bazel
+++ b/pkg/segment/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/segment/extensions/digest/BUILD.bazel b/pkg/segment/extensions/digest/BUILD.bazel
index de58e7178f..a174a73076 100644
--- a/pkg/segment/extensions/digest/BUILD.bazel
+++ b/pkg/segment/extensions/digest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/segment/extensions/epic/BUILD.bazel b/pkg/segment/extensions/epic/BUILD.bazel
index d1f640d8cd..57a78f6e69 100644
--- a/pkg/segment/extensions/epic/BUILD.bazel
+++ b/pkg/segment/extensions/epic/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/segment/extensions/staticinfo/BUILD.bazel b/pkg/segment/extensions/staticinfo/BUILD.bazel
index a52b0fb044..b41404d42e 100644
--- a/pkg/segment/extensions/staticinfo/BUILD.bazel
+++ b/pkg/segment/extensions/staticinfo/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/segment/mock_seg/BUILD.bazel b/pkg/segment/mock_seg/BUILD.bazel
index dbfaeb8be2..e99f805b2c 100644
--- a/pkg/segment/mock_seg/BUILD.bazel
+++ b/pkg/segment/mock_seg/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/slayers/BUILD.bazel b/pkg/slayers/BUILD.bazel
index 8943782102..8796f3e948 100644
--- a/pkg/slayers/BUILD.bazel
+++ b/pkg/slayers/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/internal/bfd/BUILD.bazel b/pkg/slayers/internal/bfd/BUILD.bazel
index 5a9d325b30..8d4a0a6479 100644
--- a/pkg/slayers/internal/bfd/BUILD.bazel
+++ b/pkg/slayers/internal/bfd/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_test")
+load("//tools/lint:go.bzl", "go_test")
go_test(
name = "go_default_test",
diff --git a/pkg/slayers/internal/fuzz/BUILD.bazel b/pkg/slayers/internal/fuzz/BUILD.bazel
index c5093c387c..e122d031a6 100644
--- a/pkg/slayers/internal/fuzz/BUILD.bazel
+++ b/pkg/slayers/internal/fuzz/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/path/BUILD.bazel b/pkg/slayers/path/BUILD.bazel
index 4a8ec89464..d580caa581 100644
--- a/pkg/slayers/path/BUILD.bazel
+++ b/pkg/slayers/path/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/path/empty/BUILD.bazel b/pkg/slayers/path/empty/BUILD.bazel
index c5fbaedd88..6bab36d7e3 100644
--- a/pkg/slayers/path/empty/BUILD.bazel
+++ b/pkg/slayers/path/empty/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/path/epic/BUILD.bazel b/pkg/slayers/path/epic/BUILD.bazel
index 2362e4d940..f8012cab38 100644
--- a/pkg/slayers/path/epic/BUILD.bazel
+++ b/pkg/slayers/path/epic/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/path/onehop/BUILD.bazel b/pkg/slayers/path/onehop/BUILD.bazel
index 66bfb00350..2984e72680 100644
--- a/pkg/slayers/path/onehop/BUILD.bazel
+++ b/pkg/slayers/path/onehop/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/slayers/path/scion/BUILD.bazel b/pkg/slayers/path/scion/BUILD.bazel
index dc7e51590b..a4a57739fa 100644
--- a/pkg/slayers/path/scion/BUILD.bazel
+++ b/pkg/slayers/path/scion/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/snet/BUILD.bazel b/pkg/snet/BUILD.bazel
index b9743c3ac1..d2ab4a31b8 100644
--- a/pkg/snet/BUILD.bazel
+++ b/pkg/snet/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/snet/addrutil/BUILD.bazel b/pkg/snet/addrutil/BUILD.bazel
index cf7639b656..3c83469485 100644
--- a/pkg/snet/addrutil/BUILD.bazel
+++ b/pkg/snet/addrutil/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/snet/metrics/BUILD.bazel b/pkg/snet/metrics/BUILD.bazel
index e22823db27..b910aecade 100644
--- a/pkg/snet/metrics/BUILD.bazel
+++ b/pkg/snet/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/snet/mock_snet/BUILD.bazel b/pkg/snet/mock_snet/BUILD.bazel
index 740319556b..43fcbb4eff 100644
--- a/pkg/snet/mock_snet/BUILD.bazel
+++ b/pkg/snet/mock_snet/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/snet/path/BUILD.bazel b/pkg/snet/path/BUILD.bazel
index 2a37c1210f..351e08c2e3 100644
--- a/pkg/snet/path/BUILD.bazel
+++ b/pkg/snet/path/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/snet/squic/BUILD.bazel b/pkg/snet/squic/BUILD.bazel
index 4df8aa9d86..c214a7be20 100644
--- a/pkg/snet/squic/BUILD.bazel
+++ b/pkg/snet/squic/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/sock/reliable/BUILD.bazel b/pkg/sock/reliable/BUILD.bazel
index df696044a0..290cff3f8a 100644
--- a/pkg/sock/reliable/BUILD.bazel
+++ b/pkg/sock/reliable/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/sock/reliable/internal/metrics/BUILD.bazel b/pkg/sock/reliable/internal/metrics/BUILD.bazel
index df7c7b0f3d..6ca88bea68 100644
--- a/pkg/sock/reliable/internal/metrics/BUILD.bazel
+++ b/pkg/sock/reliable/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/sock/reliable/mock_reliable/BUILD.bazel b/pkg/sock/reliable/mock_reliable/BUILD.bazel
index f54a486f42..fa320efbb3 100644
--- a/pkg/sock/reliable/mock_reliable/BUILD.bazel
+++ b/pkg/sock/reliable/mock_reliable/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/pkg/sock/reliable/reconnect/BUILD.bazel b/pkg/sock/reliable/reconnect/BUILD.bazel
index 22cc6eace4..5a56242998 100644
--- a/pkg/sock/reliable/reconnect/BUILD.bazel
+++ b/pkg/sock/reliable/reconnect/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/pkg/sock/reliable/reconnect/internal/metrics/BUILD.bazel b/pkg/sock/reliable/reconnect/internal/metrics/BUILD.bazel
index 0670293f6f..4de0d23ca7 100644
--- a/pkg/sock/reliable/reconnect/internal/metrics/BUILD.bazel
+++ b/pkg/sock/reliable/reconnect/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/pkg/sock/reliable/reconnect/mock_reconnect/BUILD.bazel b/pkg/sock/reliable/reconnect/mock_reconnect/BUILD.bazel
index a67b301584..646bcdb7fe 100644
--- a/pkg/sock/reliable/reconnect/mock_reconnect/BUILD.bazel
+++ b/pkg/sock/reliable/reconnect/mock_reconnect/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/app/BUILD.bazel b/private/app/BUILD.bazel
index 16dd810838..a9589a07c5 100644
--- a/private/app/BUILD.bazel
+++ b/private/app/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/appnet/BUILD.bazel b/private/app/appnet/BUILD.bazel
index 1d5b395700..a795a6dcdc 100644
--- a/private/app/appnet/BUILD.bazel
+++ b/private/app/appnet/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/appnet/mock_infraenv/BUILD.bazel b/private/app/appnet/mock_infraenv/BUILD.bazel
index 17cf8fc204..38d66582bd 100644
--- a/private/app/appnet/mock_infraenv/BUILD.bazel
+++ b/private/app/appnet/mock_infraenv/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/app/command/BUILD.bazel b/private/app/command/BUILD.bazel
index 74a5fb8400..504d2ff691 100644
--- a/private/app/command/BUILD.bazel
+++ b/private/app/command/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/app/env/BUILD.bazel b/private/app/env/BUILD.bazel
index 841014b8c8..803ef88fa7 100644
--- a/private/app/env/BUILD.bazel
+++ b/private/app/env/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/feature/BUILD.bazel b/private/app/feature/BUILD.bazel
index 805fb2c1a6..2704ecd9b0 100644
--- a/private/app/feature/BUILD.bazel
+++ b/private/app/feature/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/flag/BUILD.bazel b/private/app/flag/BUILD.bazel
index f0c64ab04f..f642420454 100644
--- a/private/app/flag/BUILD.bazel
+++ b/private/app/flag/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/launcher/BUILD.bazel b/private/app/launcher/BUILD.bazel
index 193a83cc9a..5b4d3d7307 100644
--- a/private/app/launcher/BUILD.bazel
+++ b/private/app/launcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/path/BUILD.bazel b/private/app/path/BUILD.bazel
index 2e11c0425f..d6df278e2a 100644
--- a/private/app/path/BUILD.bazel
+++ b/private/app/path/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/app/path/pathprobe/BUILD.bazel b/private/app/path/pathprobe/BUILD.bazel
index c78fc53374..281d5880ce 100644
--- a/private/app/path/pathprobe/BUILD.bazel
+++ b/private/app/path/pathprobe/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/ca/api/BUILD.bazel b/private/ca/api/BUILD.bazel
index 001fa6d511..45184acafe 100644
--- a/private/ca/api/BUILD.bazel
+++ b/private/ca/api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
openapi_generate_go(
diff --git a/private/ca/config/BUILD.bazel b/private/ca/config/BUILD.bazel
index 76c47762f1..a760a3d0df 100644
--- a/private/ca/config/BUILD.bazel
+++ b/private/ca/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/ca/renewal/BUILD.bazel b/private/ca/renewal/BUILD.bazel
index 777975c227..946b62b71e 100644
--- a/private/ca/renewal/BUILD.bazel
+++ b/private/ca/renewal/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/ca/renewal/grpc/BUILD.bazel b/private/ca/renewal/grpc/BUILD.bazel
index 58306b2f75..cfc5aeb4f6 100644
--- a/private/ca/renewal/grpc/BUILD.bazel
+++ b/private/ca/renewal/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/ca/renewal/grpc/mock_grpc/BUILD.bazel b/private/ca/renewal/grpc/mock_grpc/BUILD.bazel
index b168beb475..01940388c1 100644
--- a/private/ca/renewal/grpc/mock_grpc/BUILD.bazel
+++ b/private/ca/renewal/grpc/mock_grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/ca/renewal/metrics/BUILD.bazel b/private/ca/renewal/metrics/BUILD.bazel
index f14d82cbde..f8cd77fc7a 100644
--- a/private/ca/renewal/metrics/BUILD.bazel
+++ b/private/ca/renewal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/ca/renewal/mock_renewal/BUILD.bazel b/private/ca/renewal/mock_renewal/BUILD.bazel
index 9aae6d5fb8..cfd0b59301 100644
--- a/private/ca/renewal/mock_renewal/BUILD.bazel
+++ b/private/ca/renewal/mock_renewal/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/ca/renewal/request_test.go b/private/ca/renewal/request_test.go
index a969d7cb85..5ec6a8f261 100644
--- a/private/ca/renewal/request_test.go
+++ b/private/ca/renewal/request_test.go
@@ -97,7 +97,7 @@ func TestUpdateCryptoLegacy(t *testing.T) {
require.NoError(t, err)
root, err := filepath.Abs("../../../../")
require.NoError(t, err)
- playground, err := filepath.Abs(filepath.Join(root, "scripts", "cryptoplayground"))
+ playground, err := filepath.Abs(filepath.Join(root, "tools", "cryptoplayground"))
require.NoError(t, err)
cmd := exec.Command("sh", "-c", filepath.Join("testdata", "update_certs.sh"))
cmd.Env = []string{
diff --git a/private/config/BUILD.bazel b/private/config/BUILD.bazel
index d18f1828fa..5be99df162 100644
--- a/private/config/BUILD.bazel
+++ b/private/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/discovery/BUILD.bazel b/private/discovery/BUILD.bazel
index 7c2aae569d..05c9930fb6 100644
--- a/private/discovery/BUILD.bazel
+++ b/private/discovery/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/discovery/mock_discovery/BUILD.bazel b/private/discovery/mock_discovery/BUILD.bazel
index 7a1cdceac2..3d180e0170 100644
--- a/private/discovery/mock_discovery/BUILD.bazel
+++ b/private/discovery/mock_discovery/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/env/BUILD.bazel b/private/env/BUILD.bazel
index 52ee2eff81..2a4192a2c6 100644
--- a/private/env/BUILD.bazel
+++ b/private/env/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/env/envtest/BUILD.bazel b/private/env/envtest/BUILD.bazel
index 3a1c8fe91b..4b8d498158 100644
--- a/private/env/envtest/BUILD.bazel
+++ b/private/env/envtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/file/BUILD.bazel b/private/file/BUILD.bazel
index e4b3a7913f..07820351c0 100644
--- a/private/file/BUILD.bazel
+++ b/private/file/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@com_github_scionproto_scion//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/keyconf/BUILD.bazel b/private/keyconf/BUILD.bazel
index 21685ac9b3..84c0f433d3 100644
--- a/private/keyconf/BUILD.bazel
+++ b/private/keyconf/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/mgmtapi/BUILD.bazel b/private/mgmtapi/BUILD.bazel
index 1a09849e85..cb70a725d7 100644
--- a/private/mgmtapi/BUILD.bazel
+++ b/private/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/mgmtapi/cppki/api/BUILD.bazel b/private/mgmtapi/cppki/api/BUILD.bazel
index e243ae11d6..01cc4fe911 100644
--- a/private/mgmtapi/cppki/api/BUILD.bazel
+++ b/private/mgmtapi/cppki/api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
openapi_generate_go(
diff --git a/private/mgmtapi/health/api/BUILD.bazel b/private/mgmtapi/health/api/BUILD.bazel
index 8b75719391..a547133556 100644
--- a/private/mgmtapi/health/api/BUILD.bazel
+++ b/private/mgmtapi/health/api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
openapi_generate_go(
diff --git a/private/mgmtapi/jwtauth/BUILD.bazel b/private/mgmtapi/jwtauth/BUILD.bazel
index be87277a57..d20f990c8e 100644
--- a/private/mgmtapi/jwtauth/BUILD.bazel
+++ b/private/mgmtapi/jwtauth/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/mgmtapi/mgmtapitest/BUILD.bazel b/private/mgmtapi/mgmtapitest/BUILD.bazel
index 6d085dcfb8..28160b8c6f 100644
--- a/private/mgmtapi/mgmtapitest/BUILD.bazel
+++ b/private/mgmtapi/mgmtapitest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/mgmtapi/segments/api/BUILD.bazel b/private/mgmtapi/segments/api/BUILD.bazel
index 5e6d7fad73..37c6e33fde 100644
--- a/private/mgmtapi/segments/api/BUILD.bazel
+++ b/private/mgmtapi/segments/api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
openapi_generate_go(
diff --git a/private/mgmtapi/segments/api/mock_api/BUILD.bazel b/private/mgmtapi/segments/api/mock_api/BUILD.bazel
index 65edeb22ae..88cf47774b 100644
--- a/private/mgmtapi/segments/api/mock_api/BUILD.bazel
+++ b/private/mgmtapi/segments/api/mock_api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/path/combinator/BUILD.bazel b/private/path/combinator/BUILD.bazel
index 7c3fe6f3bb..22d437df03 100644
--- a/private/path/combinator/BUILD.bazel
+++ b/private/path/combinator/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/path/pathpol/BUILD.bazel b/private/path/pathpol/BUILD.bazel
index 2e3cb3ee0c..df95add87f 100644
--- a/private/path/pathpol/BUILD.bazel
+++ b/private/path/pathpol/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/pathdb/BUILD.bazel b/private/pathdb/BUILD.bazel
index 33ea7e493d..d2516e456c 100644
--- a/private/pathdb/BUILD.bazel
+++ b/private/pathdb/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/pathdb/mock_pathdb/BUILD.bazel b/private/pathdb/mock_pathdb/BUILD.bazel
index 3f2072da81..716f4128ac 100644
--- a/private/pathdb/mock_pathdb/BUILD.bazel
+++ b/private/pathdb/mock_pathdb/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/pathdb/query/BUILD.bazel b/private/pathdb/query/BUILD.bazel
index c94e90bfbb..949c446ed2 100644
--- a/private/pathdb/query/BUILD.bazel
+++ b/private/pathdb/query/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/periodic/BUILD.bazel b/private/periodic/BUILD.bazel
index f1a980315d..c1c9526b83 100644
--- a/private/periodic/BUILD.bazel
+++ b/private/periodic/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/periodic/internal/metrics/BUILD.bazel b/private/periodic/internal/metrics/BUILD.bazel
index f9f0c8eda8..3789f7f246 100644
--- a/private/periodic/internal/metrics/BUILD.bazel
+++ b/private/periodic/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/periodic/internal/metrics/mock_metrics/BUILD.bazel b/private/periodic/internal/metrics/mock_metrics/BUILD.bazel
index df52a39932..11c008f7c2 100644
--- a/private/periodic/internal/metrics/mock_metrics/BUILD.bazel
+++ b/private/periodic/internal/metrics/mock_metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/revcache/BUILD.bazel b/private/revcache/BUILD.bazel
index efd4a29b31..252cbd3d20 100644
--- a/private/revcache/BUILD.bazel
+++ b/private/revcache/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/revcache/memrevcache/BUILD.bazel b/private/revcache/memrevcache/BUILD.bazel
index b2a9fa37ce..10550d6939 100644
--- a/private/revcache/memrevcache/BUILD.bazel
+++ b/private/revcache/memrevcache/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/revcache/mock_revcache/BUILD.bazel b/private/revcache/mock_revcache/BUILD.bazel
index ae70b72036..69c7fa519a 100644
--- a/private/revcache/mock_revcache/BUILD.bazel
+++ b/private/revcache/mock_revcache/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/revcache/revcachetest/BUILD.bazel b/private/revcache/revcachetest/BUILD.bazel
index a3c2a36a72..0043af6b6e 100644
--- a/private/revcache/revcachetest/BUILD.bazel
+++ b/private/revcache/revcachetest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/ringbuf/BUILD.bazel b/private/ringbuf/BUILD.bazel
index 5411817527..62fa66b0b5 100644
--- a/private/ringbuf/BUILD.bazel
+++ b/private/ringbuf/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/ringbuf/internal/metrics/BUILD.bazel b/private/ringbuf/internal/metrics/BUILD.bazel
index 56594cd1c3..abcfed6949 100644
--- a/private/ringbuf/internal/metrics/BUILD.bazel
+++ b/private/ringbuf/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/segment/segfetcher/BUILD.bazel b/private/segment/segfetcher/BUILD.bazel
index 2ff714578b..f7286b5dc4 100644
--- a/private/segment/segfetcher/BUILD.bazel
+++ b/private/segment/segfetcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/segment/segfetcher/grpc/BUILD.bazel b/private/segment/segfetcher/grpc/BUILD.bazel
index 49fa608618..2873872f82 100644
--- a/private/segment/segfetcher/grpc/BUILD.bazel
+++ b/private/segment/segfetcher/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/segment/segfetcher/internal/metrics/BUILD.bazel b/private/segment/segfetcher/internal/metrics/BUILD.bazel
index 91dca13ef6..f2714ac84a 100644
--- a/private/segment/segfetcher/internal/metrics/BUILD.bazel
+++ b/private/segment/segfetcher/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/segment/segfetcher/mock_segfetcher/BUILD.bazel b/private/segment/segfetcher/mock_segfetcher/BUILD.bazel
index 05693c5f15..66f9e5d844 100644
--- a/private/segment/segfetcher/mock_segfetcher/BUILD.bazel
+++ b/private/segment/segfetcher/mock_segfetcher/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/segment/seghandler/BUILD.bazel b/private/segment/seghandler/BUILD.bazel
index 212b82e442..0f14b68e22 100644
--- a/private/segment/seghandler/BUILD.bazel
+++ b/private/segment/seghandler/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/segment/seghandler/mock_seghandler/BUILD.bazel b/private/segment/seghandler/mock_seghandler/BUILD.bazel
index 3690ef6f63..00589e0eef 100644
--- a/private/segment/seghandler/mock_seghandler/BUILD.bazel
+++ b/private/segment/seghandler/mock_seghandler/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/segment/segverifier/BUILD.bazel b/private/segment/segverifier/BUILD.bazel
index 4a28c2ed74..92b108696e 100644
--- a/private/segment/segverifier/BUILD.bazel
+++ b/private/segment/segverifier/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/segment/verifier/BUILD.bazel b/private/segment/verifier/BUILD.bazel
index 42dda48dab..f64beac377 100644
--- a/private/segment/verifier/BUILD.bazel
+++ b/private/segment/verifier/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/segment/verifier/mock_verifier/BUILD.bazel b/private/segment/verifier/mock_verifier/BUILD.bazel
index 6e29de866e..0440599dce 100644
--- a/private/segment/verifier/mock_verifier/BUILD.bazel
+++ b/private/segment/verifier/mock_verifier/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/service/BUILD.bazel b/private/service/BUILD.bazel
index 6f2486b5d1..fa230b8213 100644
--- a/private/service/BUILD.bazel
+++ b/private/service/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/BUILD.bazel b/private/storage/BUILD.bazel
index bfdf4fe5ef..f1df75bc3d 100644
--- a/private/storage/BUILD.bazel
+++ b/private/storage/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/beacon/BUILD.bazel b/private/storage/beacon/BUILD.bazel
index 999213e3b9..f7fdb30ebd 100644
--- a/private/storage/beacon/BUILD.bazel
+++ b/private/storage/beacon/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/beacon/dbtest/BUILD.bazel b/private/storage/beacon/dbtest/BUILD.bazel
index 629e495a83..eca1fe10d7 100644
--- a/private/storage/beacon/dbtest/BUILD.bazel
+++ b/private/storage/beacon/dbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/beacon/metrics/BUILD.bazel b/private/storage/beacon/metrics/BUILD.bazel
index dce931e699..895ba4de4c 100644
--- a/private/storage/beacon/metrics/BUILD.bazel
+++ b/private/storage/beacon/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/beacon/sqlite/BUILD.bazel b/private/storage/beacon/sqlite/BUILD.bazel
index 9c4eba60f5..1e265e09cd 100644
--- a/private/storage/beacon/sqlite/BUILD.bazel
+++ b/private/storage/beacon/sqlite/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/cleaner/BUILD.bazel b/private/storage/cleaner/BUILD.bazel
index cea6f11fe4..153c2ed157 100644
--- a/private/storage/cleaner/BUILD.bazel
+++ b/private/storage/cleaner/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/db/BUILD.bazel b/private/storage/db/BUILD.bazel
index 3c8459f554..fa5d8594a5 100644
--- a/private/storage/db/BUILD.bazel
+++ b/private/storage/db/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/mock_storage/BUILD.bazel b/private/storage/mock_storage/BUILD.bazel
index 5ef8bd9cb2..c2be906309 100644
--- a/private/storage/mock_storage/BUILD.bazel
+++ b/private/storage/mock_storage/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/storage/path/BUILD.bazel b/private/storage/path/BUILD.bazel
index 9892dbf1d2..afeaa773fe 100644
--- a/private/storage/path/BUILD.bazel
+++ b/private/storage/path/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/path/dbtest/BUILD.bazel b/private/storage/path/dbtest/BUILD.bazel
index 1da4cd5100..46dd75ae17 100644
--- a/private/storage/path/dbtest/BUILD.bazel
+++ b/private/storage/path/dbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/path/metrics/BUILD.bazel b/private/storage/path/metrics/BUILD.bazel
index 327152fea3..6a20fc0d65 100644
--- a/private/storage/path/metrics/BUILD.bazel
+++ b/private/storage/path/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/path/sqlite/BUILD.bazel b/private/storage/path/sqlite/BUILD.bazel
index 38804c6e91..480c055e8a 100644
--- a/private/storage/path/sqlite/BUILD.bazel
+++ b/private/storage/path/sqlite/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/test/BUILD.bazel b/private/storage/test/BUILD.bazel
index bfbaa74e68..ed5d79b68d 100644
--- a/private/storage/test/BUILD.bazel
+++ b/private/storage/test/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/trust/BUILD.bazel b/private/storage/trust/BUILD.bazel
index 5e62695b33..d32c477194 100644
--- a/private/storage/trust/BUILD.bazel
+++ b/private/storage/trust/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/trust/dbtest/BUILD.bazel b/private/storage/trust/dbtest/BUILD.bazel
index f7cf9c96d2..b83184db02 100644
--- a/private/storage/trust/dbtest/BUILD.bazel
+++ b/private/storage/trust/dbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/storage/trust/fspersister/BUILD.bazel b/private/storage/trust/fspersister/BUILD.bazel
index bc3da1dff6..c4933af041 100644
--- a/private/storage/trust/fspersister/BUILD.bazel
+++ b/private/storage/trust/fspersister/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/trust/metrics/BUILD.bazel b/private/storage/trust/metrics/BUILD.bazel
index e492abaccb..99536ccc2d 100644
--- a/private/storage/trust/metrics/BUILD.bazel
+++ b/private/storage/trust/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/trust/sqlite/BUILD.bazel b/private/storage/trust/sqlite/BUILD.bazel
index 17c070f2b1..65f66ca7ba 100644
--- a/private/storage/trust/sqlite/BUILD.bazel
+++ b/private/storage/trust/sqlite/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/storage/utils/BUILD.bazel b/private/storage/utils/BUILD.bazel
index 166c4c29ff..b622724608 100644
--- a/private/storage/utils/BUILD.bazel
+++ b/private/storage/utils/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/svc/BUILD.bazel b/private/svc/BUILD.bazel
index a63cc32fbd..377aaf6639 100644
--- a/private/svc/BUILD.bazel
+++ b/private/svc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/svc/internal/ctxconn/BUILD.bazel b/private/svc/internal/ctxconn/BUILD.bazel
index e1b879b8b9..c50d5f3326 100644
--- a/private/svc/internal/ctxconn/BUILD.bazel
+++ b/private/svc/internal/ctxconn/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/svc/internal/ctxconn/mock_ctxconn/BUILD.bazel b/private/svc/internal/ctxconn/mock_ctxconn/BUILD.bazel
index eecd95bcd1..f6ab5deda2 100644
--- a/private/svc/internal/ctxconn/mock_ctxconn/BUILD.bazel
+++ b/private/svc/internal/ctxconn/mock_ctxconn/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/svc/mock_svc/BUILD.bazel b/private/svc/mock_svc/BUILD.bazel
index 2c92a07627..e56c88d57d 100644
--- a/private/svc/mock_svc/BUILD.bazel
+++ b/private/svc/mock_svc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/topology/BUILD.bazel b/private/topology/BUILD.bazel
index 6ff61ad7b1..d7f4604d24 100644
--- a/private/topology/BUILD.bazel
+++ b/private/topology/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/topology/json/BUILD.bazel b/private/topology/json/BUILD.bazel
index 4c72280987..84a560ada1 100644
--- a/private/topology/json/BUILD.bazel
+++ b/private/topology/json/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/topology/mock_topology/BUILD.bazel b/private/topology/mock_topology/BUILD.bazel
index 027be3015a..71f1eafd39 100644
--- a/private/topology/mock_topology/BUILD.bazel
+++ b/private/topology/mock_topology/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/topology/underlay/BUILD.bazel b/private/topology/underlay/BUILD.bazel
index 7dd2e0fdc8..d2c3111ef5 100644
--- a/private/topology/underlay/BUILD.bazel
+++ b/private/topology/underlay/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/tracing/BUILD.bazel b/private/tracing/BUILD.bazel
index 303d520bcf..48419fc625 100644
--- a/private/tracing/BUILD.bazel
+++ b/private/tracing/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/trust/BUILD.bazel b/private/trust/BUILD.bazel
index 952faafe2f..e25ee33e59 100644
--- a/private/trust/BUILD.bazel
+++ b/private/trust/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/trust/compat/BUILD.bazel b/private/trust/compat/BUILD.bazel
index 7cd61e66b0..6a6dad3e2f 100644
--- a/private/trust/compat/BUILD.bazel
+++ b/private/trust/compat/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/trust/config/BUILD.bazel b/private/trust/config/BUILD.bazel
index c0ac43914d..7dbe003d22 100644
--- a/private/trust/config/BUILD.bazel
+++ b/private/trust/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/trust/dbtest/BUILD.bazel b/private/trust/dbtest/BUILD.bazel
index 62e7910325..7afaa36b4e 100644
--- a/private/trust/dbtest/BUILD.bazel
+++ b/private/trust/dbtest/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/trust/dbtest/dbtest_test.go b/private/trust/dbtest/dbtest_test.go
index 1ad220ca55..939d50b4da 100644
--- a/private/trust/dbtest/dbtest_test.go
+++ b/private/trust/dbtest/dbtest_test.go
@@ -38,7 +38,7 @@ func TestUpdateCrypto(t *testing.T) {
require.NoError(t, err)
root, err := filepath.Abs("../../../../")
require.NoError(t, err)
- playground, err := filepath.Abs(filepath.Join(root, "scripts", "cryptoplayground"))
+ playground, err := filepath.Abs(filepath.Join(root, "tools", "cryptoplayground"))
require.NoError(t, err)
cmd := exec.Command("sh", "-c", filepath.Join("testdata", "update_certs.sh"))
cmd.Env = []string{
diff --git a/private/trust/grpc/BUILD.bazel b/private/trust/grpc/BUILD.bazel
index d34d1dab95..2775d3ad78 100644
--- a/private/trust/grpc/BUILD.bazel
+++ b/private/trust/grpc/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/private/trust/internal/metrics/BUILD.bazel b/private/trust/internal/metrics/BUILD.bazel
index 14197a2b68..270e2495ca 100644
--- a/private/trust/internal/metrics/BUILD.bazel
+++ b/private/trust/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/trust/metrics/BUILD.bazel b/private/trust/metrics/BUILD.bazel
index d155b36b96..87a46efaee 100644
--- a/private/trust/metrics/BUILD.bazel
+++ b/private/trust/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/trust/mock_trust/BUILD.bazel b/private/trust/mock_trust/BUILD.bazel
index 23b34fdc42..54f30db276 100644
--- a/private/trust/mock_trust/BUILD.bazel
+++ b/private/trust/mock_trust/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/private/underlay/conn/BUILD.bazel b/private/underlay/conn/BUILD.bazel
index b5ac3ef0f5..3c0395a865 100644
--- a/private/underlay/conn/BUILD.bazel
+++ b/private/underlay/conn/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/underlay/sockctrl/BUILD.bazel b/private/underlay/sockctrl/BUILD.bazel
index d15b955e32..67e19ae27d 100644
--- a/private/underlay/sockctrl/BUILD.bazel
+++ b/private/underlay/sockctrl/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/private/worker/BUILD.bazel b/private/worker/BUILD.bazel
index c30ae1f268..cbe701276f 100644
--- a/private/worker/BUILD.bazel
+++ b/private/worker/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/python/integration/__init__.py b/python/integration/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/python/lib/BUILD.bazel b/python/lib/BUILD.bazel
deleted file mode 100644
index d9c8aadc5b..0000000000
--- a/python/lib/BUILD.bazel
+++ /dev/null
@@ -1,41 +0,0 @@
-load("//lint:py.bzl", "py_library", "py_test")
-load("@pip3_deps//:requirements.bzl", "requirement")
-
-package(default_visibility = ["//visibility:public"])
-
-py_library(
- name = "scion_addr",
- srcs = ["scion_addr.py"],
- deps = [
- "//python/lib:errors",
- ],
-)
-
-py_library(
- name = "errors",
- srcs = ["errors.py"],
-)
-
-py_library(
- name = "util",
- srcs = ["util.py"],
- deps = [
- "//python/lib:errors",
- ],
-)
-
-py_test(
- name = "util_test",
- srcs = ["util_test.py"],
- deps = [":util"],
-)
-
-py_library(
- name = "types",
- srcs = ["types.py"],
-)
-
-py_library(
- name = "defines",
- srcs = ["defines.py"],
-)
diff --git a/python/lib/__init__.py b/python/lib/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/python/lib/errors.py b/python/lib/errors.py
deleted file mode 100644
index e896f0716c..0000000000
--- a/python/lib/errors.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2015 ETH Zurich
-#
-# 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.
-"""
-:mod:`errors` --- SCION Errors
-==============================
-"""
-
-
-class SCIONBaseException(Exception):
- """
- Root SCION Exception. All other exceptions derive from this.
-
- It should probably not be raised directly.
- """
-
-
-class SCIONBaseError(SCIONBaseException):
- """
- Root SCION Error exception. All other error exceptions derive from this.
-
- It should probably not be raised directly.
- """
-
-
-class SCIONIOError(SCIONBaseError):
- """IO error"""
-
-
-class SCIONYAMLError(SCIONBaseError):
- """YAML parsing error"""
-
-
-class SCIONParseError(SCIONBaseError):
- """Parsing error"""
diff --git a/python/lib/scion_addr.py b/python/lib/scion_addr.py
deleted file mode 100644
index 2636117582..0000000000
--- a/python/lib/scion_addr.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright 2014 ETH Zurich
-#
-# 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.
-"""
-:mod:`scion_addr` --- SCION host address specifications
-=======================================================
-"""
-
-# SCION
-from python.lib.errors import SCIONParseError
-
-
-class ISD_AS:
- """
- Class for representing ISD-AS pair. The underlying type is a 64-bit unsigned int; ISD is
- represented by the top 16 bits (though the top 4 bits are currently reserved), and AS by the
- lower 48 bits.
- See formatting and allocations here:
- https://github.com/scionproto/scion/wiki/ISD-and-AS-numbering
- """
- ISD_BITS = 16
- MAX_ISD = (1 << ISD_BITS) - 1
- AS_BITS = 48
- MAX_AS = (1 << AS_BITS) - 1
- BGP_AS_BITS = 32
- MAX_BGP_AS = (1 << BGP_AS_BITS) - 1
- HEX_AS_PARTS = 3 # E.g. ff00:0:abcd
- HEX_SEPARATOR = ":"
- HEX_FILE_SEPARATOR = "_"
- MAX_HEX_AS_PART = 0xffff
-
- def __init__(self, raw=None):
- self._isd = 0
- self._as = 0
- if raw:
- self._parse(raw)
-
- def _parse(self, raw):
- """
- :param str raw: a string of the format "isd-as".
- """
- parts = raw.split("-")
- if len(parts) != 2:
- raise SCIONParseError("Unable to split ISD-AS in string: %s" % raw)
- isd_s, as_s = parts
- self._parse_isd_str(isd_s)
- for as_sep in [self.HEX_SEPARATOR, self.HEX_FILE_SEPARATOR]:
- if as_sep in as_s:
- self._parse_hex_as(as_s, as_sep)
- break
- else:
- self._parse_dec_as(as_s)
-
- def _parse_isd_str(self, raw):
- try:
- self._isd = int(raw)
- except ValueError:
- raise SCIONParseError("Unable to parse ISD from string: %s" % raw) from None
- if self._isd > self.MAX_ISD:
- raise SCIONParseError("ISD too large (max: %d): %s" % (self.MAX_ISD, raw))
-
- def _parse_dec_as(self, raw):
- try:
- self._as = int(raw, base=10)
- except ValueError:
- raise SCIONParseError("Unable to parse decimal AS from string: %s" % raw) from None
- if self._as > self.MAX_BGP_AS:
- raise SCIONParseError("Decimal AS too large (max: %d): %s" % (self.MAX_BGP_AS, raw))
-
- def _parse_hex_as(self, raw, as_sep=HEX_SEPARATOR):
- try:
- as_parts = raw.split(as_sep)
- except ValueError:
- raise SCIONParseError("Unable to parse hex AS from string: %s" % raw) from None
- if len(as_parts) != self.HEX_AS_PARTS:
- raise SCIONParseError(
- "Wrong number of separators (%s) in hex AS number (expected: %d actual: %s): %s" %
- (self.HEX_SEPARATOR, self.HEX_AS_PARTS, as_parts, raw))
- self._as = 0
- for i, s in enumerate(as_parts):
- self._as <<= 16
- v = int(s, base=16)
- if v > self.MAX_HEX_AS_PART:
- raise SCIONParseError("Hex AS number has part greater than %x: %s" %
- (self.MAX_HEX_AS_PART, raw))
- self._as |= v
- if self._as > self.MAX_AS:
- raise SCIONParseError("AS too large (max: %d): %s" % (self.MAX_AS, raw))
-
- def _parse_int(self, raw):
- """
- :param int raw: a 64-bit unsigned integer
- """
- self._isd = raw >> self.AS_BITS
- self._as = raw & self.MAX_AS
-
- def int(self):
- isd_as = self._isd << self.AS_BITS
- isd_as |= self._as & self.MAX_AS
- return isd_as
-
- def any_as(self): # pragma: no cover
- return self.from_values(self._isd, 0)
-
- def is_zero(self): # pragma: no cover
- return self._isd == 0 and self._as == 0
-
- def __eq__(self, other): # pragma: no cover
- return self._isd == other._isd and self._as == other._as
-
- def isd_str(self):
- s = str(self._isd)
- if self._isd > self.MAX_ISD:
- return "%s [Illegal ISD: larger than %d]" % (s, self.MAX_ISD)
- return s
-
- def as_str(self, sep=HEX_SEPARATOR):
- dec_str = str(self._as)
- if self._as > self.MAX_AS:
- return "%s [Illegal AS: larger than %d]" % (dec_str, self.MAX_AS)
- if self._as <= self.MAX_BGP_AS:
- return str(self._as)
- s = []
- as_ = self._as
- for i in range(self.HEX_AS_PARTS):
- s.insert(0, "%x" % (as_ & self.MAX_HEX_AS_PART))
- as_ >>= 16
- return sep.join(s)
-
- def as_file_fmt(self):
- return self.as_str(self.HEX_FILE_SEPARATOR)
-
- def file_fmt(self):
- return "%s-%s" % (self.isd_str(), self.as_file_fmt())
-
- def __str__(self, as_sep=HEX_SEPARATOR):
- return "%s-%s" % (self.isd_str(), self.as_str(as_sep))
-
- def __repr__(self): # pragma: no cover
- return "ISD_AS(isd=%s, as=%s)" % (self._isd, self._as)
-
- def __len__(self): # pragma: no cover
- return self.LEN
-
- def __hash__(self): # pragma: no cover
- return hash(str(self))
-
- @classmethod
- def parse_int(cls, raw: int):
- ia = ISD_AS()
- ia._parse_int(raw)
- return ia
diff --git a/python/lib/types.py b/python/lib/types.py
deleted file mode 100644
index 46021dc16a..0000000000
--- a/python/lib/types.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2015 ETH Zurich
-# Copyright 2018 ETH Zurich, Anapaya Systems
-#
-# 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.
-"""
-:mod:`types` --- SCION types
-============================
-
-For all type classes that are used in multiple parts of the infrastructure.
-"""
-
-
-class TypeBase(object): # pragma: no cover
- @classmethod
- def to_str(cls, type_, error=False):
- for attr in dir(cls):
- if getattr(cls, attr) == type_:
- return attr
- if not error:
- return "UNKNOWN (%s)" % type_
- raise IndexError
-
- @classmethod
- def all(cls):
- return [getattr(cls, attr) for attr in dir(cls) if
- not attr.startswith("__") and
- not callable(getattr(cls, attr))]
-
-
-############################
-# Link types
-############################
-class LinkType(TypeBase):
- # XXX(worxli): these values must be kept in sync with the capnp Linktype enum
- UNSET = "unset"
- #: Link to child AS
- CHILD = "child"
- #: Link to parent AS
- PARENT = "parent"
- #: Link to peer AS
- PEER = "peer"
- #: Link to other core AS
- CORE = "core"
diff --git a/python/lib/util.py b/python/lib/util.py
deleted file mode 100644
index d683148e6e..0000000000
--- a/python/lib/util.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 2014 ETH Zurich
-#
-# 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.
-"""
-:mod:`util` --- SCION utilities
-===============================
-
-Various utilities for SCION functionality.
-"""
-# Stdlib
-import os
-
-# External packages
-import json
-import yaml
-
-# SCION
-from python.lib.errors import (
- SCIONIOError,
- SCIONYAMLError,
-)
-
-
-def write_file(file_path, text):
- """
- Write some text into a temporary file, creating its directory as needed, and
- then atomically move to target location.
-
- :param str file_path: the path to the file.
- :param str text: the file content.
- :raises:
- lib.errors.SCIONIOError: IO error occurred
- """
- # ":" is an illegal filename char on both windows and OSX, so disallow it globally to prevent
- # incompatibility.
- assert ":" not in file_path, file_path
- dir_ = os.path.dirname(file_path)
- try:
- os.makedirs(dir_, exist_ok=True)
- except OSError as e:
- raise SCIONIOError("Error creating '%s' dir: %s" %
- (dir_, e.strerror)) from None
- tmp_file = file_path + ".new"
- try:
- with open(tmp_file, 'w') as f:
- f.write(text)
- except OSError as e:
- raise SCIONIOError("Error creating/writing to temp file '%s': %s" %
- (file_path, e.strerror)) from None
- try:
- os.rename(tmp_file, file_path)
- except OSError as e:
- raise SCIONIOError("Error moving '%s' to '%s': %s" %
- (tmp_file, file_path, e.strerror)) from None
-
-
-def load_yaml_file(file_path):
- """
- Read and parse a YAML config file.
-
- :param str file_path: the path to the file.
- :returns: YAML data
- :rtype: dict
- :raises:
- lib.errors.SCIONIOError: error opening/reading from file.
- lib.errors.SCIONYAMLError: error parsing file.
- """
- try:
- with open(file_path) as f:
- return yaml.load(f, Loader=yaml.SafeLoader)
- except OSError as e:
- raise SCIONIOError("Error opening '%s': %s" %
- (file_path, e.strerror)) from None
- except (yaml.scanner.ScannerError) as e:
- raise SCIONYAMLError("Error parsing '%s': %s" %
- (file_path, e)) from None
-
-
-def load_sciond_file(file_path):
- """
- Read a SCIOND addresses file.
-
- """
- with open(file_path) as f:
- return json.load(f)
diff --git a/python/lib/util_test.py b/python/lib/util_test.py
deleted file mode 100644
index 19011a520a..0000000000
--- a/python/lib/util_test.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 2015 ETH Zurich
-#
-# 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.
-"""
-:mod:`lib_util_test` --- lib.util unit tests
-=====================================================
-"""
-# Stdlib
-import builtins
-import unittest
-from unittest.mock import patch, mock_open
-
-# External packages
-import yaml
-
-# SCION
-from python.lib.errors import (
- SCIONIOError,
- SCIONYAMLError,
-)
-from python.lib.util import (
- load_yaml_file,
- write_file,
-)
-
-
-class TestWriteFile(unittest.TestCase):
- """
- Unit tests for lib.util.write_file
- """
- @patch("python.lib.util.os.rename", autospec=True)
- @patch.object(builtins, 'open', mock_open())
- @patch("python.lib.util.os.makedirs", autospec=True)
- @patch("python.lib.util.os.path.dirname", autospec=True)
- def test_basic(self, dirname, makedirs, rename):
- dirname.return_value = "Dir_Name"
- # Call
- write_file("File_Path", "Text")
- # Tests
- dirname.assert_called_once_with("File_Path")
- makedirs.assert_called_once_with("Dir_Name", exist_ok=True)
- builtins.open.assert_called_once_with("File_Path.new", 'w')
- builtins.open.return_value.write.assert_called_once_with("Text")
- rename.assert_called_once_with("File_Path.new", "File_Path")
-
- @patch("python.lib.util.os.makedirs", autospec=True)
- def test_mkdir_error(self, mkdir):
- mkdir.side_effect = FileNotFoundError
- # Call
- with self.assertRaises(SCIONIOError):
- write_file("File_Path", "Text")
-
- @patch.object(builtins, 'open', mock_open())
- @patch("python.lib.util.os.makedirs", autospec=True)
- def test_file_error(self, mkdir):
- builtins.open.side_effect = PermissionError
- # Call
- with self.assertRaises(SCIONIOError):
- write_file("File_Path", "Text")
-
- @patch("python.lib.util.os.rename", autospec=True)
- @patch.object(builtins, 'open', mock_open())
- @patch("python.lib.util.os.makedirs", autospec=True)
- def test_rename_error(self, mkdir, rename):
- rename.side_effect = PermissionError
- # Call
- with self.assertRaises(SCIONIOError):
- write_file("File_Path", "Text")
-
-
-class TestLoadYAMLFile(unittest.TestCase):
- """
- Unit tests for lib.util.load_yaml_file
- """
- @patch.object(builtins, 'open', mock_open())
- def test_file_error(self):
- builtins.open.side_effect = IsADirectoryError
- with self.assertRaises(SCIONIOError):
- load_yaml_file("File_Path")
-
- @patch.object(builtins, 'open', mock_open())
- def test_yaml_error(self):
- with patch("python.lib.util.yaml.load", autospec=True) as loader:
- loader.side_effect = yaml.scanner.ScannerError
- with self.assertRaises(SCIONYAMLError):
- load_yaml_file("File_Path")
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/python/topology/BUILD.bazel b/python/topology/BUILD.bazel
deleted file mode 100644
index bdc067f360..0000000000
--- a/python/topology/BUILD.bazel
+++ /dev/null
@@ -1,43 +0,0 @@
-load("@pip3_deps//:requirements.bzl", "requirement")
-load("//lint:py.bzl", "py_binary", "py_library")
-
-package(default_visibility = ["//visibility:public"])
-
-py_library(
- name = "py_default_library",
- srcs = glob(["**/*.py"]),
- deps = [
- "//python/lib:defines",
- "//python/lib:scion_addr",
- "//python/lib:types",
- "//python/lib:util",
- ],
-)
-
-py_binary(
- name = "topogen",
- srcs = ["generator.py"],
- data = [
- "//scion-pki/cmd/scion-pki",
- "//tools:docker_ip",
- ],
- main = "generator.py",
- python_version = "PY3",
- srcs_version = "PY3",
- deps = [
- ":py_default_library",
- "@bazel_tools//tools/python/runfiles",
- requirement("toml"),
- requirement("plumbum"),
- requirement("pyyaml"),
- ],
-)
-
-py_binary(
- name = "topogentar",
- srcs = ["topogentar.py"],
- visibility = ["//visibility:public"],
- deps = [
- requirement("plumbum"),
- ],
-)
diff --git a/python/topology/__init__.py b/python/topology/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/python/topology/topogentar.py b/python/topology/topogentar.py
deleted file mode 100644
index c7c28d4197..0000000000
--- a/python/topology/topogentar.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python3
-
-# Copyright 2020 Anapaya Systems
-
-import os
-import shutil
-import tempfile
-
-from plumbum import cli
-from plumbum import cmd
-from plumbum import local
-
-
-class Gen(cli.Application):
- """
- Generates a tar package for the given topology file. The created tar
- contains the output of a topogen run. This is needed so that the bazel test
- can consume this tar, in bazel you can't specify an unknown amount of files
- as output, therefore a tar is used to pack everything up.
- """
- topogen_bin = './python/generator.py'
- scion_pki_bin = './bin/scion-pki'
- topo = "default.topo"
- outfile = 'gen.tar'
- params = ''
-
- @cli.switch('topogen_bin', str, help='topogen binary path (default ./python/generator.py)')
- def set_topogen_bin(self, topogen_bin: str):
- self.topogen_bin = topogen_bin
-
- @cli.switch('scion_pki', str, help='scion-pki binary path (default ./bin/scion-pki)')
- def set_scion_pki(self, scion_pki: str):
- self.scion_pki_bin = scion_pki
-
- @cli.switch('topo', str, help='Input topo file (default default.topo)')
- def set_topo(self, topo: str):
- self.topo = topo
-
- @cli.switch('out', str, help='Output tar file (default out.tar)')
- def out(self, outfile: str):
- self.outfile = outfile
-
- @cli.switch('params', str, help='Additional arguments to pass to topogen')
- def set_params(self, params: str):
- self.params = params
-
- def main(self):
- tmpdir = local.path(tempfile.mkdtemp(prefix='topogen.'))
- try:
- scion_pki = local.path(self.scion_pki_bin)
- topogen = local[self.topogen_bin]
- local.env.path.insert(0, scion_pki.parent)
- topogen_args = ['-o', tmpdir / 'gen', '-c', self.topo]
- if self.params != '':
- topogen_args += self.params.split()
- print('Running topogen with following arguments: ' + ' '.join(topogen_args))
- print(topogen(*topogen_args))
- # Remove the explicit scion root dir, so that tests can adapt this to wherever they
- # unpack the tar.
- cmd.sed('-i', 's@%s@$SCIONROOT@g' % local.path('.'), tmpdir / 'gen' / 'scion-dc.yml')
- cmd.sed('-i', 's@%s@$SCIONROOT@g' % tmpdir, tmpdir / 'gen' / 'scion-dc.yml')
- for support_dir in ['logs', 'gen-cache', 'gen-data', 'traces']:
- os.mkdir(tmpdir / support_dir)
- cmd.tar('-C', tmpdir, '-cf', self.outfile, '.')
- finally:
- shutil.rmtree(tmpdir, ignore_errors=True)
-
-
-if __name__ == "__main__":
- Gen.run()
diff --git a/python/topology/topology.bzl b/python/topology/topology.bzl
deleted file mode 100644
index 7eebb7a13c..0000000000
--- a/python/topology/topology.bzl
+++ /dev/null
@@ -1,70 +0,0 @@
-# Generates a tar with all the files generate by topogen.
-# name: name of the rule
-# src: input topology file
-# out: the output tar file
-# by default generated from the source file name, e.g. foo.topo.tar
-# disable_tracing: Disable distributed tracing
-# features: A list of features to add
-# loglvl: File logging level: debug|info|error (default "debug")
-# sig: Enable SIG in topology
-# tag: Defines which set of tag images to be used (e.g scion_cs_)
-# user: Defines 'user id: group id' to be used in docker-compose file
-# no_bfd: Switch off BFD between border routers
-#
-def topology(
- name,
- src,
- out = None,
- disable_tracing = False,
- features = None,
- loglvl = None,
- sig = False,
- tag = None,
- user = None,
- no_bfd = False):
- if not out:
- out = src + ".tar"
-
- params = "-d"
- if disable_tracing:
- params += " --disable_tracing "
- if features:
- params += " --features " + ",".join(features)
- if loglvl:
- params += " --loglvl " + loglvl
- if sig:
- params += " --sig"
- if tag:
- params += " --tag " + tag
- if user:
- params += " --user " + user
- if no_bfd:
- params += " --no_bfd"
-
- cmd = ("$(location //python/topology:topogentar) " +
- "--scion_pki $(location //scion-pki/cmd/scion-pki) " +
- "--topogen_bin $(location //python/topology:topogen) " +
- "--topo $(location " + src + ") --out $@ --params '" + params + "'")
- native.genrule(
- name = name,
- srcs = [
- src,
- ],
- outs = [out],
- cmd = cmd,
- tools = [
- "//python/topology:topogentar",
- "//python/topology:topogen",
- "//scion-pki/cmd/scion-pki",
- "//tools:docker_ip",
- ],
- )
-
- bundles = []
- if tag == "debug":
- bundles.append("//docker:debug.tar")
- else:
- bundles.append("//docker:prod.tar")
- args = ["$(location :" + name + ")"]
- for bundle in bundles:
- args.append("$(location " + bundle + ")")
diff --git a/router/BUILD.bazel b/router/BUILD.bazel
index 27da7f722b..8768d28945 100644
--- a/router/BUILD.bazel
+++ b/router/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/router/bfd/BUILD.bazel b/router/bfd/BUILD.bazel
index 2bf5a2acd9..20406beec1 100644
--- a/router/bfd/BUILD.bazel
+++ b/router/bfd/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/router/bfd/mock_bfd/BUILD.bazel b/router/bfd/mock_bfd/BUILD.bazel
index d312c798be..1d2c71b779 100644
--- a/router/bfd/mock_bfd/BUILD.bazel
+++ b/router/bfd/mock_bfd/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/router/cmd/router/BUILD.bazel b/router/cmd/router/BUILD.bazel
index 31b3932ecf..f1014ba346 100644
--- a/router/cmd/router/BUILD.bazel
+++ b/router/cmd/router/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/router/config/BUILD.bazel b/router/config/BUILD.bazel
index b1168a1385..7a6b13196b 100644
--- a/router/config/BUILD.bazel
+++ b/router/config/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/router/control/BUILD.bazel b/router/control/BUILD.bazel
index 09a68b23ca..f7355b401b 100644
--- a/router/control/BUILD.bazel
+++ b/router/control/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/router/control/internal/metrics/BUILD.bazel b/router/control/internal/metrics/BUILD.bazel
index 685dd21876..a19d47f963 100644
--- a/router/control/internal/metrics/BUILD.bazel
+++ b/router/control/internal/metrics/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/router/control/mock_api/BUILD.bazel b/router/control/mock_api/BUILD.bazel
index f05b31c43e..a5cfe082b9 100644
--- a/router/control/mock_api/BUILD.bazel
+++ b/router/control/mock_api/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/router/mgmtapi/BUILD.bazel b/router/mgmtapi/BUILD.bazel
index 5c04cac954..c2189096dc 100644
--- a/router/mgmtapi/BUILD.bazel
+++ b/router/mgmtapi/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("@com_github_scionproto_scion//rules_openapi:defs.bzl", "openapi_generate_go")
genrule(
diff --git a/router/mock_router/BUILD.bazel b/router/mock_router/BUILD.bazel
index 5b9ff2eca3..765f651a68 100644
--- a/router/mock_router/BUILD.bazel
+++ b/router/mock_router/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@com_github_jmhodges_bazel_gomock//:gomock.bzl", "gomock")
gomock(
diff --git a/scion-pki/certs/BUILD.bazel b/scion-pki/certs/BUILD.bazel
index d5737bc7a7..947e061619 100644
--- a/scion-pki/certs/BUILD.bazel
+++ b/scion-pki/certs/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/scion-pki/cmd/scion-pki/BUILD.bazel b/scion-pki/cmd/scion-pki/BUILD.bazel
index d79c1bb98e..60fb2b22f9 100644
--- a/scion-pki/cmd/scion-pki/BUILD.bazel
+++ b/scion-pki/cmd/scion-pki/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
scion_go_binary(
diff --git a/scion-pki/conf/BUILD.bazel b/scion-pki/conf/BUILD.bazel
index d474d119a6..1eaa32a2cf 100644
--- a/scion-pki/conf/BUILD.bazel
+++ b/scion-pki/conf/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
filegroup(
name = "testdata",
diff --git a/scion-pki/conf/testdata/update_certs.sh b/scion-pki/conf/testdata/update_certs.sh
index 373c4fbf1c..6beed92275 100755
--- a/scion-pki/conf/testdata/update_certs.sh
+++ b/scion-pki/conf/testdata/update_certs.sh
@@ -2,7 +2,7 @@
set -ueo pipefail
-PLAYGROUND=$(pwd)/../../../scripts/cryptoplayground
+PLAYGROUND=$(pwd)/../../../tools/cryptoplayground
PUBDIR="$SAFEDIR"
KEYDIR="$SAFEDIR"
diff --git a/scion-pki/file/BUILD.bazel b/scion-pki/file/BUILD.bazel
index a589cdfb17..f6b22b59dd 100644
--- a/scion-pki/file/BUILD.bazel
+++ b/scion-pki/file/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/scion-pki/key/BUILD.bazel b/scion-pki/key/BUILD.bazel
index d1cadc9dd1..881ffd9f88 100644
--- a/scion-pki/key/BUILD.bazel
+++ b/scion-pki/key/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/scion-pki/testcrypto/BUILD.bazel b/scion-pki/testcrypto/BUILD.bazel
index d551ac9ef3..67d020c781 100644
--- a/scion-pki/testcrypto/BUILD.bazel
+++ b/scion-pki/testcrypto/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/scion-pki/trcs/BUILD.bazel b/scion-pki/trcs/BUILD.bazel
index 8f9fd3d34e..e995b0dd9e 100644
--- a/scion-pki/trcs/BUILD.bazel
+++ b/scion-pki/trcs/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/scion-pki/trcs/combine_test.go b/scion-pki/trcs/combine_test.go
index feb075d335..11566db0b1 100644
--- a/scion-pki/trcs/combine_test.go
+++ b/scion-pki/trcs/combine_test.go
@@ -43,7 +43,7 @@ func TestCombine(t *testing.T) {
root, err := filepath.Abs("../../../")
require.NoError(t, err)
- playground, err := filepath.Abs(filepath.Join(root, "scripts", "cryptoplayground"))
+ playground, err := filepath.Abs(filepath.Join(root, "tools", "cryptoplayground"))
require.NoError(t, err)
cmd := exec.Command("sh", "-c", filepath.Join(playground, "trc_ceremony.sh"))
diff --git a/scion.sh b/scion.sh
index 289f6d0044..9f42e69f3b 100755
--- a/scion.sh
+++ b/scion.sh
@@ -1,7 +1,5 @@
#!/bin/bash
-export PYTHONPATH=.
-
# BEGIN subcommand functions
cmd_bazel_remote() {
@@ -17,7 +15,7 @@ cmd_topo_clean() {
echo "Shutting down dockerized topology..."
./tools/quiet ./tools/dc down || true
else
- ./tools/quiet supervisor/supervisor.sh shutdown
+ ./tools/quiet tools/supervisor.sh shutdown
run_teardown
fi
stop_jaeger
@@ -31,7 +29,7 @@ cmd_topology() {
cmd_topo_clean
echo "Create topology, configuration, and execution files."
- python/topology/generator.py "$@"
+ tools/topogen.py "$@"
if is_docker_be; then
./tools/quiet ./tools/dc run utils_chowner
fi
@@ -49,7 +47,7 @@ cmd_run() {
return 0
else
run_setup
- ./tools/quiet ./supervisor/supervisor.sh start all
+ ./tools/quiet tools/supervisor.sh start all
fi
}
@@ -84,12 +82,12 @@ cmd_mstart() {
./tools/dc scion up -d $services
else
run_setup
- supervisor/supervisor.sh mstart "$@"
+ tools/supervisor.sh mstart "$@"
fi
}
run_setup() {
- python/integration/set_ipv6_addr.py -a
+ tools/set_ipv6_addr.py -a
# Create dispatcher dir or change owner
local disp_dir="/run/shm/dispatcher"
[ -d "$disp_dir" ] || mkdir "$disp_dir"
@@ -97,7 +95,7 @@ run_setup() {
}
run_teardown() {
- python/integration/set_ipv6_addr.py -d
+ tools/set_ipv6_addr.py -d
local disp_dir="/run/shm/dispatcher"
if [ -e "$disp_dir" ]; then
find "$disp_dir" -xdev -mindepth 1 -print0 | xargs -r0 rm -v
@@ -109,7 +107,7 @@ cmd_stop() {
if is_docker_be; then
./tools/quiet ./tools/dc stop 'scion*'
else
- ./tools/quiet ./supervisor/supervisor.sh stop all
+ ./tools/quiet tools/supervisor.sh stop all
run_teardown
fi
stop_jaeger
@@ -121,7 +119,7 @@ cmd_mstop() {
[ -z "$services" ] && { echo "ERROR: No process matched for $@!"; exit 255; }
./tools/dc scion stop $services
else
- supervisor/supervisor.sh mstop "$@"
+ tools/supervisor.sh mstop "$@"
fi
}
@@ -142,9 +140,9 @@ cmd_mstatus() {
if [ $# -ne 0 ]; then
services="$(glob_supervisor "$@")"
[ -z "$services" ] && { echo "ERROR: No process matched for $@!"; exit 255; }
- supervisor/supervisor.sh status "$services" | grep -v RUNNING
+ tools/supervisor.sh status "$services" | grep -v RUNNING
else
- supervisor/supervisor.sh status | grep -v RUNNING
+ tools/supervisor.sh status | grep -v RUNNING
fi
[ $? -eq 1 ]
fi
@@ -155,7 +153,7 @@ cmd_mstatus() {
glob_supervisor() {
[ $# -ge 1 ] || set -- '*'
matches=
- for proc in $(supervisor/supervisor.sh status | awk '{ print $1 }'); do
+ for proc in $(tools/supervisor.sh status | awk '{ print $1 }'); do
for spec in "$@"; do
if glob_match $proc "$spec"; then
matches="$matches $proc"
@@ -237,7 +235,7 @@ cmd_help() {
Usage:
$PROGRAM topology [-d] [-c TOPOFILE]
Create topology, configuration, and execution files.
- All arguments or options are passed to topology/generator.py
+ All arguments or options are passed to tools/topogen.py
$PROGRAM run
Run network.
$PROGRAM mstart PROCESS
diff --git a/scion/cmd/scion/BUILD.bazel b/scion/cmd/scion/BUILD.bazel
index 1cf8503bba..224448f2a0 100644
--- a/scion/cmd/scion/BUILD.bazel
+++ b/scion/cmd/scion/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/scion/ping/BUILD.bazel b/scion/ping/BUILD.bazel
index 80e51e5e5a..964b11c68e 100644
--- a/scion/ping/BUILD.bazel
+++ b/scion/ping/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/scion/showpaths/BUILD.bazel b/scion/showpaths/BUILD.bazel
index 15cc4e27e4..3462edcb3e 100644
--- a/scion/showpaths/BUILD.bazel
+++ b/scion/showpaths/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/scion/traceroute/BUILD.bazel b/scion/traceroute/BUILD.bazel
index bb0c32fa78..b58bd9fe4a 100644
--- a/scion/traceroute/BUILD.bazel
+++ b/scion/traceroute/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/scripts/mastersync.sh b/scripts/mastersync.sh
deleted file mode 100644
index 29631e10b7..0000000000
--- a/scripts/mastersync.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-set -e
-
-COLOR=$(tput setaf 12)
-RESET=$(tput sgr0)
-
-log() {
- echo "$COLOR=======> $@ $RESET"
-}
-
-log "Switching to master branch"
-git checkout master
-log "Fetching upstream"
-git fetch --prune --multiple upstream origin
-log "Updating master"
-git merge --ff-only upstream/master master
-git push
-log "Merged branches:"
-git branch --merged
-log "Done"
diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel
index d3c0afef9c..af8d11d3de 100644
--- a/tools/BUILD.bazel
+++ b/tools/BUILD.bazel
@@ -1,4 +1,5 @@
-load("//lint:go.bzl", "go_library")
+load("@pip3_deps//:requirements.bzl", "requirement")
+load("//tools/lint:go.bzl", "go_library")
sh_binary(
name = "docker_ip",
@@ -13,3 +14,23 @@ go_library(
visibility = ["//visibility:public"],
deps = ["@com_github_google_go_containerregistry//cmd/registry:go_default_library"],
)
+
+py_binary(
+ name = "topogen",
+ srcs = ["topogen.py"],
+ data = [
+ "//scion-pki/cmd/scion-pki",
+ "//tools:docker_ip",
+ ],
+ main = "topogen.py",
+ python_version = "PY3",
+ srcs_version = "PY3",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//tools/topology:py_default_library",
+ "@bazel_tools//tools/python/runfiles",
+ requirement("toml"),
+ requirement("plumbum"),
+ requirement("pyyaml"),
+ ],
+)
diff --git a/tools/braccept/BUILD.bazel b/tools/braccept/BUILD.bazel
index d8ad4f5294..972054c646 100644
--- a/tools/braccept/BUILD.bazel
+++ b/tools/braccept/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/tools/braccept/cases/BUILD.bazel b/tools/braccept/cases/BUILD.bazel
index ba361e03f0..1a3142610e 100644
--- a/tools/braccept/cases/BUILD.bazel
+++ b/tools/braccept/cases/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/tools/braccept/runner/BUILD.bazel b/tools/braccept/runner/BUILD.bazel
index a6accecd65..18ef04a7a8 100644
--- a/tools/braccept/runner/BUILD.bazel
+++ b/tools/braccept/runner/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
diff --git a/tools/buildkite/BUILD.bazel b/tools/buildkite/BUILD.bazel
index d20e2ac90b..95e5e18e5f 100644
--- a/tools/buildkite/BUILD.bazel
+++ b/tools/buildkite/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/tools/buildkite/cmd/buildkite_artifacts/BUILD.bazel b/tools/buildkite/cmd/buildkite_artifacts/BUILD.bazel
index 76f20b4a44..30901f1157 100644
--- a/tools/buildkite/cmd/buildkite_artifacts/BUILD.bazel
+++ b/tools/buildkite/cmd/buildkite_artifacts/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/scripts/cryptoplayground/BUILD.bazel b/tools/cryptoplayground/BUILD.bazel
similarity index 100%
rename from scripts/cryptoplayground/BUILD.bazel
rename to tools/cryptoplayground/BUILD.bazel
diff --git a/scripts/cryptoplayground/crypto_lib.sh b/tools/cryptoplayground/crypto_lib.sh
similarity index 100%
rename from scripts/cryptoplayground/crypto_lib.sh
rename to tools/cryptoplayground/crypto_lib.sh
diff --git a/scripts/cryptoplayground/openssl.cnf b/tools/cryptoplayground/openssl.cnf
similarity index 100%
rename from scripts/cryptoplayground/openssl.cnf
rename to tools/cryptoplayground/openssl.cnf
diff --git a/scripts/cryptoplayground/trc_ceremony.sh b/tools/cryptoplayground/trc_ceremony.sh
similarity index 98%
rename from scripts/cryptoplayground/trc_ceremony.sh
rename to tools/cryptoplayground/trc_ceremony.sh
index cc0a7f08a7..31ad30283e 100755
--- a/scripts/cryptoplayground/trc_ceremony.sh
+++ b/tools/cryptoplayground/trc_ceremony.sh
@@ -4,7 +4,7 @@
# Do not remove or modify them!
export SCION_ROOT=${SCION_ROOT:-$(pwd)}
-export PLAYGROUND=${PLAYGROUND:-$SCION_ROOT/scripts/cryptoplayground}
+export PLAYGROUND=${PLAYGROUND:-$SCION_ROOT/tools/cryptoplayground}
export SAFEDIR=${SAFEDIR:-$(mktemp -d)}
export PATH="$PATH:$SCION_ROOT/bin"
diff --git a/scripts/cryptoplayground/trc_ceremony_sensitive.sh b/tools/cryptoplayground/trc_ceremony_sensitive.sh
similarity index 99%
rename from scripts/cryptoplayground/trc_ceremony_sensitive.sh
rename to tools/cryptoplayground/trc_ceremony_sensitive.sh
index 4d19ad9148..316f63e336 100755
--- a/scripts/cryptoplayground/trc_ceremony_sensitive.sh
+++ b/tools/cryptoplayground/trc_ceremony_sensitive.sh
@@ -4,7 +4,7 @@
# Do not remove or modify them!
export SCION_ROOT=${SCION_ROOT:-$(pwd)}
-export PLAYGROUND=${PLAYGROUND:-$SCION_ROOT/scripts/cryptoplayground}
+export PLAYGROUND=${PLAYGROUND:-$SCION_ROOT/tools/cryptoplayground}
export SAFEDIR=${SAFEDIR:-$(mktemp -d)}
export PATH="$PATH:$SCION_ROOT/bin"
diff --git a/tools/end2end/BUILD.bazel b/tools/end2end/BUILD.bazel
index f90e795d8a..5007b8ff4b 100644
--- a/tools/end2end/BUILD.bazel
+++ b/tools/end2end/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/tools/end2end_integration/BUILD.bazel b/tools/end2end_integration/BUILD.bazel
index 2c11023ad7..31d5ae0f26 100644
--- a/tools/end2end_integration/BUILD.bazel
+++ b/tools/end2end_integration/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/env/common.sh b/tools/env/common.sh
similarity index 100%
rename from env/common.sh
rename to tools/env/common.sh
diff --git a/env/debian/check b/tools/env/debian/check
similarity index 82%
rename from env/debian/check
rename to tools/env/debian/check
index db17e0fc52..4034e8e57f 100755
--- a/env/debian/check
+++ b/tools/env/debian/check
@@ -7,4 +7,4 @@ BASE=$(dirname "$0")
# Use a fixed sort order.
export LC_ALL=C
-comm -13 --check-order <(dpkg -l | awk '/^ii/ {print $2}' | cut -f1 -d: | sort -u) env/debian/pkgs.txt
+comm -13 --check-order <(dpkg -l | awk '/^ii/ {print $2}' | cut -f1 -d: | sort -u) $BASE/pkgs.txt
diff --git a/env/debian/deps b/tools/env/debian/deps
similarity index 100%
rename from env/debian/deps
rename to tools/env/debian/deps
diff --git a/env/debian/pkgs.txt b/tools/env/debian/pkgs.txt
similarity index 100%
rename from env/debian/pkgs.txt
rename to tools/env/debian/pkgs.txt
diff --git a/env/pip3/BUILD.bazel b/tools/env/pip3/BUILD.bazel
similarity index 100%
rename from env/pip3/BUILD.bazel
rename to tools/env/pip3/BUILD.bazel
diff --git a/env/pip3/check b/tools/env/pip3/check
similarity index 100%
rename from env/pip3/check
rename to tools/env/pip3/check
diff --git a/env/pip3/deps b/tools/env/pip3/deps
similarity index 100%
rename from env/pip3/deps
rename to tools/env/pip3/deps
diff --git a/env/pip3/licenses/Apache-2.0 b/tools/env/pip3/licenses/Apache-2.0
similarity index 100%
rename from env/pip3/licenses/Apache-2.0
rename to tools/env/pip3/licenses/Apache-2.0
diff --git a/env/pip3/licenses/GPLv2 b/tools/env/pip3/licenses/GPLv2
similarity index 100%
rename from env/pip3/licenses/GPLv2
rename to tools/env/pip3/licenses/GPLv2
diff --git a/env/pip3/licenses/MIT b/tools/env/pip3/licenses/MIT
similarity index 100%
rename from env/pip3/licenses/MIT
rename to tools/env/pip3/licenses/MIT
diff --git a/env/pip3/licenses/Sphinxcontrib-napoleon b/tools/env/pip3/licenses/Sphinxcontrib-napoleon
similarity index 100%
rename from env/pip3/licenses/Sphinxcontrib-napoleon
rename to tools/env/pip3/licenses/Sphinxcontrib-napoleon
diff --git a/env/pip3/licenses/cryptography b/tools/env/pip3/licenses/cryptography
similarity index 100%
rename from env/pip3/licenses/cryptography
rename to tools/env/pip3/licenses/cryptography
diff --git a/env/pip3/licenses/idna b/tools/env/pip3/licenses/idna
similarity index 100%
rename from env/pip3/licenses/idna
rename to tools/env/pip3/licenses/idna
diff --git a/env/pip3/licenses/pycparser b/tools/env/pip3/licenses/pycparser
similarity index 100%
rename from env/pip3/licenses/pycparser
rename to tools/env/pip3/licenses/pycparser
diff --git a/env/pip3/licenses/supervisor b/tools/env/pip3/licenses/supervisor
similarity index 100%
rename from env/pip3/licenses/supervisor
rename to tools/env/pip3/licenses/supervisor
diff --git a/env/pip3/requirements.in b/tools/env/pip3/requirements.in
similarity index 100%
rename from env/pip3/requirements.in
rename to tools/env/pip3/requirements.in
diff --git a/env/pip3/requirements.txt b/tools/env/pip3/requirements.txt
similarity index 100%
rename from env/pip3/requirements.txt
rename to tools/env/pip3/requirements.txt
diff --git a/tools/install_deps b/tools/install_deps
new file mode 100755
index 0000000000..295f85df15
--- /dev/null
+++ b/tools/install_deps
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+BASE=$(dirname "$0")
+
+"$BASE/env/debian/deps"
+"$BASE/env/pip3/deps"
diff --git a/tools/integration/BUILD.bazel b/tools/integration/BUILD.bazel
index 444f90bbda..4c37739d41 100644
--- a/tools/integration/BUILD.bazel
+++ b/tools/integration/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -25,3 +25,5 @@ go_library(
"@in_gopkg_yaml_v2//:go_default_library",
],
)
+
+exports_files(["bin_wrapper.sh"])
diff --git a/integration/bin_wrapper.sh b/tools/integration/bin_wrapper.sh
similarity index 100%
rename from integration/bin_wrapper.sh
rename to tools/integration/bin_wrapper.sh
diff --git a/tools/integration/binary.go b/tools/integration/binary.go
index 62335c346a..477f6cfca0 100644
--- a/tools/integration/binary.go
+++ b/tools/integration/binary.go
@@ -61,7 +61,7 @@ const (
// portString is the string a server prints to specify the port it's listening on.
portString = "Port="
// WrapperCmd is the command used to run non-test binaries
- WrapperCmd = "./integration/bin_wrapper.sh"
+ WrapperCmd = "./tools/integration/bin_wrapper.sh"
)
var (
diff --git a/tools/integration/integrationlib/BUILD.bazel b/tools/integration/integrationlib/BUILD.bazel
index 06cba3d30a..f0b8728834 100644
--- a/tools/integration/integrationlib/BUILD.bazel
+++ b/tools/integration/integrationlib/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/tools/integration/progress/BUILD.bazel b/tools/integration/progress/BUILD.bazel
index 861c7a795d..4850f0e820 100644
--- a/tools/integration/progress/BUILD.bazel
+++ b/tools/integration/progress/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/integration/revocation_test.sh b/tools/integration/revocation_test.sh
similarity index 61%
rename from integration/revocation_test.sh
rename to tools/integration/revocation_test.sh
index a8039b8fdc..9215c9ed6a 100755
--- a/integration/revocation_test.sh
+++ b/tools/integration/revocation_test.sh
@@ -15,30 +15,26 @@
set -f
-. integration/common.sh
-
-# Get BRS
-opts "$@"
-shift $((OPTIND-1))
+REV_BRS="*br1-ff00_0_110-3 *br2-ff00_0_222-2 *br1-ff00_0_111-2 *br1-ff00_0_111-3 *br1-ff00_0_131-2 "\
+"*br2-ff00_0_220-2 *br2-ff00_0_210-4 *br2-ff00_0_212-1"
for br in $REV_BRS; do
if ! ./scion.sh mstatus "$br"; then
- log "${br} does not exist. Skipping revocation test."
- exit 0
+ echo "${br} does not exist. Abort."
+ exit 1
fi
done
# Bring down routers.
-SLEEP=4
-log "Revocation test"
-log "Stopping routers and waiting for ${SLEEP}s."
+echo "Revocation test"
+echo "Stopping routers and waiting for ${SLEEP}s."
./scion.sh mstop $REV_BRS
if [ $? -ne 0 ]; then
- log "Failed stopping routers."
+ echo "Failed stopping routers."
exit 1
fi
-sleep ${SLEEP}s
+sleep 4
# Do another round of e2e test with retries
-log "Testing connectivity between all the hosts (with retries)."
-run Revocation bin/end2end_integration -log.console info -attempts 15 -subset 1-ff00:0:131#2-ff00:0:222 $DOCKER_ARGS
+echo "Testing connectivity between all the hosts (with retries)."
+bin/end2end_integration -log.console info -attempts 15 -subset 1-ff00:0:131#2-ff00:0:222 $DOCKER_ARGS
exit $?
diff --git a/tools/lint.sh b/tools/lint.sh
index 07985cc117..07869a364c 100755
--- a/tools/lint.sh
+++ b/tools/lint.sh
@@ -87,7 +87,7 @@ semgrep_lint() {
lint_header "semgrep"
lint_step "custom rules"
docker run --rm -v "${PWD}:/src" returntocorp/semgrep@sha256:8b0735959a6eb737aa945f4d591b6db23b75344135d74c3021b7d427bd317a66 \
- --config=/src/lint/semgrep
+ --config=/src/tools/lint/semgrep
}
openapi_lint() {
diff --git a/lint/BUILD.bazel b/tools/lint/BUILD.bazel
similarity index 100%
rename from lint/BUILD.bazel
rename to tools/lint/BUILD.bazel
diff --git a/lint/go.bzl b/tools/lint/go.bzl
similarity index 100%
rename from lint/go.bzl
rename to tools/lint/go.bzl
diff --git a/lint/go_config.bzl b/tools/lint/go_config.bzl
similarity index 100%
rename from lint/go_config.bzl
rename to tools/lint/go_config.bzl
diff --git a/lint/go_embed.bzl b/tools/lint/go_embed.bzl
similarity index 100%
rename from lint/go_embed.bzl
rename to tools/lint/go_embed.bzl
diff --git a/lint/go_fmt.bzl b/tools/lint/go_fmt.bzl
similarity index 100%
rename from lint/go_fmt.bzl
rename to tools/lint/go_fmt.bzl
diff --git a/lint/impi.bzl b/tools/lint/impi.bzl
similarity index 100%
rename from lint/impi.bzl
rename to tools/lint/impi.bzl
diff --git a/lint/ineffassign.bzl b/tools/lint/ineffassign.bzl
similarity index 100%
rename from lint/ineffassign.bzl
rename to tools/lint/ineffassign.bzl
diff --git a/tools/lint/log/BUILD.bazel b/tools/lint/log/BUILD.bazel
index 4d26d065a4..ba07b9cf38 100644
--- a/tools/lint/log/BUILD.bazel
+++ b/tools/lint/log/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/tools/lint/maincheck/BUILD.bazel b/tools/lint/maincheck/BUILD.bazel
index 276413d279..0dffeeaab8 100644
--- a/tools/lint/maincheck/BUILD.bazel
+++ b/tools/lint/maincheck/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/lint/py.bzl b/tools/lint/py.bzl
similarity index 94%
rename from lint/py.bzl
rename to tools/lint/py.bzl
index 34accf166d..755143c75d 100644
--- a/lint/py.bzl
+++ b/tools/lint/py.bzl
@@ -5,7 +5,7 @@ load(
_py_library = "py_library",
_py_test = "py_test",
)
-load("//lint/private/python:flake8.bzl", "flake8_test")
+load("//tools/lint/python:flake8.bzl", "flake8_test")
def _add_py_lint_tests(name, **kwargs):
tags = kwargs.get("tags", [])
diff --git a/lint/private/python/BUILD.bazel b/tools/lint/python/BUILD.bazel
similarity index 100%
rename from lint/private/python/BUILD.bazel
rename to tools/lint/python/BUILD.bazel
diff --git a/lint/private/python/deps.bzl b/tools/lint/python/deps.bzl
similarity index 60%
rename from lint/private/python/deps.bzl
rename to tools/lint/python/deps.bzl
index 609c46f5ba..24bbb8f16a 100644
--- a/lint/private/python/deps.bzl
+++ b/tools/lint/python/deps.bzl
@@ -3,5 +3,5 @@ load("@rules_python//python:pip.bzl", "pip_install")
def python_lint_deps():
pip_install(
name = "python_lint_pip_deps",
- requirements = "@com_github_scionproto_scion//lint/private/python:requirements.txt",
+ requirements = "@com_github_scionproto_scion//tools/lint/python:requirements.txt",
)
diff --git a/lint/private/python/flake8.bzl b/tools/lint/python/flake8.bzl
similarity index 97%
rename from lint/private/python/flake8.bzl
rename to tools/lint/python/flake8.bzl
index f4464a27fc..5a3d6c901b 100644
--- a/lint/private/python/flake8.bzl
+++ b/tools/lint/python/flake8.bzl
@@ -44,7 +44,7 @@ flake8_test = rule(
),
"_flake8_cli": attr.label(
cfg = "host",
- default = "//lint/private/python:flake8",
+ default = "//tools/lint/python:flake8",
providers = [
DefaultInfo,
],
diff --git a/lint/private/python/flake8_config.bzl b/tools/lint/python/flake8_config.bzl
similarity index 100%
rename from lint/private/python/flake8_config.bzl
rename to tools/lint/python/flake8_config.bzl
diff --git a/lint/private/python/flakelint.py b/tools/lint/python/flakelint.py
similarity index 100%
rename from lint/private/python/flakelint.py
rename to tools/lint/python/flakelint.py
diff --git a/lint/private/python/requirements.in b/tools/lint/python/requirements.in
similarity index 100%
rename from lint/private/python/requirements.in
rename to tools/lint/python/requirements.in
diff --git a/lint/private/python/requirements.txt b/tools/lint/python/requirements.txt
similarity index 93%
rename from lint/private/python/requirements.txt
rename to tools/lint/python/requirements.txt
index 5a2e6bd9f2..727af62bfe 100644
--- a/lint/private/python/requirements.txt
+++ b/tools/lint/python/requirements.txt
@@ -2,12 +2,12 @@
# This file is autogenerated by pip-compile
# To update, run:
#
-# pip-compile --generate-hashes lint/private/python/requirements.in
+# pip-compile --generate-hashes lint/python/requirements.in
#
flake8==3.8.4 \
--hash=sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839 \
--hash=sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b \
- # via -r lint/private/python/requirements.in
+ # via -r lint/python/requirements.in
importlib-metadata==3.3.0 \
--hash=sha256:5c5a2720817414a6c41f0a49993908068243ae02c1635a228126519b509c8aed \
--hash=sha256:bf792d480abbd5eda85794e4afb09dd538393f7d6e6ffef6e9f03d2014cf9450 \
diff --git a/lint/semgrep/hostport.yml b/tools/lint/semgrep/hostport.yml
similarity index 100%
rename from lint/semgrep/hostport.yml
rename to tools/lint/semgrep/hostport.yml
diff --git a/tools/pathdb_dump/BUILD.bazel b/tools/pathdb_dump/BUILD.bazel
index d0b7eb0adc..2d6ac41f94 100644
--- a/tools/pathdb_dump/BUILD.bazel
+++ b/tools/pathdb_dump/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/tools/pktgen/BUILD.bazel b/tools/pktgen/BUILD.bazel
index 6bb590f3a7..2c7c6a746e 100644
--- a/tools/pktgen/BUILD.bazel
+++ b/tools/pktgen/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
go_library(
name = "go_default_library",
diff --git a/tools/pktgen/cmd/pktgen/BUILD.bazel b/tools/pktgen/cmd/pktgen/BUILD.bazel
index eb622d2310..4636177a86 100644
--- a/tools/pktgen/cmd/pktgen/BUILD.bazel
+++ b/tools/pktgen/cmd/pktgen/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library", "go_test")
+load("//tools/lint:go.bzl", "go_library", "go_test")
load("//:scion.bzl", "scion_go_binary")
go_library(
diff --git a/tools/scion_integration/BUILD.bazel b/tools/scion_integration/BUILD.bazel
index 273e1c2042..05d78a8389 100644
--- a/tools/scion_integration/BUILD.bazel
+++ b/tools/scion_integration/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("//:scion.bzl", "scion_go_binary")
scion_go_binary(
diff --git a/python/integration/set_ipv6_addr.py b/tools/set_ipv6_addr.py
similarity index 98%
rename from python/integration/set_ipv6_addr.py
rename to tools/set_ipv6_addr.py
index 405a6eb3b0..dac2e5cb8b 100755
--- a/python/integration/set_ipv6_addr.py
+++ b/tools/set_ipv6_addr.py
@@ -20,7 +20,7 @@
from ipaddress import IPv6Address, IPv6Network, AddressValueError
# SCION
-from python.lib.defines import (
+from topology.defines import (
GEN_PATH,
DEFAULT6_CLIENT,
DEFAULT6_MASK,
diff --git a/supervisor/supervisor.sh b/tools/supervisor.sh
similarity index 82%
rename from supervisor/supervisor.sh
rename to tools/supervisor.sh
index 5ce4098e25..8a1a7bd62d 100755
--- a/supervisor/supervisor.sh
+++ b/tools/supervisor.sh
@@ -4,7 +4,7 @@ mkdir -p logs
# Wrap the 'supervisorctl' command
OPTIONS="$@"
-CONF_FILE="supervisor/supervisord.conf"
+CONF_FILE="tools/supervisord.conf"
if [ ! -e /tmp/supervisor.sock ]; then
supervisord -c $CONF_FILE
fi
diff --git a/supervisor/supervisord.conf b/tools/supervisord.conf
similarity index 100%
rename from supervisor/supervisord.conf
rename to tools/supervisord.conf
diff --git a/tools/topodot.py b/tools/topodot.py
index a42d486863..6ef4502fa3 100755
--- a/tools/topodot.py
+++ b/tools/topodot.py
@@ -23,8 +23,7 @@
from plumbum import cli, local
from typing import Dict, List, NamedTuple
-from python.lib.types import LinkType
-from python.topology.topo import LinkEP, TopoID
+from topology.topo import LinkEP, LinkType, TopoID
graph_fmt = """digraph topo {{
\tnode [margin=0.2]
@@ -78,7 +77,7 @@ def main(self, topofile):
class Link(NamedTuple):
a: LinkEP
b: LinkEP
- type: str
+ type: LinkType
def topodot(topofile) -> str:
@@ -135,7 +134,8 @@ def topo_links(topo_config) -> List[Link]:
return [
Link(a=LinkEP(link['a']),
b=LinkEP(link['b']),
- type=link['linkAtoB'].lower()) for link in topo_config['links']
+ type=LinkType[link['linkAtoB'].upper()])
+ for link in topo_config['links']
]
diff --git a/python/topology/generator.py b/tools/topogen.py
similarity index 95%
rename from python/topology/generator.py
rename to tools/topogen.py
index 291f9cee5a..c01a1cc7b3 100755
--- a/python/topology/generator.py
+++ b/tools/topogen.py
@@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
-:mod:`generator` --- SCION topology generator
+:mod:`topogen` --- SCION topology generator
=============================================
"""
# Stdlib
import argparse
# SCION
-from python.lib.defines import (
+from topology.defines import (
GEN_PATH,
)
-from python.topology.config import (
+from topology.config import (
ConfigGenerator,
ConfigGenArgs,
DEFAULT_TOPOLOGY_FILE,
diff --git a/tools/topology/BUILD.bazel b/tools/topology/BUILD.bazel
new file mode 100644
index 0000000000..a5b0b7551b
--- /dev/null
+++ b/tools/topology/BUILD.bazel
@@ -0,0 +1,8 @@
+load("//tools/lint:py.bzl", "py_library")
+
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "py_default_library",
+ srcs = glob(["**/*.py"]),
+)
diff --git a/python/__init__.py b/tools/topology/__init__.py
similarity index 100%
rename from python/__init__.py
rename to tools/topology/__init__.py
diff --git a/python/topology/cert.py b/tools/topology/cert.py
old mode 100755
new mode 100644
similarity index 97%
rename from python/topology/cert.py
rename to tools/topology/cert.py
index ee854643c2..3fd957c5f3
--- a/python/topology/cert.py
+++ b/tools/topology/cert.py
@@ -23,8 +23,8 @@
from plumbum import local, CommandNotFound
-from python.topology import common
-from python.lib.util import write_file
+from topology import common
+from topology.util import write_file
class CertGenArgs(common.ArgsTopoConfig):
diff --git a/python/topology/common.py b/tools/topology/common.py
similarity index 96%
rename from python/topology/common.py
rename to tools/topology/common.py
index 332fa6548d..b12326da03 100644
--- a/python/topology/common.py
+++ b/tools/topology/common.py
@@ -13,15 +13,16 @@
# limitations under the License.
# Stdlib
+from enum import Enum
from ipaddress import ip_address
+from typing import Mapping, Tuple
+from urllib.parse import urlsplit
import os
import subprocess
-from urllib.parse import urlsplit
-from typing import Mapping, Tuple
# SCION
-from python.lib.scion_addr import ISD_AS
-from python.topology.net import AddressProxy, NetworkDescription, IPNetwork
+from topology.scion_addr import ISD_AS
+from topology.net import AddressProxy, NetworkDescription, IPNetwork
COMMON_DIR = 'endhost'
@@ -70,6 +71,9 @@ def __init__(self, args, topo_dicts):
self.topo_dicts = topo_dicts
+LinkType = Enum('LinkType', ['CHILD', 'PARENT', 'PEER', 'CORE'])
+
+
class TopoID(ISD_AS):
def ISD(self):
return "ISD%s" % self.isd_str()
diff --git a/python/topology/config.py b/tools/topology/config.py
old mode 100755
new mode 100644
similarity index 90%
rename from python/topology/config.py
rename to tools/topology/config.py
index ef855081e1..3df0fa6c08
--- a/python/topology/config.py
+++ b/tools/topology/config.py
@@ -24,32 +24,30 @@
import sys
from io import StringIO
from typing import Mapping
+import yaml
# SCION
-from python.lib.defines import (
+from topology.defines import (
DEFAULT_MTU,
DEFAULT6_NETWORK,
NETWORKS_FILE,
)
-from python.lib.scion_addr import ISD_AS
-from python.lib.util import (
- load_yaml_file,
- write_file,
-)
-from python.topology.cert import CertGenArgs, CertGenerator
-from python.topology.common import ArgsBase
-from python.topology.docker import DockerGenArgs, DockerGenerator
-from python.topology.go import GoGenArgs, GoGenerator
-from python.topology.jaeger import JaegerGenArgs, JaegerGenerator
-from python.topology.net import (
+from topology.scion_addr import ISD_AS
+from topology.util import write_file
+from topology.cert import CertGenArgs, CertGenerator
+from topology.common import ArgsBase
+from topology.docker import DockerGenArgs, DockerGenerator
+from topology.go import GoGenArgs, GoGenerator
+from topology.jaeger import JaegerGenArgs, JaegerGenerator
+from topology.net import (
NetworkDescription,
IPNetwork,
SubnetGenerator,
DEFAULT_NETWORK,
)
-from python.topology.prometheus import PrometheusGenArgs, PrometheusGenerator
-from python.topology.supervisor import SupervisorGenArgs, SupervisorGenerator
-from python.topology.topo import TopoGenArgs, TopoGenerator
+from topology.prometheus import PrometheusGenArgs, PrometheusGenerator
+from topology.supervisor import SupervisorGenArgs, SupervisorGenerator
+from topology.topo import TopoGenArgs, TopoGenerator
DEFAULT_TOPOLOGY_FILE = "topology/default.topo"
@@ -72,7 +70,8 @@ def __init__(self, args):
:param ConfigGenArgs args: Contains the passed command line arguments.
"""
self.args = args
- self.topo_config = load_yaml_file(self.args.topo_config)
+ with open(self.args.topo_config) as f:
+ self.topo_config = yaml.load(f, Loader=yaml.SafeLoader)
if self.args.sig and not self.args.docker:
logging.critical("Cannot use sig without docker!")
sys.exit(1)
diff --git a/python/lib/defines.py b/tools/topology/defines.py
similarity index 100%
rename from python/lib/defines.py
rename to tools/topology/defines.py
diff --git a/python/topology/docker.py b/tools/topology/docker.py
similarity index 96%
rename from python/topology/docker.py
rename to tools/topology/docker.py
index 323e17a3a4..b0594925e4 100644
--- a/python/topology/docker.py
+++ b/tools/topology/docker.py
@@ -19,17 +19,17 @@
# External packages
import yaml
# SCION
-from python.lib.defines import DOCKER_COMPOSE_CONFIG_VERSION
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.defines import DOCKER_COMPOSE_CONFIG_VERSION
+from topology.util import write_file
+from topology.common import (
ArgsTopoDicts,
docker_host,
docker_image,
sciond_svc_name,
)
-from python.topology.docker_utils import DockerUtilsGenArgs, DockerUtilsGenerator
-from python.topology.net import NetworkDescription, IPNetwork
-from python.topology.sig import SIGGenArgs, SIGGenerator
+from topology.docker_utils import DockerUtilsGenArgs, DockerUtilsGenerator
+from topology.net import NetworkDescription, IPNetwork
+from topology.sig import SIGGenArgs, SIGGenerator
DOCKER_CONF = 'scion-dc.yml'
diff --git a/python/topology/docker_utils.py b/tools/topology/docker_utils.py
similarity index 95%
rename from python/topology/docker_utils.py
rename to tools/topology/docker_utils.py
index 9bcaed0366..14838a5cff 100644
--- a/python/topology/docker_utils.py
+++ b/tools/topology/docker_utils.py
@@ -15,9 +15,9 @@
# Stdlib
import os
+import pathlib
# SCION
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.common import (
ArgsBase,
docker_image,
remote_nets,
@@ -115,5 +115,4 @@ def _sig_testing_conf(self):
ipv = 'ipv6'
ip = net[ipv]
text += str(topo_id) + ' ' + str(ip) + '\n'
- conf_path = os.path.join(self.args.output_dir, 'sig-testing.conf')
- write_file(conf_path, text)
+ pathlib.Path(self.args.output_dir, 'sig-testing.conf').write_text(text)
diff --git a/python/topology/go.py b/tools/topology/go.py
old mode 100755
new mode 100644
similarity index 98%
rename from python/topology/go.py
rename to tools/topology/go.py
index 89e1b4d633..2ad3702d1e
--- a/python/topology/go.py
+++ b/tools/topology/go.py
@@ -23,8 +23,8 @@
from typing import Mapping
# SCION
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.util import write_file
+from topology.common import (
ArgsTopoDicts,
DISP_CONFIG_NAME,
docker_host,
@@ -38,9 +38,9 @@
CO_CONFIG_NAME,
)
-from python.topology.net import socket_address_str, NetworkDescription, IPNetwork
+from topology.net import socket_address_str, NetworkDescription, IPNetwork
-from python.topology.prometheus import (
+from topology.prometheus import (
CS_PROM_PORT,
DEFAULT_BR_PROM_PORT,
SCIOND_PROM_PORT,
diff --git a/python/topology/jaeger.py b/tools/topology/jaeger.py
similarity index 96%
rename from python/topology/jaeger.py
rename to tools/topology/jaeger.py
index 0339b84ae7..7355694c55 100644
--- a/python/topology/jaeger.py
+++ b/tools/topology/jaeger.py
@@ -15,8 +15,8 @@
import os
import yaml
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.util import write_file
+from topology.common import (
ArgsTopoDicts,
)
diff --git a/python/topology/net.py b/tools/topology/net.py
old mode 100755
new mode 100644
similarity index 99%
rename from python/topology/net.py
rename to tools/topology/net.py
index 80dbf2857c..7968301f7f
--- a/python/topology/net.py
+++ b/tools/topology/net.py
@@ -37,7 +37,7 @@
import yaml
# SCION
-from python.lib.defines import DEFAULT6_NETWORK_ADDR
+from topology.defines import DEFAULT6_NETWORK_ADDR
DEFAULT_NETWORK = "127.0.0.0/8"
DEFAULT_PRIV_NETWORK = "192.168.0.0/16"
diff --git a/python/topology/prometheus.py b/tools/topology/prometheus.py
old mode 100755
new mode 100644
similarity index 97%
rename from python/topology/prometheus.py
rename to tools/topology/prometheus.py
index af3095cacf..94cc932fff
--- a/python/topology/prometheus.py
+++ b/tools/topology/prometheus.py
@@ -25,15 +25,15 @@
import yaml
# SCION
-from python.lib.defines import DOCKER_COMPOSE_CONFIG_VERSION, PROM_FILE
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.defines import DOCKER_COMPOSE_CONFIG_VERSION, PROM_FILE
+from topology.util import write_file
+from topology.common import (
ArgsTopoDicts,
prom_addr,
prom_addr_dispatcher,
sciond_ip,
)
-from python.topology.net import (
+from topology.net import (
NetworkDescription,
IPNetwork,
)
diff --git a/tools/topology/scion_addr.py b/tools/topology/scion_addr.py
new file mode 100644
index 0000000000..cae97ce8ff
--- /dev/null
+++ b/tools/topology/scion_addr.py
@@ -0,0 +1,84 @@
+# Copyright 2014 ETH Zurich
+#
+# 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.
+"""
+:mod:`scion_addr` --- SCION host address specifications
+=======================================================
+"""
+
+import re
+
+
+class ISD_AS:
+ """
+ Class for representing ISD-AS pair.
+ """
+
+ def __init__(self, isd_as_str):
+ isd_as_str = _clean_isd_as(isd_as_str)
+ self._isd, self._as = isd_as_str.split("-")
+
+ def isd_str(self):
+ return self._isd
+
+ def as_str(self):
+ return self._as
+
+ def as_file_fmt(self):
+ return self._as.replace(":", "_")
+
+ def file_fmt(self):
+ return "%s-%s" % (self.isd_str(), self.as_file_fmt())
+
+ def __str__(self):
+ return "%s-%s" % (self.isd_str(), self.as_str())
+
+ def __repr__(self):
+ return "" % self
+
+ def __eq__(self, other):
+ if not isinstance(other, ISD_AS):
+ return False
+ return self._isd == other._isd and self._as == other._as
+
+ def __hash__(self):
+ return hash(str(self))
+
+
+# Regex matching ISD-AS (hex form), with either : or _ as hex-part separator
+_RE_ISD_AS = re.compile(
+ r"^([1-9][0-9]{0,4})-([0-9a-fA-F]{1,4})[:_]([0-9a-fA-F]{1,4})[:_]([0-9a-fA-F]{1,4})$"
+)
+
+
+def _clean_isd_as(isd_as_str):
+ """
+ Parse an ISD-AS-identifier and return the "canonical" string representation.
+
+ Note that the short form for decimal BGP AS numbers is not supported here.
+
+ :param str as_id_str: AS-identifier to parse
+ :returns: AS-identifier as integer
+ :raises:
+ ValueError: invalid ISD-AS
+ """
+ m = _RE_ISD_AS.match(isd_as_str)
+ if not m:
+ raise ValueError('Invalid ISD-AS', isd_as_str)
+ isd = int(m.group(1), 10)
+ if isd >= 2**16:
+ raise ValueError('Invalid ISD-AS, ISD out of range', isd_as_str)
+ hig = int(m.group(2), 16)
+ mid = int(m.group(3), 16)
+ low = int(m.group(4), 16)
+ return "%i-%x:%x:%x" % (isd, hig, mid, low)
diff --git a/python/topology/sig.py b/tools/topology/sig.py
similarity index 97%
rename from python/topology/sig.py
rename to tools/topology/sig.py
index 7cbd3cc2d4..a01fff3ff7 100644
--- a/python/topology/sig.py
+++ b/tools/topology/sig.py
@@ -19,8 +19,8 @@
# External packages
import toml
# SCION
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.util import write_file
+from topology.common import (
ArgsBase,
json_default,
sciond_svc_name,
@@ -28,8 +28,8 @@
SIG_CONFIG_NAME,
translate_features,
)
-from python.topology.net import socket_address_str
-from python.topology.prometheus import SIG_PROM_PORT
+from topology.net import socket_address_str
+from topology.prometheus import SIG_PROM_PORT
class SIGGenArgs(ArgsBase):
diff --git a/python/topology/supervisor.py b/tools/topology/supervisor.py
old mode 100755
new mode 100644
similarity index 98%
rename from python/topology/supervisor.py
rename to tools/topology/supervisor.py
index 15436389af..cefc0cb73d
--- a/python/topology/supervisor.py
+++ b/tools/topology/supervisor.py
@@ -23,8 +23,8 @@
from io import StringIO
# SCION
-from python.lib.util import write_file
-from python.topology.common import (
+from topology.util import write_file
+from topology.common import (
ArgsTopoDicts,
DISP_CONFIG_NAME,
SD_CONFIG_NAME,
diff --git a/python/topology/topo.py b/tools/topology/topo.py
old mode 100755
new mode 100644
similarity index 97%
rename from python/topology/topo.py
rename to tools/topology/topo.py
index 4582b58b95..44539bb205
--- a/python/topology/topo.py
+++ b/tools/topology/topo.py
@@ -28,23 +28,24 @@
import yaml
# SCION
-from python.lib.defines import (
+from topology.defines import (
AS_LIST_FILE,
IFIDS_FILE,
SCION_MIN_MTU,
SCION_ROUTER_PORT,
TOPO_FILE,
)
-from python.lib.types import LinkType
-from python.lib.util import write_file
-from python.topology.common import (
+
+from topology.util import write_file
+from topology.common import (
ArgsBase,
join_host_port,
json_default,
SCION_SERVICE_NAMES,
- TopoID
+ LinkType,
+ TopoID,
)
-from python.topology.net import (
+from topology.net import (
PortGenerator,
SubnetGenerator
)
@@ -217,8 +218,9 @@ def _read_links(self):
for attrs in self.args.topo_config_dict["links"]:
a = LinkEP(attrs.pop("a"))
b = LinkEP(attrs.pop("b"))
- linkto = linkto_a = linkto_b = attrs.pop("linkAtoB")
- if linkto.lower() == LinkType.CHILD:
+ linkto = LinkType[attrs.pop("linkAtoB").upper()]
+ linkto_a = linkto_b = linkto
+ if linkto == LinkType.CHILD:
linkto_a = LinkType.PARENT
linkto_b = LinkType.CHILD
a_br, a_ifid = self._br_name(a, assigned_br_id, br_ids, if_ids)
@@ -326,7 +328,7 @@ def _gen_br_intf(self, remote, public_addr, remote_addr, attrs, remote_type):
'remote': join_host_port(remote_addr.ip, SCION_ROUTER_PORT),
},
'isd_as': str(remote),
- 'link_to': LinkType.to_str(remote_type.lower()),
+ 'link_to': remote_type.name.lower(),
'mtu': attrs.get('mtu', self.args.default_mtu)
}
diff --git a/tools/topology/util.py b/tools/topology/util.py
new file mode 100644
index 0000000000..9335958c2e
--- /dev/null
+++ b/tools/topology/util.py
@@ -0,0 +1,32 @@
+# Copyright 2014 ETH Zurich
+#
+# 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.
+"""
+:mod:`util` --- SCION utilities
+===============================
+"""
+import pathlib
+
+
+def write_file(file_path, text):
+ """
+ Write some text into file, creating its directory as needed.
+ :param str file_path: the path to the file.
+ :param str text: the file content.
+ """
+ # ":" is an illegal filename char on both windows and OSX, so disallow it globally to prevent
+ # incompatibility.
+ assert ":" not in file_path, file_path
+
+ pathlib.Path(file_path).parent.mkdir(parents=True, exist_ok=True)
+ pathlib.Path(file_path).write_text(text)
diff --git a/tools/udpproxy/BUILD.bazel b/tools/udpproxy/BUILD.bazel
index b14bd96fe7..229db7070e 100644
--- a/tools/udpproxy/BUILD.bazel
+++ b/tools/udpproxy/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//lint:go.bzl", "go_library")
+load("//tools/lint:go.bzl", "go_library")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
go_library(
diff --git a/topology/BUILD.bazel b/topology/BUILD.bazel
index 46a7709492..a76c5f0708 100644
--- a/topology/BUILD.bazel
+++ b/topology/BUILD.bazel
@@ -1,4 +1,3 @@
-load("//python/topology:topology.bzl", "topology")
# gazelle:ignore
filegroup(
@@ -14,8 +13,3 @@ exports_files(
"wide.topo",
],
)
-
-topology(
- name = "tiny_gen",
- src = "tiny.topo",
-)