e2e: add a Windows client to test runner (#6735)

* Adds a constraint to prevent tests from landing on Windows
* Improve Terraform output for mixed windows/linux clients
* Makes some Windows client config fixes from 0.10.2 testing
This commit is contained in:
Tim Gross 2019-11-25 13:31:00 -05:00 committed by GitHub
parent f0378a2050
commit c9d92f845f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 189 additions and 11 deletions

View file

@ -2,6 +2,11 @@ job "test1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
affinity { affinity {
attribute = "${meta.rack}" attribute = "${meta.rack}"
operator = "=" operator = "="

View file

@ -2,6 +2,11 @@ job "test1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
affinity { affinity {
attribute = "${meta.rack}" attribute = "${meta.rack}"
operator = "=" operator = "="

View file

@ -2,6 +2,11 @@ job "test1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "test1" { group "test1" {
count = 5 count = 5

View file

@ -2,6 +2,11 @@ job "test_raw" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "test" { group "test" {
count = 1 count = 1

View file

@ -5,6 +5,11 @@
job "restarter" { job "restarter" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "restarter" { group "restarter" {
restart { restart {
attempts = 100 attempts = 100

View file

@ -4,6 +4,11 @@
job "sleeper" { job "sleeper" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
task "sleeper" { task "sleeper" {
driver = "raw_exec" driver = "raw_exec"

View file

@ -1,6 +1,11 @@
job "countdash" { job "countdash" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "api" { group "api" {
network { network {
mode = "bridge" mode = "bridge"

View file

@ -1,6 +1,11 @@
job "consul_canary_test" { job "consul_canary_test" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "consul_canary_test" { group "consul_canary_test" {
count = 2 count = 2

View file

@ -2,6 +2,11 @@ job "group_check" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "group_check" { group "group_check" {
network { network {
mode = "bridge" mode = "bridge"

View file

@ -2,6 +2,11 @@ job "group_check" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "group_check" { group "group_check" {
network { network {
mode = "bridge" mode = "bridge"

View file

@ -2,6 +2,11 @@ job "task_check" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "task_check" { group "task_check" {
count = 1 count = 1

View file

@ -2,6 +2,11 @@ job "task_check" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "task_check" { group "task_check" {
count = 1 count = 1

View file

@ -2,6 +2,11 @@ job "consul-example" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
update { update {
max_parallel = 1 max_parallel = 1
min_healthy_time = "10s" min_healthy_time = "10s"

View file

@ -2,6 +2,11 @@ job "test1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "test1" { group "test1" {
count = 1 count = 1

View file

@ -1,6 +1,11 @@
job "deployment_auto.nomad" { job "deployment_auto.nomad" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "one" { group "one" {
count = 3 count = 3

View file

@ -1,6 +1,11 @@
job "deployment_auto.nomad" { job "deployment_auto.nomad" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "one" { group "one" {
count = 3 count = 3

View file

@ -2,6 +2,11 @@ job "fabio" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "system" type = "system"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "fabio" { group "fabio" {
task "fabio" { task "fabio" {
driver = "docker" driver = "docker"

View file

@ -2,6 +2,11 @@ job "test1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "test1" { group "test1" {
count = 1 count = 1

View file

@ -2,6 +2,11 @@ job "cpustress" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "batch" type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "cpustress" { group "cpustress" {
count = 1 count = 1

View file

@ -2,6 +2,11 @@ job "diskstress" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "batch" type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "diskstress" { group "diskstress" {
count = 1 count = 1

View file

@ -1,6 +1,11 @@
job "hello" { job "hello" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
update { update {
max_parallel = 1 max_parallel = 1
min_healthy_time = "15s" min_healthy_time = "15s"

View file

@ -2,6 +2,11 @@ job "memstress" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "batch" type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "memstress" { group "memstress" {
count = 1 count = 1

View file

@ -1,6 +1,11 @@
job "redis" { job "redis" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "cache" { group "cache" {
count = 4 count = 4

View file

@ -2,6 +2,11 @@ job "nginx" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "system" type = "system"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "simpleweb" { group "simpleweb" {
update { update {
stagger = "5s" stagger = "5s"

View file

@ -1,6 +1,11 @@
job "sleep" { job "sleep" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "sleep" { group "sleep" {
task "sleep" { task "sleep" {
driver = "docker" driver = "docker"

View file

@ -1,6 +1,11 @@
job "sleep" { job "sleep" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "sleep" { group "sleep" {
task "sleep" { task "sleep" {
driver = "exec" driver = "exec"

View file

@ -1,6 +1,11 @@
job "sleep" { job "sleep" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "sleep" { group "sleep" {
task "sleep" { task "sleep" {
driver = "raw_exec" driver = "raw_exec"

View file

@ -1,6 +1,11 @@
job "nomadexec-docker" { job "nomadexec-docker" {
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "group" { group "group" {
task "task" { task "task" {
driver = "docker" driver = "docker"

View file

@ -2,6 +2,11 @@ job "prometheus" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "monitoring" { group "monitoring" {
count = 1 count = 1

View file

@ -2,6 +2,11 @@ job "r1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "r1" { group "r1" {
count = 6 count = 6

View file

@ -2,6 +2,11 @@ job "r1" {
datacenters = ["dc1", "dc2"] datacenters = ["dc1", "dc2"]
type = "service" type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
spread { spread {
attribute = "${node.datacenter}" attribute = "${node.datacenter}"
weight = 100 weight = 100

View file

@ -2,6 +2,11 @@ job "completed_leader" {
type = "batch" type = "batch"
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "completed_leader" { group "completed_leader" {
restart { restart {
attempts = 0 attempts = 0

View file

@ -2,6 +2,11 @@ job "failed_batch" {
type = "batch" type = "batch"
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "failed_batch" { group "failed_batch" {
restart { restart {
attempts = 0 attempts = 0

View file

@ -2,6 +2,11 @@ job "failed_sibling" {
type = "service" type = "service"
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "failed_sibling" { group "failed_sibling" {
restart { restart {
attempts = 0 attempts = 0

View file

@ -2,6 +2,11 @@ job "simple_batch" {
type = "batch" type = "batch"
datacenters = ["dc1"] datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
task "simple_batch" { task "simple_batch" {
driver = "raw_exec" driver = "raw_exec"

View file

@ -43,7 +43,7 @@ resource "aws_instance" "server" {
} }
} }
resource "aws_instance" "client" { resource "aws_instance" "client_linux" {
ami = data.aws_ami.linux.image_id ami = data.aws_ami.linux.image_id
instance_type = var.instance_type instance_type = var.instance_type
key_name = module.keys.key_name key_name = module.keys.key_name

View file

@ -99,8 +99,12 @@ output "servers" {
value = aws_instance.server.*.public_ip value = aws_instance.server.*.public_ip
} }
output "clients" { output "linux_clients" {
value = aws_instance.client.*.public_ip value = aws_instance.client_linux.*.public_ip
}
output "windows_clients" {
value = aws_instance.client_windows.*.public_ip
} }
output "message" { output "message" {
@ -109,8 +113,8 @@ Your cluster has been provisioned! - To prepare your environment, run the
following: following:
``` ```
export NOMAD_ADDR=http://${aws_instance.client[0].public_ip}:4646 export NOMAD_ADDR=http://${aws_instance.server[0].public_ip}:4646
export CONSUL_HTTP_ADDR=http://${aws_instance.client[0].public_ip}:8500 export CONSUL_HTTP_ADDR=http://${aws_instance.server[0].public_ip}:8500
export NOMAD_E2E=1 export NOMAD_E2E=1
``` ```
@ -122,7 +126,7 @@ go test -v ./e2e
ssh into nodes with: ssh into nodes with:
``` ```
ssh -i keys/${local.random_name}.pem ubuntu@${aws_instance.client[0].public_ip} ssh -i keys/${local.random_name}.pem ubuntu@${aws_instance.client_linux[0].public_ip}
``` ```
EOM EOM

View file

@ -29,7 +29,7 @@ Read-S3Object `
Expand-Archive .\nomad.zip .\ Expand-Archive .\nomad.zip .\
rm C:\opt\nomad.exe rm C:\opt\nomad.exe
mv nomad.exe C:\opt\nomad.exe mv .\pkg\windows_amd64\nomad.exe C:\opt\nomad.exe
# install config file # install config file
cp "C:\ops\shared\nomad\client-windows.hcl" "C:\opt\nomad.d\nomad.hcl" cp "C:\ops\shared\nomad\client-windows.hcl" "C:\opt\nomad.d\nomad.hcl"

View file

@ -1,7 +1,8 @@
enable_debug = true enable_debug = true
log_level = "debug" log_level = "debug"
log_file = true
log_file = "C:\\opt\\nomad\\nomad.log"
data_dir = "C:\\opt\\nomad\\data" data_dir = "C:\\opt\\nomad\\data"

View file

@ -2,6 +2,4 @@ region = "us-east-1"
instance_type = "t2.medium" instance_type = "t2.medium"
server_count = "3" server_count = "3"
client_count = "4" client_count = "4"
windows_client_count = "1"
# TODO(tgross): add only once Windows client is working
windows_client_count = "0"