Add integration test.
This commit is contained in:
parent
83579cb186
commit
9c8c3cf9eb
@ -1,9 +1,6 @@
|
||||
|
||||
job "dns" {
|
||||
datacenters = ["dc1"]
|
||||
|
||||
group "dns-group" {
|
||||
|
||||
network {
|
||||
dns {
|
||||
servers = ["127.0.0.1", "127.0.0.2"]
|
||||
@ -11,15 +8,17 @@ job "dns" {
|
||||
options = ["ndots:2"]
|
||||
}
|
||||
}
|
||||
|
||||
task "dns-task" {
|
||||
driver = "containerd-driver"
|
||||
config {
|
||||
image = "ubuntu:16.04"
|
||||
command = "sleep"
|
||||
args = ["600s"]
|
||||
sysctl = {
|
||||
"net.core.somaxconn" = "16384"
|
||||
"net.ipv4.ip_forward" = "1"
|
||||
}
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 500
|
||||
memory = 256
|
||||
|
@ -47,6 +47,20 @@ test_dns_nomad_job() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "INFO: Checking sysctl net.core.somaxconn=16384"
|
||||
output=$(nomad alloc exec -job ${job_name} cat /proc/sys/net/core/somaxconn)
|
||||
if [ "$output" != "16384" ];then
|
||||
echo "ERROR: Job ${job_name}: sysctl net.core.somaxconn=16384 not found."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "INFO: Checking sysctl net.ipv4.ip_forward=1"
|
||||
output=$(nomad alloc exec -job ${job_name} cat /proc/sys/net/ipv4/ip_forward)
|
||||
if [ "$output" != "1" ];then
|
||||
echo "ERROR: Job ${job_name}: sysctl net.ipv4.ip_forward=1 not found."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "INFO: Stopping nomad ${job_name} job."
|
||||
nomad job stop ${job_name}
|
||||
job_status=$(nomad job status -short ${job_name}|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
|
||||
|
Loading…
x
Reference in New Issue
Block a user