From 0de4412db460371df118218c05aa2dcaf0a6b7e3 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 16 Sep 2020 19:57:32 +0000 Subject: [PATCH 1/1] Fix prometheus test --- .kitchen.yml | 9 +++++++++ cookbooks/networking/attributes/default.rb | 1 + .../serverspec/prometheus_node_exporter_spec.rb | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 7c446effc..854666cc6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -278,6 +278,15 @@ suites: - name: prometheus run_list: - recipe[prometheus::default] + attributes: + networking: + interfaces: + test: + interface: eth0 + role: internal + address: 172.18.0.2 + prefix: 16 + gateway: 172.18.0.1 - name: prometheus-server run_list: - recipe[prometheus::server] diff --git a/cookbooks/networking/attributes/default.rb b/cookbooks/networking/attributes/default.rb index 3872a5165..23cd15eb0 100644 --- a/cookbooks/networking/attributes/default.rb +++ b/cookbooks/networking/attributes/default.rb @@ -7,6 +7,7 @@ default[:networking][:firewall][:log] = true default[:networking][:firewall][:mark] = true default[:networking][:firewall][:raw] = true default[:networking][:firewall][:mangle] = true +default[:networking][:roles] = {} default[:networking][:interfaces] = {} default[:networking][:nameservers] = [] default[:networking][:search] = [] diff --git a/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb b/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb index c37883d15..bb178dd96 100644 --- a/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb +++ b/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb @@ -13,5 +13,5 @@ describe service("prometheus-node-exporter") do end describe port(9100) do - it { should be_listening.with("tcp6") } + it { should be_listening.with("tcp") } end -- 2.39.5