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"]
type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
affinity {
attribute = "${meta.rack}"
operator = "="

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,11 @@ job "simple_batch" {
type = "batch"
datacenters = ["dc1"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
task "simple_batch" {
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
instance_type = var.instance_type
key_name = module.keys.key_name

View File

@ -99,8 +99,12 @@ output "servers" {
value = aws_instance.server.*.public_ip
}
output "clients" {
value = aws_instance.client.*.public_ip
output "linux_clients" {
value = aws_instance.client_linux.*.public_ip
}
output "windows_clients" {
value = aws_instance.client_windows.*.public_ip
}
output "message" {
@ -109,8 +113,8 @@ Your cluster has been provisioned! - To prepare your environment, run the
following:
```
export NOMAD_ADDR=http://${aws_instance.client[0].public_ip}:4646
export CONSUL_HTTP_ADDR=http://${aws_instance.client[0].public_ip}:8500
export NOMAD_ADDR=http://${aws_instance.server[0].public_ip}:4646
export CONSUL_HTTP_ADDR=http://${aws_instance.server[0].public_ip}:8500
export NOMAD_E2E=1
```
@ -122,7 +126,7 @@ go test -v ./e2e
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

View File

@ -29,7 +29,7 @@ Read-S3Object `
Expand-Archive .\nomad.zip .\
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
cp "C:\ops\shared\nomad\client-windows.hcl" "C:\opt\nomad.d\nomad.hcl"

View File

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

View File

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