summaryrefslogtreecommitdiff
path: root/kitchen-tests/test/integration/end-to-end/habitat_user_toml/default_spec.rb
blob: 9df21c49e6756229502571097fba2056ecafbef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
describe user("hab") do
  it { should exist }
end

describe file("/bin/hab") do
  it { should exist }
  it { should be_symlink }
end

# This needs to be updated each time Habitat is released so we ensure we're getting the version
# required by this cookbook.
describe command("hab -V") do
  its("stdout") { should match(%r{^hab.*/}) }
  its("exit_status") { should eq 0 }
end

nginx_content = <<-EOF
worker_processes = 2
[http]
keepalive_timeout = 120
EOF

describe file("/hab/user/nginx/config/user.toml") do
  it { should exist }
  its("content") { should match(nginx_content) }
end

nginxserviceapi = 'curl -v -H "Authorization: Bearer secret" http://localhost:9631/services/nginx/default | jq .cfg'
describe json(command: nginxserviceapi) do
  its(%w{http keepalive_timeout}) { should eq 120 }
  its(%w{http listen port}) { should eq 80 }
  its(["worker_processes"]) { should eq 2 }
end