From 184af925782c88aba52be25843df5195c7f23a4d Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 30 Jan 2024 10:48:12 +0000 Subject: [PATCH] Update source install versions Signed-off-by: Dan Webb --- .github/workflows/ci.yml | 53 ++++++++----------- .rubocop.yml | 0 CHANGELOG.md | 3 ++ Dangerfile | 2 +- Guardfile | 10 ++-- documentation/haproxy_acl.md | 6 +-- documentation/haproxy_backend.md | 6 +-- documentation/haproxy_cache.md | 6 +-- documentation/haproxy_config_defaults.md | 6 +-- documentation/haproxy_config_global.md | 6 +-- documentation/haproxy_fastcgi.md | 6 +-- documentation/haproxy_frontend.md | 6 +-- documentation/haproxy_install.md | 6 +-- documentation/haproxy_listen.md | 6 +-- documentation/haproxy_mailer.md | 6 +-- documentation/haproxy_peer.md | 6 +-- documentation/haproxy_resolver.md | 6 +-- documentation/haproxy_service.md | 6 +-- documentation/haproxy_use_backend.md | 6 +-- documentation/haproxy_userlist.md | 6 +-- documentation/partial_config_file.md | 6 +-- documentation/partial_extra_options.md | 6 +-- kitchen.yml | 21 ++++---- resources/config_global.rb | 10 ++-- resources/install.rb | 4 +- spec/unit/recipes/install_spec.rb | 2 +- test/cookbooks/test/recipes/config_array.rb | 3 +- test/cookbooks/test/recipes/source.rb | 4 +- .../recipes/{source-24.rb => source_24.rb} | 8 +-- .../recipes/{source-18.rb => source_26.rb} | 8 +-- .../recipes/{source-20.rb => source_28.rb} | 8 +-- .../recipes/{source-22.rb => source_29.rb} | 8 +-- test/cookbooks/test/recipes/source_openssl.rb | 2 +- test/integration/config_4/example_spec.rb | 2 +- test/integration/source-2.4/source_spec.rb | 2 +- .../{source-1.8 => source_2.6}/source_spec.rb | 0 .../{source-2.0 => source_2.8}/source_spec.rb | 0 test/integration/source_2.9/source_spec.rb | 13 +++++ test/integration/source_lua/lua_spec.rb | 2 +- .../source_openssl/openssl_spec.rb | 2 +- 40 files changed, 121 insertions(+), 148 deletions(-) create mode 100644 .rubocop.yml rename test/cookbooks/test/recipes/{source-24.rb => source_24.rb} (58%) rename test/cookbooks/test/recipes/{source-18.rb => source_26.rb} (55%) rename test/cookbooks/test/recipes/{source-20.rb => source_28.rb} (56%) rename test/cookbooks/test/recipes/{source-22.rb => source_29.rb} (56%) rename test/integration/{source-1.8 => source_2.6}/source_spec.rb (100%) rename test/integration/{source-2.0 => source_2.8}/source_spec.rb (100%) create mode 100644 test/integration/source_2.9/source_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0a80bbc..73edb2c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,36 +32,26 @@ jobs: - "centos-stream-8" - "fedora-latest" suite: + - config-1-userlist + - config-1 + - config-2 + - config-3 + - config-4 + - config-acl + - config-array + - config-backend-search + - config-custom-template + - config-fastcgi + - config-resolver + - config-ssl-redirect - "package" - - "source-18" - - "source-20" - - "source-22" - - "source-default" + - "source-24" + - "source-26" + - "source-28" + - "source-29" + - "source-lua" - "source-openssl" - exclude: - # Excluded due to https://github.com/sous-chefs/haproxy/issues/475 - - os: "fedora-latest" - suite: "source-18" - - os: "fedora-latest" - suite: "source-20" - - os: "fedora-latest" - suite: "source-22" - - os: "fedora-latest" - suite: "source-default" - - os: "fedora-latest" - suite: "source-openssl" - - os: "ubuntu-2204" - suite: "source-18" - - os: "ubuntu-2204" - suite: "source-20" - - os: "ubuntu-2204" - suite: "source-22" - - os: "ubuntu-2204" - suite: "source-24" - - os: "ubuntu-2204" - suite: "source-default" - - os: "ubuntu-2204" - suite: "source-openssl" + - "source-default" fail-fast: false steps: @@ -87,9 +77,10 @@ jobs: - "amazonlinux-2" suite: - "package" - - "source-18" - - "source-20" - - "source-22" + - "source-24" + - "source-26" + - "source-28" + - "source-29" - "source-default" fail-fast: false diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..e69de29b diff --git a/CHANGELOG.md b/CHANGELOG.md index d04d28fa..eed7c6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This file is used to list changes made in each version of the haproxy cookbook. ## Unreleased +- Update default HAProxy source install verision to 2.8.5 +- Update source install tests to include versions 2.4, 2.6, 2.8, 2.9 + ## 12.2.23 - *2023-10-26* ## 12.2.22 - *2023-09-28* diff --git a/Dangerfile b/Dangerfile index bc08b7ae..a31ad760 100644 --- a/Dangerfile +++ b/Dangerfile @@ -37,7 +37,7 @@ if !git.modified_files.include?('CHANGELOG.md') && code_changes? end # Require Major Minor Patch version labels -unless github.pr_labels.grep /minor|major|patch/i +unless github.pr_labels.grep(/minor|major|patch/i) warn 'Please add a release label to this pull request' end diff --git a/Guardfile b/Guardfile index 06cd4bf8..2679a2fa 100644 --- a/Guardfile +++ b/Guardfile @@ -1,25 +1,25 @@ -require 'cookstyle' +require "cookstyle" -guard :rubocop, keep_failed: false, cli: '-r finstyle' do +guard :rubocop, keep_failed: false, cli: "-r finstyle" do watch(/.+\.rb$/) { |m| m[0] } watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } end -guard 'foodcritic', cookbook_paths: '.', cli: '-C -t ~FC001' do +guard "foodcritic", cookbook_paths: ".", cli: "-C -t ~FC001" do watch(%r{attributes/.+\.rb$}) watch(%r{providers/.+\.rb$}) watch(%r{recipes/.+\.rb$}) watch(%r{resources/.+\.rb$}) end -spec_path = 'test/unit' +spec_path = "test/unit" rspec_guard_config = { cmd: "bundle exec rspec --color --format progress --default-path=#{spec_path}", all_on_start: true, spec_paths: [spec_path], } -guard 'rspec', rspec_guard_config do +guard "rspec", rspec_guard_config do watch(%r{^#{spec_path}/.+_spec\.rb$}) watch("#{spec_path}/spec_helper.rb") { spec_path } watch(%r{^(libraries|providers|recipes|resources)/(.+)\.rb$}) do |m| diff --git a/documentation/haproxy_acl.md b/documentation/haproxy_acl.md index 4b8a70e2..e3f302b6 100644 --- a/documentation/haproxy_acl.md +++ b/documentation/haproxy_acl.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_acl +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Access Control Lists creates a new ACL `` or completes an existing one with new tests. The actions generally consist in blocking a request, selecting a backend, or adding a header. diff --git a/documentation/haproxy_backend.md b/documentation/haproxy_backend.md index 317ac6d8..a68dc8e7 100644 --- a/documentation/haproxy_backend.md +++ b/documentation/haproxy_backend.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_backend +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Backend describes a set of servers to which the proxy will connect to forward incoming connections. Introduced: v4.0.0 diff --git a/documentation/haproxy_cache.md b/documentation/haproxy_cache.md index 1d78bc64..f2526c72 100644 --- a/documentation/haproxy_cache.md +++ b/documentation/haproxy_cache.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_cache +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Cache describes a shared cache for small objects such as CSS, JS and icon files. Useful for web application acceleration. Available in HAProxy version 1.8 and later, and `max_object_size` in 1.9 and later. Introduced: v6.3.0 diff --git a/documentation/haproxy_config_defaults.md b/documentation/haproxy_config_defaults.md index 6e9bfbd7..f98fc6fa 100644 --- a/documentation/haproxy_config_defaults.md +++ b/documentation/haproxy_config_defaults.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_config_defaults +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Defaults sets default parameters for all other sections following its declaration. Those default parameters are reset by the next "defaults" section. Introduced: v4.0.0 diff --git a/documentation/haproxy_config_global.md b/documentation/haproxy_config_global.md index 6c5fa7c2..73544b53 100644 --- a/documentation/haproxy_config_global.md +++ b/documentation/haproxy_config_global.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_config_global +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Parameters in the "global" section are process-wide and often OS-specific. They are generally set once for all and do not need being changed once correct. diff --git a/documentation/haproxy_fastcgi.md b/documentation/haproxy_fastcgi.md index a416c385..5d1cf7c3 100644 --- a/documentation/haproxy_fastcgi.md +++ b/documentation/haproxy_fastcgi.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_fastcgi +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Fastcgi describes a FastCGI applications resource for haproxy to send HTTP requests to Responder FastCGI applications Resource available when using HAProxy version >= 2.1. diff --git a/documentation/haproxy_frontend.md b/documentation/haproxy_frontend.md index 4a649fb7..735a953c 100644 --- a/documentation/haproxy_frontend.md +++ b/documentation/haproxy_frontend.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_frontend +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Frontend describes a set of listening sockets accepting client connections. Introduced: v4.0.0 diff --git a/documentation/haproxy_install.md b/documentation/haproxy_install.md index a1ad7060..61dbf84b 100644 --- a/documentation/haproxy_install.md +++ b/documentation/haproxy_install.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_install +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Install HAProxy from package or source. Introduced: v4.0.0 diff --git a/documentation/haproxy_listen.md b/documentation/haproxy_listen.md index c682229b..bb983d54 100644 --- a/documentation/haproxy_listen.md +++ b/documentation/haproxy_listen.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_listen +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Listen defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic. diff --git a/documentation/haproxy_mailer.md b/documentation/haproxy_mailer.md index e341f28e..b6b7d8e4 100644 --- a/documentation/haproxy_mailer.md +++ b/documentation/haproxy_mailer.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_mailer +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Mailer describes a mailers resource for sending email alerts on server state changes. Introduced: v8.0.0 diff --git a/documentation/haproxy_peer.md b/documentation/haproxy_peer.md index bdf81c62..2adcad56 100644 --- a/documentation/haproxy_peer.md +++ b/documentation/haproxy_peer.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_peer +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Peer describes a peers resource for haproxy to propagate entries of any data-types in stick-tables between several haproxy instances over TCP connections in a multi-master fashion. Most of the properties are available only when using HAProxy version >= 2.0. To set properties for versions < 2.0, use the `extra_options` hash. See examples below. diff --git a/documentation/haproxy_resolver.md b/documentation/haproxy_resolver.md index 991b1d27..07a54f8e 100644 --- a/documentation/haproxy_resolver.md +++ b/documentation/haproxy_resolver.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_resolver +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Configuration related to name resolution in HAProxy. There can be as many as resolver sections as needed. Each section can contain many name servers. diff --git a/documentation/haproxy_service.md b/documentation/haproxy_service.md index 9d6851c3..3a7cfd88 100644 --- a/documentation/haproxy_service.md +++ b/documentation/haproxy_service.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_service +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Configures HAProxy as a systemd service. To reload HAProxy service add a subscribes option to the resource block. See example below. To reload the HAProxy service add a subscribes option to the resource block. See example below. diff --git a/documentation/haproxy_use_backend.md b/documentation/haproxy_use_backend.md index aacc1acb..ef3f285c 100644 --- a/documentation/haproxy_use_backend.md +++ b/documentation/haproxy_use_backend.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_use_backend +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Switch to a specific backend if/unless an ACL-based condition is matched. Introduced: v4.2.0 diff --git a/documentation/haproxy_userlist.md b/documentation/haproxy_userlist.md index 862cd905..c96788ef 100644 --- a/documentation/haproxy_userlist.md +++ b/documentation/haproxy_userlist.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # haproxy_userlist +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Control access to frontend/backend/listen sections or to http stats by allowing only authenticated and authorized users. Introduced: v4.1.0 diff --git a/documentation/partial_config_file.md b/documentation/partial_config_file.md index 41ccd09e..1399f5ec 100644 --- a/documentation/partial_config_file.md +++ b/documentation/partial_config_file.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # Partial Resource - _config_file +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Provides properties to control the generation of the HAProxy config file. Introduced: v11.0.0 diff --git a/documentation/partial_extra_options.md b/documentation/partial_extra_options.md index f98ce112..ac398f07 100644 --- a/documentation/partial_extra_options.md +++ b/documentation/partial_extra_options.md @@ -1,9 +1,7 @@ -[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) - ---- - # Partial Resource - _extra_options +[Back To Resource List](https://github.com/sous-chefs/haproxy#resources) + Provides properties to supply arbitrary parameters to the haproxy configuration template. Introduced: v11.0.0 diff --git a/kitchen.yml b/kitchen.yml index 82e3db5a..b17214e8 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -19,9 +19,8 @@ platforms: - name: centos-7 - name: centos-8 - name: centos-stream-8 - - name: debian-9 - - name: debian-10 - name: debian-11 + - name: debian-12 - name: ubuntu-20.04 - name: ubuntu-22.04 - name: fedora-latest @@ -30,19 +29,19 @@ suites: - name: package run_list: - recipe[test::package] - - name: source-1.8 + - name: source-2.4 run_list: - - recipe[test::source-18] - - name: source-2.0 + - recipe[test::source_24] + - name: source_2.6 run_list: - - recipe[test::source-20] - - name: source-2.2 + - recipe[test::source_26] + - name: source_2.8 run_list: - - recipe[test::source-22] - - name: source-2.4 + - recipe[test::source_28] + - name: source_2.9 run_list: - - recipe[test::source-24] - - name: source-default + - recipe[test::source_29] + - name: source_default run_list: - recipe[test::source] - name: source_lua diff --git a/resources/config_global.rb b/resources/config_global.rb index 827f5c97..e74f319c 100644 --- a/resources/config_global.rb +++ b/resources/config_global.rb @@ -20,11 +20,11 @@ property :stats, Hash, default: lazy { - { - socket: "/var/run/haproxy.sock user #{user} group #{group}", - timeout: '2m', - } - }, + { + socket: "/var/run/haproxy.sock user #{user} group #{group}", + timeout: '2m', + } + }, description: 'Enable stats with various options' property :maxconn, [Integer, String], diff --git a/resources/install.rb b/resources/install.rb index f28c13d3..2b16a845 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -31,13 +31,13 @@ # Source property :source_version, String, - default: '2.2.4' + default: '2.8.5' property :source_url, String, default: lazy { "https://www.haproxy.org/download/#{source_version.to_f}/src/haproxy-#{source_version}.tar.gz" } property :source_checksum, String, - default: '87a4d9d4ff8dc3094cb61bbed4a8eed2c40b5ac47b9604daebaf036d7b541be2' + default: '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9' property :source_target_cpu, String, default: lazy { node['kernel']['machine'] } diff --git a/spec/unit/recipes/install_spec.rb b/spec/unit/recipes/install_spec.rb index 9ce527ba..577fd9e7 100644 --- a/spec/unit/recipes/install_spec.rb +++ b/spec/unit/recipes/install_spec.rb @@ -24,7 +24,7 @@ end end before(:each) do - stub_command('/usr/sbin/haproxy -v | grep 2.2.4').and_return('2.2.4') + stub_command('/usr/sbin/haproxy -v | grep 2.8.5').and_return('2.8.5') end it { is_expected.to install_package(%w(libpcre3-dev libssl-dev zlib1g-dev libsystemd-dev)) } diff --git a/test/cookbooks/test/recipes/config_array.rb b/test/cookbooks/test/recipes/config_array.rb index 59dc21b5..3aa9ed91 100644 --- a/test/cookbooks/test/recipes/config_array.rb +++ b/test/cookbooks/test/recipes/config_array.rb @@ -27,7 +27,8 @@ 'redirect' => [ 'prefix http://www.bar.com code 301 if { hdr(host) -i foo.com }', 'prefix http://www.bar.com code 301 if { hdr(host) -i www.foo.com }', - ]) + ] + ) default_backend 'servers' end diff --git a/test/cookbooks/test/recipes/source.rb b/test/cookbooks/test/recipes/source.rb index 415a4b5d..0920cb2c 100644 --- a/test/cookbooks/test/recipes/source.rb +++ b/test/cookbooks/test/recipes/source.rb @@ -2,9 +2,9 @@ haproxy_install 'source' -haproxy_config_global '' +haproxy_config_global -haproxy_config_defaults '' +haproxy_config_defaults haproxy_service 'haproxy' do action %i(create enable start) diff --git a/test/cookbooks/test/recipes/source-24.rb b/test/cookbooks/test/recipes/source_24.rb similarity index 58% rename from test/cookbooks/test/recipes/source-24.rb rename to test/cookbooks/test/recipes/source_24.rb index afcc652a..828efdd2 100644 --- a/test/cookbooks/test/recipes/source-24.rb +++ b/test/cookbooks/test/recipes/source_24.rb @@ -1,9 +1,9 @@ -apt_update +version '2.4.25' haproxy_install 'source' do - source_url 'http://www.haproxy.org/download/2.4/src/haproxy-2.4.0.tar.gz' - source_checksum '0a6962adaf5a1291db87e3eb4ddf906a72fed535dbd2255b164b7d8394a53640' - source_version '2.4.0' + source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz" + source_checksum '44b035bdc9ffd4935f5292c2dfd4a1596c048dc59c5b25a0c6d7689d64f50b99' + source_version version use_libcrypt true use_pcre true use_openssl true diff --git a/test/cookbooks/test/recipes/source-18.rb b/test/cookbooks/test/recipes/source_26.rb similarity index 55% rename from test/cookbooks/test/recipes/source-18.rb rename to test/cookbooks/test/recipes/source_26.rb index a7ec0903..56db527b 100644 --- a/test/cookbooks/test/recipes/source-18.rb +++ b/test/cookbooks/test/recipes/source_26.rb @@ -1,9 +1,9 @@ -apt_update +version = '2.6.16' haproxy_install 'source' do - source_url 'http://www.haproxy.org/download/1.8/src/haproxy-1.8.17.tar.gz' - source_checksum '7b789b177875afdd5ddeff058e7efde73aa895dc2dcf728b464358635ae3948e' - source_version '1.8.17' + source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz" + source_checksum 'faac6f9564caf6e106fe22c77a1fb35406afc8cd484c35c2c844aaf0d7a097fb' + source_version version use_libcrypt true use_pcre true use_openssl true diff --git a/test/cookbooks/test/recipes/source-20.rb b/test/cookbooks/test/recipes/source_28.rb similarity index 56% rename from test/cookbooks/test/recipes/source-20.rb rename to test/cookbooks/test/recipes/source_28.rb index 3396e4dc..5a095d5f 100644 --- a/test/cookbooks/test/recipes/source-20.rb +++ b/test/cookbooks/test/recipes/source_28.rb @@ -1,9 +1,9 @@ -apt_update +version = '2.8.5' haproxy_install 'source' do - source_url 'https://www.haproxy.org/download/2.0/src/haproxy-2.0.12.tar.gz' - source_checksum '7fcf5adb21cd78c4161902f9fcc8d7fc97e1562319a992cbda884436ca9602fd' - source_version '2.0.12' + source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz" + source_checksum '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9' + source_version version use_libcrypt true use_pcre true use_openssl true diff --git a/test/cookbooks/test/recipes/source-22.rb b/test/cookbooks/test/recipes/source_29.rb similarity index 56% rename from test/cookbooks/test/recipes/source-22.rb rename to test/cookbooks/test/recipes/source_29.rb index 18c8d575..c8e83ae8 100644 --- a/test/cookbooks/test/recipes/source-22.rb +++ b/test/cookbooks/test/recipes/source_29.rb @@ -1,9 +1,9 @@ -apt_update +version = '2.9.3' haproxy_install 'source' do - source_url 'http://www.haproxy.org/download/2.2/src/haproxy-2.2.14.tar.gz' - source_checksum '6a9b702f04b07786f3e5878de8172a727acfdfdbc1cefe1c7a438df372f2fb61' - source_version '2.2.14' + source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz" + source_checksum 'ed517c65abd86945411f6bcb18c7ec657a706931cb781ea283063ba0a75858c0' + source_version version use_libcrypt true use_pcre true use_openssl true diff --git a/test/cookbooks/test/recipes/source_openssl.rb b/test/cookbooks/test/recipes/source_openssl.rb index c6f03d1a..ef2aaf02 100644 --- a/test/cookbooks/test/recipes/source_openssl.rb +++ b/test/cookbooks/test/recipes/source_openssl.rb @@ -70,7 +70,7 @@ # install haproxy with openssl haproxy_install 'source' do source_url 'http://www.haproxy.org/download/2.2/src/haproxy-2.2.4.tar.gz' - source_checksum '87a4d9d4ff8dc3094cb61bbed4a8eed2c40b5ac47b9604daebaf036d7b541be2' + source_checksum '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9' source_version '2.2.4' use_openssl true use_zlib true diff --git a/test/integration/config_4/example_spec.rb b/test/integration/config_4/example_spec.rb index ce88640b..0d6f0d8b 100644 --- a/test/integration/config_4/example_spec.rb +++ b/test/integration/config_4/example_spec.rb @@ -95,7 +95,7 @@ ' reqirep \^Host:\\\ www.mydomain.com Host:\\\ www', ' default_backend servers', ] - its('content') { should match /#{cfg_content.join('\n')}/ } + its('content') { should match(/#{cfg_content.join('\n')}/) } end describe service('haproxy') do diff --git a/test/integration/source-2.4/source_spec.rb b/test/integration/source-2.4/source_spec.rb index 5e48884d..3b6e931a 100644 --- a/test/integration/source-2.4/source_spec.rb +++ b/test/integration/source-2.4/source_spec.rb @@ -13,5 +13,5 @@ end describe command('haproxy -vv') do - its('stdout') { should match /Built with the Prometheus exporter as a service/ } + its('stdout') { should match(/Built with the Prometheus exporter as a service/) } end diff --git a/test/integration/source-1.8/source_spec.rb b/test/integration/source_2.6/source_spec.rb similarity index 100% rename from test/integration/source-1.8/source_spec.rb rename to test/integration/source_2.6/source_spec.rb diff --git a/test/integration/source-2.0/source_spec.rb b/test/integration/source_2.8/source_spec.rb similarity index 100% rename from test/integration/source-2.0/source_spec.rb rename to test/integration/source_2.8/source_spec.rb diff --git a/test/integration/source_2.9/source_spec.rb b/test/integration/source_2.9/source_spec.rb new file mode 100644 index 00000000..fcbe218e --- /dev/null +++ b/test/integration/source_2.9/source_spec.rb @@ -0,0 +1,13 @@ +describe directory '/etc/haproxy' do + it { should exist } +end + +describe file '/etc/haproxy/haproxy.cfg' do + its(:mode) { should cmp '0640' } +end + +describe service 'haproxy' do + it { should be_installed } + it { should be_enabled } + it { should be_running } +end diff --git a/test/integration/source_lua/lua_spec.rb b/test/integration/source_lua/lua_spec.rb index 70c7c0f7..fe18209a 100644 --- a/test/integration/source_lua/lua_spec.rb +++ b/test/integration/source_lua/lua_spec.rb @@ -3,5 +3,5 @@ end describe command('haproxy -vv | grep Lua') do - its('stdout') { should match /Built with Lua version/ } + its('stdout') { should match(/Built with Lua version/) } end diff --git a/test/integration/source_openssl/openssl_spec.rb b/test/integration/source_openssl/openssl_spec.rb index ae9df196..1dabf783 100644 --- a/test/integration/source_openssl/openssl_spec.rb +++ b/test/integration/source_openssl/openssl_spec.rb @@ -7,5 +7,5 @@ end describe command('haproxy -vv | grep "OpenSSL 1.1.1h"') do - its('stdout') { should match /OpenSSL version : OpenSSL 1.1.1h 22 Sep 2020/ } + its('stdout') { should match(/OpenSSL version : OpenSSL 1.1.1h 22 Sep 2020/) } end