m/test/e2e/connectivity: add connectivity tester

This adds a connectivity testing framework. It uses pod agents and
communicates with them over stdio. This is used to implement a simple
smoke test and will later be used to test network policy controllers.

Change-Id: If40673a91336dbe3a7a383bf2e9d17736fad3bdc
Reviewed-on: https://review.monogon.dev/c/monogon/+/3756
Reviewed-by: Jan Schär <jan@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/test/e2e/connectivity/spec/BUILD.bazel b/metropolis/test/e2e/connectivity/spec/BUILD.bazel
new file mode 100644
index 0000000..619c8dd
--- /dev/null
+++ b/metropolis/test/e2e/connectivity/spec/BUILD.bazel
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+proto_library(
+    name = "metropolis_test_e2e_connectivty_tester_proto",
+    srcs = ["spec.proto"],
+    visibility = ["//visibility:public"],
+    deps = ["@protobuf//:duration_proto"],
+)
+
+go_proto_library(
+    name = "metropolis_test_e2e_connectivty_tester_go_proto",
+    importpath = "source.monogon.dev/metropolis/test/e2e/connectivity/spec",
+    proto = ":metropolis_test_e2e_connectivty_tester_proto",
+    visibility = ["//visibility:public"],
+)
+
+go_library(
+    name = "spec",
+    embed = [":metropolis_test_e2e_connectivty_tester_go_proto"],
+    importpath = "source.monogon.dev/metropolis/test/e2e/connectivity/spec",
+    visibility = ["//visibility:public"],
+)
diff --git a/metropolis/test/e2e/connectivity/spec/gomod-generated-placeholder.go b/metropolis/test/e2e/connectivity/spec/gomod-generated-placeholder.go
new file mode 100644
index 0000000..f09cd57
--- /dev/null
+++ b/metropolis/test/e2e/connectivity/spec/gomod-generated-placeholder.go
@@ -0,0 +1 @@
+package spec
diff --git a/metropolis/test/e2e/connectivity/spec/spec.proto b/metropolis/test/e2e/connectivity/spec/spec.proto
new file mode 100644
index 0000000..8ab8a0c
--- /dev/null
+++ b/metropolis/test/e2e/connectivity/spec/spec.proto
@@ -0,0 +1,59 @@
+syntax = "proto3";
+
+import "google/protobuf/duration.proto";
+
+package metropolis.test.e2e.connectivty_tester;
+
+message Request {
+    oneof req {
+        TestRequest test = 1;
+        StartServerRequest start_server = 2;
+        StopServerRequest stop_server = 3;
+    }
+}
+
+message Response {
+    oneof res {
+        TestResponse test = 1;
+        StartServerResponse start_server = 2;
+        StopServerResponse stop_server = 3;
+    }
+}
+
+message TestRequest {
+    string address = 1;
+    uint64 token = 2;
+    google.protobuf.Duration timeout = 3;
+}
+
+message TestResponse {
+    enum Result {
+        UNKNOWN = 0;
+        CONNECTION_REJECTED = 1;
+        CONNECTION_TIMEOUT = 2;
+        WRONG_TOKEN = 3;
+        SUCCESS = 4;
+    }
+    Result result = 1;
+    string error_description = 2;
+}
+
+message StartServerRequest {
+    string address = 1;
+    uint64 token = 2;
+}
+
+message StartServerResponse {
+    bool ok = 1;
+    string error_description = 2;
+}
+
+message StopServerRequest {
+    uint64 token = 1;
+}
+
+message StopServerResponse {
+    bool ok = 1;
+    string error_description = 2;
+}
+