]> git.openstreetmap.org Git - chef.git/blob - test/integration/vectortile/inspec/nginx_spec.rb
nominatim: be quicker to ban IPs that have been blocked
[chef.git] / test / integration / vectortile / inspec / nginx_spec.rb
1 describe package("nginx") do
2   it { should be_installed }
3 end
4
5 describe service("nginx") do
6   it { should be_enabled }
7   it { should be_running }
8 end
9
10 describe port(80) do
11   it { should be_listening }
12   its("protocols") { should cmp %w[tcp tcp6] }
13 end
14
15 describe port(443) do
16   it { should be_listening }
17   its("protocols") { should cmp %w[tcp tcp6] }
18 end
19
20 describe http("http://localhost") do
21   its("status") { should cmp 301 }
22 end
23
24 describe http("https://localhost", :ssl_verify => false) do
25   its("status") { should cmp 200 }
26 end
27
28 describe http("https://localhost/styles/shortbread/colorful.json", :ssl_verify => false) do
29   its("status") { should cmp 200 }
30   its("headers") { should_not include "Access-Control-Allow-Origin" }
31   its("headers.vary") { should cmp "Origin" }
32 end
33
34 describe http("https://localhost/styles/shortbread/colorful.json", :headers => { "Origin" => "https://www.openstreetmap.org" }, :ssl_verify => false) do
35   its("status") { should cmp 200 }
36   its("headers.Access-Control-Allow-Origin") { should cmp "https://www.openstreetmap.org" }
37   its("headers.vary") { should cmp "Origin" }
38 end
39
40 describe json(:content => http("https://localhost/styles/shortbread/colorful.json", :ssl_verify => false).body) do
41   its(%w[sources versatiles-shortbread tiles]) do
42     should eq(["https://vector.openstreetmap.org/shortbread_v1/{z}/{x}/{y}.mvt"])
43   end
44   its(["sprite", 0, "url"]) { should match %r{https://vector.openstreetmap.org/} }
45   its(["glyphs"]) { should match %r{https://vector.openstreetmap.org/} }
46 end