From 2d83f130fe22b7b6dffe8a11aaebd661debc099e Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Thu, 14 Jul 2022 15:04:22 -0500 Subject: [PATCH] e2e: add nsd simple load balancing test --- .../input/simple_lb_clients.nomad | 55 +++++++++++++ .../input/simple_lb_replicas.nomad | 81 +++++++++++++++++++ .../service_discovery_test.go | 39 ++++++--- e2e/servicediscovery/simple_lb_test.go | 74 +++++++++++++++++ 4 files changed, 238 insertions(+), 11 deletions(-) create mode 100644 e2e/servicediscovery/input/simple_lb_clients.nomad create mode 100644 e2e/servicediscovery/input/simple_lb_replicas.nomad create mode 100644 e2e/servicediscovery/simple_lb_test.go diff --git a/e2e/servicediscovery/input/simple_lb_clients.nomad b/e2e/servicediscovery/input/simple_lb_clients.nomad new file mode 100644 index 000000000..875db2393 --- /dev/null +++ b/e2e/servicediscovery/input/simple_lb_clients.nomad @@ -0,0 +1,55 @@ +job "simple_lb_clients" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } + + group "client_1" { + task "cat" { + driver = "raw_exec" + config { + command = "bash" + args = ["-c", "sleep 15000"] + } + resources { + cpu = 10 + memory = 16 + } + template { + destination = "output.txt" + data = <