From: Tom Hughes Date: Wed, 9 Aug 2023 10:07:50 +0000 (+0000) Subject: Switch to using inspec for testing X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/22bf736efc9c971696fbc42a910b84c9f3895260?ds=inline Switch to using inspec for testing --- diff --git a/.kitchen.yml b/.kitchen.yml index cfa87e44b..aa560fc2d 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -25,6 +25,7 @@ provisioner: clean_dokken_sandbox: true verifier: + name: inspec root_path: /opt/verifier sudo: false diff --git a/Gemfile b/Gemfile index f04be603c..ec9eb03b0 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,5 @@ source "https://rubygems.org" gem "cookstyle" gem "kitchen-dokken" -gem "serverspec" +gem "kitchen-inspec" gem "test-kitchen" diff --git a/Gemfile.lock b/Gemfile.lock index cd1444a0b..8b175d973 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,32 +1,436 @@ GEM remote: https://rubygems.org/ specs: + activesupport (7.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) + aws-eventstream (1.2.0) + aws-partitions (1.800.0) + aws-sdk-account (1.17.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-alexaforbusiness (1.64.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-amplify (1.32.0) + aws-sdk-core (~> 3, >= 3.120.0) + aws-sigv4 (~> 1.1) + aws-sdk-apigateway (1.86.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-apigatewayv2 (1.50.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-applicationautoscaling (1.51.0) + aws-sdk-core (~> 3, >= 3.112.0) + aws-sigv4 (~> 1.1) + aws-sdk-athena (1.74.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-autoscaling (1.92.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-batch (1.73.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-budgets (1.58.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudformation (1.88.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudfront (1.82.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudhsm (1.46.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudhsmv2 (1.49.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudtrail (1.66.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatch (1.78.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatchevents (1.62.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatchlogs (1.69.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-codecommit (1.58.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-codedeploy (1.57.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-codepipeline (1.61.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-cognitoidentity (1.45.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-cognitoidentityprovider (1.76.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-configservice (1.96.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-core (3.180.2) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) + jmespath (~> 1, >= 1.6.1) + aws-sdk-costandusagereportservice (1.49.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-databasemigrationservice (1.80.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-dynamodb (1.93.1) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-ec2 (1.396.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecr (1.63.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecrpublic (1.21.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecs (1.127.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-efs (1.65.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-eks (1.89.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticache (1.91.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticbeanstalk (1.59.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticloadbalancing (1.47.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticloadbalancingv2 (1.89.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticsearchservice (1.76.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-emr (1.53.0) + aws-sdk-core (~> 3, >= 3.121.2) + aws-sigv4 (~> 1.1) + aws-sdk-eventbridge (1.46.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-firehose (1.56.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-glue (1.145.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-guardduty (1.76.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-iam (1.86.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-kafka (1.62.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-kinesis (1.50.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-kms (1.71.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-lambda (1.104.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-mq (1.40.0) + aws-sdk-core (~> 3, >= 3.120.0) + aws-sigv4 (~> 1.1) + aws-sdk-networkfirewall (1.33.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-networkmanager (1.35.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-organizations (1.77.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-ram (1.26.0) + aws-sdk-core (~> 3, >= 3.112.0) + aws-sigv4 (~> 1.1) + aws-sdk-rds (1.189.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-redshift (1.97.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53 (1.78.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53domains (1.49.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53resolver (1.47.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.132.0) + aws-sdk-core (~> 3, >= 3.179.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.6) + aws-sdk-s3control (1.43.0) + aws-sdk-core (~> 3, >= 3.122.0) + aws-sigv4 (~> 1.1) + aws-sdk-secretsmanager (1.46.0) + aws-sdk-core (~> 3, >= 3.112.0) + aws-sigv4 (~> 1.1) + aws-sdk-securityhub (1.90.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-servicecatalog (1.60.0) + aws-sdk-core (~> 3, >= 3.112.0) + aws-sigv4 (~> 1.1) + aws-sdk-ses (1.41.0) + aws-sdk-core (~> 3, >= 3.120.0) + aws-sigv4 (~> 1.1) + aws-sdk-shield (1.56.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-signer (1.32.0) + aws-sdk-core (~> 3, >= 3.120.0) + aws-sigv4 (~> 1.1) + aws-sdk-simpledb (1.29.0) + aws-sdk-core (~> 3, >= 3.120.0) + aws-sigv2 (~> 1.0) + aws-sdk-sms (1.48.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-sns (1.65.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-sqs (1.62.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-ssm (1.156.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-states (1.39.0) + aws-sdk-core (~> 3, >= 3.112.0) + aws-sigv4 (~> 1.1) + aws-sdk-synthetics (1.19.0) + aws-sdk-core (~> 3, >= 3.121.2) + aws-sigv4 (~> 1.1) + aws-sdk-transfer (1.73.0) + aws-sdk-core (~> 3, >= 3.176.0) + aws-sigv4 (~> 1.1) + aws-sdk-waf (1.43.0) + aws-sdk-core (~> 3, >= 3.122.0) + aws-sigv4 (~> 1.1) + aws-sigv2 (1.1.0) + aws-sigv4 (1.6.0) + aws-eventstream (~> 1, >= 1.0.2) + azure_graph_rbac (0.17.2) + ms_rest_azure (~> 0.12.0) + azure_mgmt_key_vault (0.17.7) + ms_rest_azure (~> 0.12.0) + azure_mgmt_resources (0.18.2) + ms_rest_azure (~> 0.12.0) + azure_mgmt_security (0.19.0) + ms_rest_azure (~> 0.12.0) + azure_mgmt_storage (0.23.0) + ms_rest_azure (~> 0.12.0) bcrypt_pbkdf (1.1.0) + bson (4.15.0) builder (3.2.4) + chef-config (18.2.7) + addressable + chef-utils (= 18.2.7) + fuzzyurl + mixlib-config (>= 2.2.12, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + tomlrb (~> 1.2) + chef-telemetry (1.1.1) + chef-config + concurrent-ruby (~> 1.0) chef-utils (18.2.7) concurrent-ruby + coderay (1.1.3) concurrent-ruby (1.2.2) cookstyle (7.32.2) rubocop (= 1.25.1) + declarative (0.0.20) diff-lcs (1.5.0) docker-api (2.2.0) excon (>= 0.47.0) multi_json + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dry-configurable (0.13.0) + concurrent-ruby (~> 1.0) + dry-core (~> 0.6) + dry-container (0.11.0) + concurrent-ruby (~> 1.0) + dry-core (0.9.1) + concurrent-ruby (~> 1.0) + zeitwerk (~> 2.6) + dry-inflector (0.3.0) + dry-logic (1.3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 0.9, >= 0.9) + zeitwerk (~> 2.6) + dry-struct (1.5.2) + dry-core (~> 0.9, >= 0.9) + dry-types (~> 1.6) + ice_nine (~> 0.11) + zeitwerk (~> 2.6) + dry-types (1.6.1) + concurrent-ruby (~> 1.0) + dry-container (~> 0.3) + dry-core (~> 0.9, >= 0.9) + dry-inflector (~> 0.1, >= 0.1.2) + dry-logic (~> 1.3, >= 1.3) + zeitwerk (~> 2.6) ed25519 (1.3.0) erubi (1.12.0) excon (0.100.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.0.0) + faraday (~> 1.0) ffi (1.15.5) + fuzzyurl (0.9.0) + google-api-client (0.52.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (~> 0.9) + httpclient (>= 2.8.1, < 3.0) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + rexml + signet (~> 0.12) + googleauth (0.14.0) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.14) gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.4.0) builder (>= 2.1.2) rexml (~> 3.0) + hashdiff (1.0.1) + hashie (4.1.0) + highline (2.1.0) + http-cookie (1.0.5) + domain_name (~> 0.5) httpclient (2.8.3) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + ice_nine (0.11.2) + inifile (3.0.0) + inspec (5.22.3) + cookstyle + faraday_middleware (>= 0.12.2, < 1.1) + inspec-core (= 5.22.3) + mongo (= 2.13.2) + progress_bar (~> 1.3.3) + rake + train (~> 3.10) + train-aws (~> 0.2) + train-habitat (~> 0.1) + train-kubernetes (~> 0.1) + train-winrm (~> 0.2) + inspec-core (5.22.3) + addressable (~> 2.4) + chef-telemetry (~> 1.0, >= 1.0.8) + faraday (>= 1, < 3) + faraday-follow_redirects (~> 0.3) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 2.0) + pry (~> 0.13) + rspec (>= 3.9, <= 3.11) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.10) + tty-prompt (~> 0.17) + tty-table (~> 0.10) + jmespath (1.6.2) + json (2.6.3) + jsonpath (0.9.9) + multi_json + to_regexp (~> 0.2.1) + jwt (2.7.1) + k8s-ruby (0.14.0) + dry-configurable (~> 0.13.0) + dry-struct (<= 1.6.0) + dry-types (<= 1.7.0) + excon (~> 0.71) + hashdiff (~> 1.0.0) + jsonpath (~> 0.9.5) + recursive-open-struct (~> 1.1.3) + yajl-ruby (~> 1.4.0) + yaml-safe_load_stream3 kitchen-dokken (2.19.1) docker-api (>= 1.33, < 3) lockfile (~> 2.1) test-kitchen (>= 1.15, < 4) + kitchen-inspec (2.6.2) + hashie (>= 3.4, <= 5.0) + inspec (>= 2.2.64, < 6.0) + test-kitchen (>= 2.7, < 4) license-acceptance (2.1.13) pastel (~> 0.7) tomlrb (>= 1.2, < 3.0) @@ -37,47 +441,82 @@ GEM logging (2.3.1) little-plugger (~> 1.1) multi_json (~> 1.14) + memoist (0.16.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.19.0) + mixlib-config (3.0.27) + tomlrb mixlib-install (3.12.27) mixlib-shellout mixlib-versioning thor + mixlib-log (3.0.9) mixlib-shellout (3.2.7) chef-utils mixlib-versioning (1.2.12) + mongo (2.13.2) + bson (>= 4.8.2, < 5.0.0) + ms_rest (0.7.6) + concurrent-ruby (~> 1.0) + faraday (>= 0.9, < 2.0.0) + timeliness (~> 0.3.10) + ms_rest_azure (0.12.0) + concurrent-ruby (~> 1.0) + faraday (>= 0.9, < 2.0.0) + faraday-cookie_jar (~> 0.0.6) + ms_rest (~> 0.7.6) multi_json (1.15.0) + multipart-post (2.3.0) net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) net-ssh (7.2.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) - net-telnet (0.1.1) nori (2.6.0) + options (2.3.2) + os (1.1.4) parallel (1.23.0) parser (3.2.2.3) ast (~> 2.4.1) racc + parslet (1.8.2) pastel (0.8.0) tty-color (~> 0.5) + progress_bar (1.3.3) + highline (>= 1.6, < 3) + options (~> 2.3.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (5.0.3) racc (1.7.1) rainbow (3.1.1) + rake (13.0.6) + recursive-open-struct (1.1.3) regexp_parser (2.8.1) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.11.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.12.6) + rspec-mocks (3.11.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) + rspec-support (~> 3.11.0) + rspec-support (3.11.1) rubocop (1.25.1) parallel (~> 1.10) parser (>= 3.1.0.0) @@ -90,19 +529,16 @@ GEM rubocop-ast (1.29.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) rubyntlm (0.6.3) rubyzip (2.3.2) - serverspec (2.42.2) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.72) - sfl (2.3) - specinfra (2.86.0) - net-scp - net-ssh (>= 2.7) - net-telnet (= 0.1.1) - sfl + semverse (3.0.2) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + sslshake (1.3.1) strings (0.2.1) strings-ansi (~> 0.2) unicode-display_width (>= 1.5, < 3.0) @@ -123,7 +559,115 @@ GEM winrm-elevated (~> 1.0) winrm-fs (~> 1.1) thor (1.2.2) - tomlrb (2.0.3) + timeliness (0.3.10) + to_regexp (0.2.1) + tomlrb (1.3.0) + trailblazer-option (0.1.2) + train (3.10.8) + activesupport (>= 6.0.3.1) + azure_graph_rbac (~> 0.16) + azure_mgmt_key_vault (~> 0.17) + azure_mgmt_resources (~> 0.15) + azure_mgmt_security (~> 0.18) + azure_mgmt_storage (~> 0.18) + docker-api (>= 1.26, < 3.0) + google-api-client (>= 0.23.9, <= 0.52.0) + googleauth (>= 0.6.6, <= 0.14.0) + inifile (~> 3.0) + train-core (= 3.10.8) + train-winrm (~> 0.2) + train-aws (0.2.36) + aws-sdk-account (~> 1.14) + aws-sdk-alexaforbusiness (~> 1.0) + aws-sdk-amplify (~> 1.32.0) + aws-sdk-apigateway (~> 1.0) + aws-sdk-apigatewayv2 (~> 1.0) + aws-sdk-applicationautoscaling (>= 1.46, < 1.52) + aws-sdk-athena (~> 1.0) + aws-sdk-autoscaling (>= 1.22, < 1.93) + aws-sdk-batch (>= 1.36, < 1.74) + aws-sdk-budgets (~> 1.0) + aws-sdk-cloudformation (~> 1.0) + aws-sdk-cloudfront (~> 1.0) + aws-sdk-cloudhsm (~> 1.0) + aws-sdk-cloudhsmv2 (~> 1.0) + aws-sdk-cloudtrail (~> 1.8) + aws-sdk-cloudwatch (~> 1.13) + aws-sdk-cloudwatchevents (>= 1.36, < 1.63) + aws-sdk-cloudwatchlogs (~> 1.13) + aws-sdk-codecommit (~> 1.0) + aws-sdk-codedeploy (~> 1.0) + aws-sdk-codepipeline (~> 1.0) + aws-sdk-cognitoidentity (>= 1.26, < 1.46) + aws-sdk-cognitoidentityprovider (>= 1.46, < 1.77) + aws-sdk-configservice (~> 1.21) + aws-sdk-core (~> 3.0) + aws-sdk-costandusagereportservice (~> 1.6) + aws-sdk-databasemigrationservice (>= 1.42, < 1.81) + aws-sdk-dynamodb (~> 1.31) + aws-sdk-ec2 (~> 1.70) + aws-sdk-ecr (~> 1.18) + aws-sdk-ecrpublic (~> 1.3) + aws-sdk-ecs (~> 1.30) + aws-sdk-efs (~> 1.0) + aws-sdk-eks (~> 1.9) + aws-sdk-elasticache (~> 1.0) + aws-sdk-elasticbeanstalk (~> 1.0) + aws-sdk-elasticloadbalancing (~> 1.8) + aws-sdk-elasticloadbalancingv2 (~> 1.0) + aws-sdk-elasticsearchservice (~> 1.0) + aws-sdk-emr (~> 1.53.0) + aws-sdk-eventbridge (>= 1.24, < 1.47) + aws-sdk-firehose (~> 1.0) + aws-sdk-glue (>= 1.71, < 1.146) + aws-sdk-guardduty (~> 1.31) + aws-sdk-iam (~> 1.13) + aws-sdk-kafka (~> 1.0) + aws-sdk-kinesis (~> 1.0) + aws-sdk-kms (~> 1.13) + aws-sdk-lambda (~> 1.0) + aws-sdk-mq (~> 1.40.0) + aws-sdk-networkfirewall (>= 1.6.0) + aws-sdk-networkmanager (>= 1.13.0) + aws-sdk-organizations (>= 1.17, < 1.78) + aws-sdk-ram (>= 1.21, < 1.27) + aws-sdk-rds (~> 1.43) + aws-sdk-redshift (~> 1.0) + aws-sdk-route53 (~> 1.0) + aws-sdk-route53domains (~> 1.0) + aws-sdk-route53resolver (~> 1.0) + aws-sdk-s3 (~> 1.30) + aws-sdk-s3control (~> 1.43.0) + aws-sdk-secretsmanager (>= 1.42, < 1.47) + aws-sdk-securityhub (~> 1.0) + aws-sdk-servicecatalog (>= 1.48, < 1.61) + aws-sdk-ses (~> 1.41.0) + aws-sdk-shield (~> 1.30) + aws-sdk-signer (~> 1.32.0) + aws-sdk-simpledb (~> 1.29.0) + aws-sdk-sms (~> 1.0) + aws-sdk-sns (~> 1.9) + aws-sdk-sqs (~> 1.10) + aws-sdk-ssm (~> 1.0) + aws-sdk-states (>= 1.35, < 1.40) + aws-sdk-synthetics (~> 1.19.0) + aws-sdk-transfer (>= 1.26, < 1.74) + aws-sdk-waf (~> 1.43.0) + train-core (3.10.8) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 5.0) + net-ssh (>= 2.9, < 8.0) + train-habitat (0.2.22) + train-kubernetes (0.1.12) + k8s-ruby (~> 0.14.0) + train (~> 3.0) + train-winrm (0.2.13) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) + winrm-fs (~> 1.0) tty-box (0.7.0) pastel (~> 0.8) strings (~> 0.2.0) @@ -138,6 +682,16 @@ GEM tty-screen (~> 0.8) wisper (~> 2.0) tty-screen (0.8.1) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) unicode-display_width (2.4.2) unicode_utils (1.4.0) winrm (2.3.6) @@ -159,6 +713,9 @@ GEM rubyzip (~> 2.0) winrm (~> 2.0) wisper (2.0.1) + yajl-ruby (1.4.3) + yaml-safe_load_stream3 (0.1.2) + zeitwerk (2.6.11) PLATFORMS ruby @@ -166,7 +723,7 @@ PLATFORMS DEPENDENCIES cookstyle kitchen-dokken - serverspec + kitchen-inspec test-kitchen BUNDLED WITH diff --git a/test/integration/apache/serverspec/apache_spec.rb b/test/integration/apache/inspec/apache_spec.rb similarity index 57% rename from test/integration/apache/serverspec/apache_spec.rb rename to test/integration/apache/inspec/apache_spec.rb index dcd625ae5..8006330b4 100644 --- a/test/integration/apache/serverspec/apache_spec.rb +++ b/test/integration/apache/inspec/apache_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("apache2") do it { should be_installed } end @@ -13,9 +8,11 @@ describe service("apache2") do end describe port(80) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end describe port(443) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/awscli/serverspec/awscli_spec.rb b/test/integration/awscli/inspec/awscli_spec.rb similarity index 60% rename from test/integration/awscli/serverspec/awscli_spec.rb rename to test/integration/awscli/inspec/awscli_spec.rb index 919363fec..de0a9e616 100644 --- a/test/integration/awscli/serverspec/awscli_spec.rb +++ b/test/integration/awscli/inspec/awscli_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe command("/opt/awscli/v2/current/bin/aws --version") do its("exit_status") { should eq 0 } end diff --git a/test/integration/bind/serverspec/bind_spec.rb b/test/integration/bind/inspec/bind_spec.rb similarity index 53% rename from test/integration/bind/serverspec/bind_spec.rb rename to test/integration/bind/inspec/bind_spec.rb index 8986df12c..399ec9b51 100644 --- a/test/integration/bind/serverspec/bind_spec.rb +++ b/test/integration/bind/inspec/bind_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("bind9") do it { should be_installed } end @@ -13,6 +8,6 @@ describe service("bind9") do end describe port(53) do - it { should be_listening.with("udp") } - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[udp udp6 tcp tcp6] } end diff --git a/test/integration/blogs/serverspec/apache_spec.rb b/test/integration/blog/inspec/apache_spec.rb similarity index 57% rename from test/integration/blogs/serverspec/apache_spec.rb rename to test/integration/blog/inspec/apache_spec.rb index dcd625ae5..8006330b4 100644 --- a/test/integration/blogs/serverspec/apache_spec.rb +++ b/test/integration/blog/inspec/apache_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("apache2") do it { should be_installed } end @@ -13,9 +8,11 @@ describe service("apache2") do end describe port(80) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end describe port(443) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/blog/serverspec/wordpress_spec.rb b/test/integration/blog/inspec/wordpress_spec.rb similarity index 81% rename from test/integration/blog/serverspec/wordpress_spec.rb rename to test/integration/blog/inspec/wordpress_spec.rb index c4a8ca14d..6533511d9 100644 --- a/test/integration/blog/serverspec/wordpress_spec.rb +++ b/test/integration/blog/inspec/wordpress_spec.rb @@ -1,9 +1,3 @@ - -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe command("/opt/wp-cli/wp --allow-root --path=/srv/blog.openstreetmap.org/wp/ core is-installed") do its("exit_status") { should eq 0 } end diff --git a/test/integration/civicrm-staging/serverspec/apache_spec.rb b/test/integration/blogs/inspec/apache_spec.rb similarity index 57% rename from test/integration/civicrm-staging/serverspec/apache_spec.rb rename to test/integration/blogs/inspec/apache_spec.rb index dcd625ae5..8006330b4 100644 --- a/test/integration/civicrm-staging/serverspec/apache_spec.rb +++ b/test/integration/blogs/inspec/apache_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("apache2") do it { should be_installed } end @@ -13,9 +8,11 @@ describe service("apache2") do end describe port(80) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end describe port(443) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/blog/serverspec/apache_spec.rb b/test/integration/civicrm-staging/inspec/apache_spec.rb similarity index 57% rename from test/integration/blog/serverspec/apache_spec.rb rename to test/integration/civicrm-staging/inspec/apache_spec.rb index dcd625ae5..8006330b4 100644 --- a/test/integration/blog/serverspec/apache_spec.rb +++ b/test/integration/civicrm-staging/inspec/apache_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("apache2") do it { should be_installed } end @@ -13,9 +8,11 @@ describe service("apache2") do end describe port(80) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end describe port(443) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/civicrm/inspec/apache_spec.rb b/test/integration/civicrm/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/civicrm/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/civicrm/serverspec/apache_spec.rb b/test/integration/civicrm/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/civicrm/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/clamav/serverspec/clamav_spec.rb b/test/integration/clamav/inspec/clamav_spec.rb similarity index 83% rename from test/integration/clamav/serverspec/clamav_spec.rb rename to test/integration/clamav/inspec/clamav_spec.rb index ce8687e5b..f70323c0b 100644 --- a/test/integration/clamav/serverspec/clamav_spec.rb +++ b/test/integration/clamav/inspec/clamav_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("clamav-daemon") do it { should be_installed } end diff --git a/test/integration/community/serverspec/docker_spec.rb b/test/integration/community/inspec/docker_spec.rb similarity index 85% rename from test/integration/community/serverspec/docker_spec.rb rename to test/integration/community/inspec/docker_spec.rb index 0ed66a3be..08853dfb4 100644 --- a/test/integration/community/serverspec/docker_spec.rb +++ b/test/integration/community/inspec/docker_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("docker-ce") do it { should be_installed } end diff --git a/test/integration/community/inspec/http_spec.rb b/test/integration/community/inspec/http_spec.rb new file mode 100644 index 000000000..e5e0677e9 --- /dev/null +++ b/test/integration/community/inspec/http_spec.rb @@ -0,0 +1,9 @@ +describe port(80) do + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } +end diff --git a/test/integration/community/serverspec/http_spec.rb b/test/integration/community/serverspec/http_spec.rb deleted file mode 100644 index 3f445b0ab..000000000 --- a/test/integration/community/serverspec/http_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe port(80) do - it { should be_listening.with("tcp") } -end - -describe port(443) do - it { should be_listening.with("tcp") } -end diff --git a/test/integration/db-backup/serverspec/backup_spec.rb b/test/integration/db-backup/inspec/backup_spec.rb similarity index 58% rename from test/integration/db-backup/serverspec/backup_spec.rb rename to test/integration/db-backup/inspec/backup_spec.rb index a620c0a27..411949a12 100644 --- a/test/integration/db-backup/serverspec/backup_spec.rb +++ b/test/integration/db-backup/inspec/backup_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("backup-db.timer") do it { should be_enabled } it { should be_running } diff --git a/test/integration/db-base/serverspec/postgresql_spec.rb b/test/integration/db-base/inspec/postgresql_spec.rb similarity index 64% rename from test/integration/db-base/serverspec/postgresql_spec.rb rename to test/integration/db-base/inspec/postgresql_spec.rb index 84008f457..4c5872e63 100644 --- a/test/integration/db-base/serverspec/postgresql_spec.rb +++ b/test/integration/db-base/inspec/postgresql_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("postgresql-15") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("postgresql@15-main") do end describe port(5432) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/db-master/serverspec/postgresql_spec.rb b/test/integration/db-master/inspec/postgresql_spec.rb similarity index 64% rename from test/integration/db-master/serverspec/postgresql_spec.rb rename to test/integration/db-master/inspec/postgresql_spec.rb index 84008f457..4c5872e63 100644 --- a/test/integration/db-master/serverspec/postgresql_spec.rb +++ b/test/integration/db-master/inspec/postgresql_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("postgresql-15") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("postgresql@15-main") do end describe port(5432) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/postgresql/serverspec/postgresql_spec.rb b/test/integration/db-slave/inspec/postgresql_spec.rb similarity index 64% rename from test/integration/postgresql/serverspec/postgresql_spec.rb rename to test/integration/db-slave/inspec/postgresql_spec.rb index 84008f457..4c5872e63 100644 --- a/test/integration/postgresql/serverspec/postgresql_spec.rb +++ b/test/integration/db-slave/inspec/postgresql_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("postgresql-15") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("postgresql@15-main") do end describe port(5432) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/dhcpd/serverspec/dhcpd_spec.rb b/test/integration/dhcpd/inspec/dhcpd_spec.rb similarity index 64% rename from test/integration/dhcpd/serverspec/dhcpd_spec.rb rename to test/integration/dhcpd/inspec/dhcpd_spec.rb index 643f083f4..dd6ec8664 100644 --- a/test/integration/dhcpd/serverspec/dhcpd_spec.rb +++ b/test/integration/dhcpd/inspec/dhcpd_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("isc-dhcp-server") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("isc-dhcp-server") do end describe port(67) do - it { should be_listening.with("udp") } + it { should be_listening } + its("protocols") { should cmp "udp" } end diff --git a/test/integration/dmca/inspec/apache_spec.rb b/test/integration/dmca/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/dmca/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/dmca/serverspec/apache_spec.rb b/test/integration/dmca/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/dmca/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/dns/inspec/apache_spec.rb b/test/integration/dns/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/dns/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/dns/serverspec/dnscontrol_spec.rb b/test/integration/dns/inspec/dnscontrol_spec.rb similarity index 68% rename from test/integration/dns/serverspec/dnscontrol_spec.rb rename to test/integration/dns/inspec/dnscontrol_spec.rb index 3103344ec..e623363b7 100644 --- a/test/integration/dns/serverspec/dnscontrol_spec.rb +++ b/test/integration/dns/inspec/dnscontrol_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("dnscontrol") do it { should be_installed } end diff --git a/test/integration/dns/serverspec/apache_spec.rb b/test/integration/dns/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/dns/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/docker/serverspec/docker_spec.rb b/test/integration/docker/inspec/docker_spec.rb similarity index 69% rename from test/integration/docker/serverspec/docker_spec.rb rename to test/integration/docker/inspec/docker_spec.rb index de7c426d2..515bd6d09 100644 --- a/test/integration/docker/serverspec/docker_spec.rb +++ b/test/integration/docker/inspec/docker_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("docker-ce") do it { should be_installed } end diff --git a/test/integration/donate/inspec/apache_spec.rb b/test/integration/donate/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/donate/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/donate/serverspec/apache_spec.rb b/test/integration/donate/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/donate/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/logstash/serverspec/elasticsearch_spec.rb b/test/integration/elasticsearch/inspec/elasticsearch_spec.rb similarity index 64% rename from test/integration/logstash/serverspec/elasticsearch_spec.rb rename to test/integration/elasticsearch/inspec/elasticsearch_spec.rb index b4e9fa77b..5977b2393 100644 --- a/test/integration/logstash/serverspec/elasticsearch_spec.rb +++ b/test/integration/elasticsearch/inspec/elasticsearch_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("elasticsearch") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("elasticsearch") do end # describe port(9200) do -# it { should be_listening.with("tcp") } +# it { should be_listening } +# its("protocols") { should cmp "tcp" } # end diff --git a/test/integration/mail/serverspec/exim_spec.rb b/test/integration/exim/inspec/exim_spec.rb similarity index 61% rename from test/integration/mail/serverspec/exim_spec.rb rename to test/integration/exim/inspec/exim_spec.rb index 2a6f6b2a9..170ef0a42 100644 --- a/test/integration/mail/serverspec/exim_spec.rb +++ b/test/integration/exim/inspec/exim_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("exim4") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("exim4") do end describe port(25) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/fail2ban/serverspec/fail2ban_spec.rb b/test/integration/fail2ban/inspec/fail2ban_spec.rb similarity index 69% rename from test/integration/fail2ban/serverspec/fail2ban_spec.rb rename to test/integration/fail2ban/inspec/fail2ban_spec.rb index 3e4106008..54c6be792 100644 --- a/test/integration/fail2ban/serverspec/fail2ban_spec.rb +++ b/test/integration/fail2ban/inspec/fail2ban_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("fail2ban") do it { should be_installed } end diff --git a/test/integration/foundation-board/inspec/apache_spec.rb b/test/integration/foundation-board/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-board/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-board/serverspec/apache_spec.rb b/test/integration/foundation-board/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-board/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/foundation-dwg/inspec/apache_spec.rb b/test/integration/foundation-dwg/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-dwg/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-dwg/serverspec/apache_spec.rb b/test/integration/foundation-dwg/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-dwg/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/foundation-mwg/inspec/apache_spec.rb b/test/integration/foundation-mwg/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-mwg/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-mwg/serverspec/apache_spec.rb b/test/integration/foundation-mwg/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-mwg/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/foundation-owg/inspec/apache_spec.rb b/test/integration/foundation-owg/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-owg/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-owg/serverspec/apache_spec.rb b/test/integration/foundation-owg/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-owg/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/foundation-welcome/inspec/apache_spec.rb b/test/integration/foundation-welcome/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-welcome/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-welcome/serverspec/apache_spec.rb b/test/integration/foundation-welcome/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-welcome/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/foundation-wiki/inspec/apache_spec.rb b/test/integration/foundation-wiki/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-wiki/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/foundation-wiki/serverspec/apache_spec.rb b/test/integration/foundation-wiki/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/foundation-wiki/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/ftp/serverspec/vsftpd_spec.rb b/test/integration/ftp/inspec/vsftpd_spec.rb similarity index 61% rename from test/integration/ftp/serverspec/vsftpd_spec.rb rename to test/integration/ftp/inspec/vsftpd_spec.rb index d6ed28f9e..388370d93 100644 --- a/test/integration/ftp/serverspec/vsftpd_spec.rb +++ b/test/integration/ftp/inspec/vsftpd_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("vsftpd") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("vsftpd") do end describe port(21) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/serverinfo/gdsnd_spec.rb b/test/integration/geodns/inspec/gdsnd_spec.rb similarity index 53% rename from test/integration/serverinfo/gdsnd_spec.rb rename to test/integration/geodns/inspec/gdsnd_spec.rb index 65adc36e2..52befb11c 100644 --- a/test/integration/serverinfo/gdsnd_spec.rb +++ b/test/integration/geodns/inspec/gdsnd_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("gdnsd") do it { should be_installed } end @@ -13,6 +8,6 @@ describe service("gdnsd") do end describe port(53) do - it { should be_listening.with("udp") } - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[udp tcp] } end diff --git a/test/integration/git-web/inspec/apache_spec.rb b/test/integration/git-web/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/git-web/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/git-web/inspec/gitweb_spec.rb b/test/integration/git-web/inspec/gitweb_spec.rb new file mode 100644 index 000000000..6db533958 --- /dev/null +++ b/test/integration/git-web/inspec/gitweb_spec.rb @@ -0,0 +1,3 @@ +describe package("gitweb") do + it { should be_installed } +end diff --git a/test/integration/git-web/serverspec/apache_spec.rb b/test/integration/git-web/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/git-web/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/git-web/serverspec/gitweb_spec.rb b/test/integration/git-web/serverspec/gitweb_spec.rb deleted file mode 100644 index 3818bea8d..000000000 --- a/test/integration/git-web/serverspec/gitweb_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("gitweb") do - it { should be_installed } -end diff --git a/test/integration/git/inspec/git_spec.rb b/test/integration/git/inspec/git_spec.rb new file mode 100644 index 000000000..92c6c1f64 --- /dev/null +++ b/test/integration/git/inspec/git_spec.rb @@ -0,0 +1,3 @@ +describe package("git") do + it { should be_installed } +end diff --git a/test/integration/git/serverspec/git_spec.rb b/test/integration/git/serverspec/git_spec.rb deleted file mode 100644 index b34c37dec..000000000 --- a/test/integration/git/serverspec/git_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("git") do - it { should be_installed } -end diff --git a/test/integration/gps-tile/inspec/apache_spec.rb b/test/integration/gps-tile/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/gps-tile/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/gps-tile/serverspec/gpsupdate_spec.rb b/test/integration/gps-tile/inspec/gpsupdate_spec.rb similarity index 57% rename from test/integration/gps-tile/serverspec/gpsupdate_spec.rb rename to test/integration/gps-tile/inspec/gpsupdate_spec.rb index bf6a3db6b..36add2429 100644 --- a/test/integration/gps-tile/serverspec/gpsupdate_spec.rb +++ b/test/integration/gps-tile/inspec/gpsupdate_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("gps-update") do it { should be_enabled } it { should be_running } diff --git a/test/integration/gps-tile/serverspec/apache_spec.rb b/test/integration/gps-tile/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/gps-tile/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/hot/inspec/apache_spec.rb b/test/integration/hot/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/hot/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/hot/serverspec/apache_spec.rb b/test/integration/hot/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/hot/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/ideditor/inspec/apache_spec.rb b/test/integration/ideditor/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/ideditor/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/ideditor/serverspec/apache_spec.rb b/test/integration/ideditor/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/ideditor/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/irc/inspec/apache_spec.rb b/test/integration/irc/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/irc/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/irc/serverspec/apache_spec.rb b/test/integration/irc/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/irc/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/kibana/inspec/apache_spec.rb b/test/integration/kibana/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/kibana/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/kibana/serverspec/apache_spec.rb b/test/integration/kibana/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/kibana/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/logstash-forwarder/serverspec/filebeat_spec.rb b/test/integration/logstash-forwarder/inspec/filebeat_spec.rb similarity index 69% rename from test/integration/logstash-forwarder/serverspec/filebeat_spec.rb rename to test/integration/logstash-forwarder/inspec/filebeat_spec.rb index 6ac089acf..10d7dcf60 100644 --- a/test/integration/logstash-forwarder/serverspec/filebeat_spec.rb +++ b/test/integration/logstash-forwarder/inspec/filebeat_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("filebeat") do it { should be_installed } end diff --git a/test/integration/elasticsearch/serverspec/elasticsearch_spec.rb b/test/integration/logstash/inspec/elasticsearch_spec.rb similarity index 64% rename from test/integration/elasticsearch/serverspec/elasticsearch_spec.rb rename to test/integration/logstash/inspec/elasticsearch_spec.rb index b4e9fa77b..5977b2393 100644 --- a/test/integration/elasticsearch/serverspec/elasticsearch_spec.rb +++ b/test/integration/logstash/inspec/elasticsearch_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("elasticsearch") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("elasticsearch") do end # describe port(9200) do -# it { should be_listening.with("tcp") } +# it { should be_listening } +# its("protocols") { should cmp "tcp" } # end diff --git a/test/integration/logstash/serverspec/logstash_spec.rb b/test/integration/logstash/inspec/logstash_spec.rb similarity index 63% rename from test/integration/logstash/serverspec/logstash_spec.rb rename to test/integration/logstash/inspec/logstash_spec.rb index c339de542..0ebfe55d2 100644 --- a/test/integration/logstash/serverspec/logstash_spec.rb +++ b/test/integration/logstash/inspec/logstash_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("logstash") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("logstash") do end # describe port(5044) do -# it { should be_listening.with("tcp") } +# it { should be_listening } +# its("protocols") { should cmp "tcp" } # end diff --git a/test/integration/mail/serverspec/clamav_spec.rb b/test/integration/mail/inspec/clamav_spec.rb similarity index 83% rename from test/integration/mail/serverspec/clamav_spec.rb rename to test/integration/mail/inspec/clamav_spec.rb index ce8687e5b..f70323c0b 100644 --- a/test/integration/mail/serverspec/clamav_spec.rb +++ b/test/integration/mail/inspec/clamav_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("clamav-daemon") do it { should be_installed } end diff --git a/test/integration/exim/serverspec/exim_spec.rb b/test/integration/mail/inspec/exim_spec.rb similarity index 61% rename from test/integration/exim/serverspec/exim_spec.rb rename to test/integration/mail/inspec/exim_spec.rb index 2a6f6b2a9..170ef0a42 100644 --- a/test/integration/exim/serverspec/exim_spec.rb +++ b/test/integration/mail/inspec/exim_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("exim4") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("exim4") do end describe port(25) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/mail/serverspec/spamassassin_spec.rb b/test/integration/mail/inspec/spamassassin_spec.rb similarity index 65% rename from test/integration/mail/serverspec/spamassassin_spec.rb rename to test/integration/mail/inspec/spamassassin_spec.rb index d96394f9e..18506eaa0 100644 --- a/test/integration/mail/serverspec/spamassassin_spec.rb +++ b/test/integration/mail/inspec/spamassassin_spec.rb @@ -1,9 +1,4 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -service_name = if os[:family] == "debian" +service_name = if os.name == "debian" "spamd" else "spamassassin" @@ -19,5 +14,6 @@ describe service(service_name) do end describe port(783) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/mailman/inspec/apache_spec.rb b/test/integration/mailman/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/mailman/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/mailman/serverspec/mailman_spec.rb b/test/integration/mailman/inspec/mailman_spec.rb similarity index 69% rename from test/integration/mailman/serverspec/mailman_spec.rb rename to test/integration/mailman/inspec/mailman_spec.rb index 2d5fd35d6..8f858b1c4 100644 --- a/test/integration/mailman/serverspec/mailman_spec.rb +++ b/test/integration/mailman/inspec/mailman_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("mailman") do it { should be_installed } end diff --git a/test/integration/mailman/serverspec/apache_spec.rb b/test/integration/mailman/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/mailman/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/matomo/inspec/apache_spec.rb b/test/integration/matomo/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/matomo/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/matomo/serverspec/apache_spec.rb b/test/integration/matomo/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/matomo/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/memcached/serverspec/memcached_spec.rb b/test/integration/memcached/inspec/memcached_spec.rb similarity index 63% rename from test/integration/memcached/serverspec/memcached_spec.rb rename to test/integration/memcached/inspec/memcached_spec.rb index 26eccec79..72efd1737 100644 --- a/test/integration/memcached/serverspec/memcached_spec.rb +++ b/test/integration/memcached/inspec/memcached_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("memcached") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("memcached") do end describe port(11211) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/munin-server/inspec/apache_spec.rb b/test/integration/munin-server/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/munin-server/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/munin-server/inspec/munin_spec.rb b/test/integration/munin-server/inspec/munin_spec.rb new file mode 100644 index 000000000..a27a00ce9 --- /dev/null +++ b/test/integration/munin-server/inspec/munin_spec.rb @@ -0,0 +1,3 @@ +describe package("munin") do + it { should be_installed } +end diff --git a/test/integration/munin-server/serverspec/rrdcached_spec.rb b/test/integration/munin-server/inspec/rrdcached_spec.rb similarity index 69% rename from test/integration/munin-server/serverspec/rrdcached_spec.rb rename to test/integration/munin-server/inspec/rrdcached_spec.rb index dad61e8f1..570258970 100644 --- a/test/integration/munin-server/serverspec/rrdcached_spec.rb +++ b/test/integration/munin-server/inspec/rrdcached_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("rrdcached") do it { should be_installed } end diff --git a/test/integration/munin-server/serverspec/apache_spec.rb b/test/integration/munin-server/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/munin-server/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/munin-server/serverspec/munin_spec.rb b/test/integration/munin-server/serverspec/munin_spec.rb deleted file mode 100644 index eeae1e4a9..000000000 --- a/test/integration/munin-server/serverspec/munin_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("munin") do - it { should be_installed } -end diff --git a/test/integration/munin/serverspec/munin_node_spec.rb b/test/integration/munin/inspec/munin_node_spec.rb similarity index 63% rename from test/integration/munin/serverspec/munin_node_spec.rb rename to test/integration/munin/inspec/munin_node_spec.rb index 9d3fdd355..e07e3b279 100644 --- a/test/integration/munin/serverspec/munin_node_spec.rb +++ b/test/integration/munin/inspec/munin_node_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("munin-node") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("munin-node") do end describe port(4949) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/mysql/serverspec/mysql_spec.rb b/test/integration/mysql/inspec/mysql_spec.rb similarity index 66% rename from test/integration/mysql/serverspec/mysql_spec.rb rename to test/integration/mysql/inspec/mysql_spec.rb index 88323fe98..549f33da9 100644 --- a/test/integration/mysql/serverspec/mysql_spec.rb +++ b/test/integration/mysql/inspec/mysql_spec.rb @@ -1,9 +1,4 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -mysql_variant = if os[:family] == "ubuntu" +mysql_variant = if os.name == "ubuntu" "mysql" else "mariadb" @@ -19,5 +14,6 @@ describe service("#{mysql_variant}") do end describe port(3306) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/networking/serverspec/nftables_spec.rb b/test/integration/networking/inspec/nftables_spec.rb similarity index 84% rename from test/integration/networking/serverspec/nftables_spec.rb rename to test/integration/networking/inspec/nftables_spec.rb index f1f1389fd..c928d2bc3 100644 --- a/test/integration/networking/serverspec/nftables_spec.rb +++ b/test/integration/networking/inspec/nftables_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("nftables") do it { should be_installed } end diff --git a/test/integration/nginx/serverspec/nginx_spec.rb b/test/integration/nginx/inspec/nginx_spec.rb similarity index 62% rename from test/integration/nginx/serverspec/nginx_spec.rb rename to test/integration/nginx/inspec/nginx_spec.rb index 03901cc32..b8f124f3c 100644 --- a/test/integration/nginx/serverspec/nginx_spec.rb +++ b/test/integration/nginx/inspec/nginx_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("nginx") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("nginx") do end describe port(8050) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/nodejs/serverspec/nodejs_spec.rb b/test/integration/nodejs/inspec/nodejs_spec.rb similarity index 64% rename from test/integration/nodejs/serverspec/nodejs_spec.rb rename to test/integration/nodejs/inspec/nodejs_spec.rb index 2d4e7fd20..eef75a297 100644 --- a/test/integration/nodejs/serverspec/nodejs_spec.rb +++ b/test/integration/nodejs/inspec/nodejs_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("nodejs") do it { should be_installed } end diff --git a/test/integration/nominatim/serverspec/nginx_spec.rb b/test/integration/nominatim/inspec/nginx_spec.rb similarity index 62% rename from test/integration/nominatim/serverspec/nginx_spec.rb rename to test/integration/nominatim/inspec/nginx_spec.rb index 03901cc32..b8f124f3c 100644 --- a/test/integration/nominatim/serverspec/nginx_spec.rb +++ b/test/integration/nominatim/inspec/nginx_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("nginx") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("nginx") do end describe port(8050) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/ntp/serverspec/chronyd_spec.rb b/test/integration/ntp/inspec/chronyd_spec.rb similarity index 69% rename from test/integration/ntp/serverspec/chronyd_spec.rb rename to test/integration/ntp/inspec/chronyd_spec.rb index 40894b040..90e656346 100644 --- a/test/integration/ntp/serverspec/chronyd_spec.rb +++ b/test/integration/ntp/inspec/chronyd_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("chrony") do it { should be_installed } end diff --git a/test/integration/openssh/serverspec/openssh_spec.rb b/test/integration/openssh/inspec/openssh_spec.rb similarity index 70% rename from test/integration/openssh/serverspec/openssh_spec.rb rename to test/integration/openssh/inspec/openssh_spec.rb index 49cfac352..6560895eb 100644 --- a/test/integration/openssh/serverspec/openssh_spec.rb +++ b/test/integration/openssh/inspec/openssh_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("openssh-client") do it { should be_installed } end @@ -17,5 +12,6 @@ describe service("ssh") do end describe port(22) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/osmosis/serverspec/osmosis_spec.rb b/test/integration/osmosis/inspec/osmosis_spec.rb similarity index 52% rename from test/integration/osmosis/serverspec/osmosis_spec.rb rename to test/integration/osmosis/inspec/osmosis_spec.rb index 93aecf0ac..6757d1e5f 100644 --- a/test/integration/osmosis/serverspec/osmosis_spec.rb +++ b/test/integration/osmosis/inspec/osmosis_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe file("/usr/local/bin/osmosis") do it { should be_symlink } end diff --git a/test/integration/osqa/inspec/apache_spec.rb b/test/integration/osqa/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/osqa/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/osqa/serverspec/apache_spec.rb b/test/integration/osqa/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/osqa/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/otrs/inspec/apache_spec.rb b/test/integration/otrs/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/otrs/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/otrs/serverspec/apache_spec.rb b/test/integration/otrs/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/otrs/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/overpass/inspec/apache_spec.rb b/test/integration/overpass/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/overpass/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/overpass/serverspec/apache_spec.rb b/test/integration/overpass/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/overpass/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/php-apache/inspec/apache_spec.rb b/test/integration/php-apache/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/php-apache/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/php-apache/serverspec/apache_spec.rb b/test/integration/php-apache/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/php-apache/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/planet-dump/serverspec/planetdump_spec.rb b/test/integration/planet-dump/inspec/planetdump_spec.rb similarity index 86% rename from test/integration/planet-dump/serverspec/planetdump_spec.rb rename to test/integration/planet-dump/inspec/planetdump_spec.rb index ea3de5d7f..b66ee8313 100644 --- a/test/integration/planet-dump/serverspec/planetdump_spec.rb +++ b/test/integration/planet-dump/inspec/planetdump_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe file("/opt/planet-dump-ng/planet-dump-ng") do it { should be_file } it { should be_executable } diff --git a/test/integration/planet-notes/serverspec/planetdump_spec.rb b/test/integration/planet-notes/inspec/planetdump_spec.rb similarity index 76% rename from test/integration/planet-notes/serverspec/planetdump_spec.rb rename to test/integration/planet-notes/inspec/planetdump_spec.rb index 18a34b4f7..be7a94604 100644 --- a/test/integration/planet-notes/serverspec/planetdump_spec.rb +++ b/test/integration/planet-notes/inspec/planetdump_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe file("/usr/local/bin/planet-notes-dump") do it { should be_file } it { should be_executable } diff --git a/test/integration/planet/inspec/apache_spec.rb b/test/integration/planet/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/planet/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/planet/serverspec/apache_spec.rb b/test/integration/planet/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/planet/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/db-slave/serverspec/postgresql_spec.rb b/test/integration/postgresql/inspec/postgresql_spec.rb similarity index 64% rename from test/integration/db-slave/serverspec/postgresql_spec.rb rename to test/integration/postgresql/inspec/postgresql_spec.rb index 84008f457..4c5872e63 100644 --- a/test/integration/db-slave/serverspec/postgresql_spec.rb +++ b/test/integration/postgresql/inspec/postgresql_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("postgresql-15") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("postgresql@15-main") do end describe port(5432) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/prometheus-server/serverspec/alertmanager_spec.rb b/test/integration/prometheus-server/inspec/alertmanager_spec.rb similarity index 54% rename from test/integration/prometheus-server/serverspec/alertmanager_spec.rb rename to test/integration/prometheus-server/inspec/alertmanager_spec.rb index eb3ddbb3b..bbdc65185 100644 --- a/test/integration/prometheus-server/serverspec/alertmanager_spec.rb +++ b/test/integration/prometheus-server/inspec/alertmanager_spec.rb @@ -1,13 +1,9 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("prometheus-alertmanager") do it { should be_enabled } it { should be_running } end describe port(9093) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/prometheus-server/inspec/apache_spec.rb b/test/integration/prometheus-server/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/prometheus-server/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/prometheus-server/serverspec/grafana_spec.rb b/test/integration/prometheus-server/inspec/grafana_spec.rb similarity index 64% rename from test/integration/prometheus-server/serverspec/grafana_spec.rb rename to test/integration/prometheus-server/inspec/grafana_spec.rb index 48f8945ba..f568f8f41 100644 --- a/test/integration/prometheus-server/serverspec/grafana_spec.rb +++ b/test/integration/prometheus-server/inspec/grafana_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("grafana-enterprise") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("grafana-server") do end describe port(3000) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/prometheus-server/serverspec/karma_spec.rb b/test/integration/prometheus-server/inspec/karma_spec.rb similarity index 53% rename from test/integration/prometheus-server/serverspec/karma_spec.rb rename to test/integration/prometheus-server/inspec/karma_spec.rb index 9e5840d8b..c907b4679 100644 --- a/test/integration/prometheus-server/serverspec/karma_spec.rb +++ b/test/integration/prometheus-server/inspec/karma_spec.rb @@ -1,13 +1,9 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("prometheus-karma") do it { should be_enabled } it { should be_running } end describe port(8081) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/prometheus-server/serverspec/prometheus_spec.rb b/test/integration/prometheus-server/inspec/prometheus_spec.rb similarity index 63% rename from test/integration/prometheus-server/serverspec/prometheus_spec.rb rename to test/integration/prometheus-server/inspec/prometheus_spec.rb index a4377ce53..54269418c 100644 --- a/test/integration/prometheus-server/serverspec/prometheus_spec.rb +++ b/test/integration/prometheus-server/inspec/prometheus_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("prometheus") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("prometheus") do end describe port(9090) do - it { should be_listening.with("tcp6") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/prometheus-server/serverspec/apache_spec.rb b/test/integration/prometheus-server/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/prometheus-server/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb b/test/integration/prometheus/inspec/prometheus_node_exporter_spec.rb similarity index 55% rename from test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb rename to test/integration/prometheus/inspec/prometheus_node_exporter_spec.rb index 7a035e8f6..42d26a02f 100644 --- a/test/integration/prometheus/serverspec/prometheus_node_exporter_spec.rb +++ b/test/integration/prometheus/inspec/prometheus_node_exporter_spec.rb @@ -1,13 +1,9 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("prometheus-node-exporter") do it { should be_enabled } it { should be_running } end describe port(9100) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/rsyncd/serverspec/rsync_spec.rb b/test/integration/rsyncd/inspec/rsync_spec.rb similarity index 61% rename from test/integration/rsyncd/serverspec/rsync_spec.rb rename to test/integration/rsyncd/inspec/rsync_spec.rb index 057ec3be3..d2841824b 100644 --- a/test/integration/rsyncd/serverspec/rsync_spec.rb +++ b/test/integration/rsyncd/inspec/rsync_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("rsync") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("rsync") do end describe port(873) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/serverinfo/inspec/apache_spec.rb b/test/integration/serverinfo/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/serverinfo/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/serverinfo/serverspec/apache_spec.rb b/test/integration/serverinfo/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/serverinfo/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/snmpd/serverspec/snmpd_spec.rb b/test/integration/snmpd/inspec/snmpd_spec.rb similarity index 61% rename from test/integration/snmpd/serverspec/snmpd_spec.rb rename to test/integration/snmpd/inspec/snmpd_spec.rb index baed87b4d..1e44d40d8 100644 --- a/test/integration/snmpd/serverspec/snmpd_spec.rb +++ b/test/integration/snmpd/inspec/snmpd_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("snmpd") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("snmpd") do end describe port(161) do - it { should be_listening.with("udp") } + it { should be_listening } + its("protocols") { should cmp %w[udp] } end diff --git a/test/integration/spamassassin/serverspec/spamassassin_spec.rb b/test/integration/spamassassin/inspec/spamassassin_spec.rb similarity index 65% rename from test/integration/spamassassin/serverspec/spamassassin_spec.rb rename to test/integration/spamassassin/inspec/spamassassin_spec.rb index d96394f9e..18506eaa0 100644 --- a/test/integration/spamassassin/serverspec/spamassassin_spec.rb +++ b/test/integration/spamassassin/inspec/spamassassin_spec.rb @@ -1,9 +1,4 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -service_name = if os[:family] == "debian" +service_name = if os.name == "debian" "spamd" else "spamassassin" @@ -19,5 +14,6 @@ describe service(service_name) do end describe port(783) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } end diff --git a/test/integration/stateofthemap-container/inspec/apache_spec.rb b/test/integration/stateofthemap-container/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/stateofthemap-container/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/stateofthemap-container/serverspec/apache_spec.rb b/test/integration/stateofthemap-container/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/stateofthemap-container/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/stateofthemap-wordpress/inspec/apache_spec.rb b/test/integration/stateofthemap-wordpress/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/stateofthemap-wordpress/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb b/test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/subversion/inspec/apache_spec.rb b/test/integration/subversion/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/subversion/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/subversion/serverspec/apache_spec.rb b/test/integration/subversion/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/subversion/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/supybot/serverspec/supybot_spec.rb b/test/integration/supybot/inspec/supybot_spec.rb similarity index 69% rename from test/integration/supybot/serverspec/supybot_spec.rb rename to test/integration/supybot/inspec/supybot_spec.rb index e5ee25291..53cd93fd4 100644 --- a/test/integration/supybot/serverspec/supybot_spec.rb +++ b/test/integration/supybot/inspec/supybot_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("limnoria") do it { should be_installed } end diff --git a/test/integration/switch2osm/inspec/apache_spec.rb b/test/integration/switch2osm/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/switch2osm/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/switch2osm/serverspec/apache_spec.rb b/test/integration/switch2osm/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/switch2osm/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/sysfs/serverspec/sysfsutils_spec.rb b/test/integration/sysfs/inspec/sysfsutils_spec.rb similarity index 70% rename from test/integration/sysfs/serverspec/sysfsutils_spec.rb rename to test/integration/sysfs/inspec/sysfsutils_spec.rb index fde71d848..da429aed7 100644 --- a/test/integration/sysfs/serverspec/sysfsutils_spec.rb +++ b/test/integration/sysfs/inspec/sysfsutils_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("sysfsutils") do it { should be_installed } end diff --git a/test/integration/taginfo/inspec/apache_spec.rb b/test/integration/taginfo/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/taginfo/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/taginfo/serverspec/apache_spec.rb b/test/integration/taginfo/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/taginfo/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/tile/inspec/apache_spec.rb b/test/integration/tile/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/tile/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/tile/serverspec/apache_spec.rb b/test/integration/tile/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/tile/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/trac/inspec/apache_spec.rb b/test/integration/trac/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/trac/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/trac/serverspec/apache_spec.rb b/test/integration/trac/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/trac/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/web-cgimap/serverspec/cgimap_spec.rb b/test/integration/web-cgimap/inspec/cgimap_spec.rb similarity index 51% rename from test/integration/web-cgimap/serverspec/cgimap_spec.rb rename to test/integration/web-cgimap/inspec/cgimap_spec.rb index d91e14576..8c9b5ce24 100644 --- a/test/integration/web-cgimap/serverspec/cgimap_spec.rb +++ b/test/integration/web-cgimap/inspec/cgimap_spec.rb @@ -1,13 +1,9 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("cgimap") do it { should be_enabled } it { should be_running } end describe port(8000) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/web-frontend/inspec/apache_spec.rb b/test/integration/web-frontend/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/web-frontend/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/web-frontend/serverspec/cgimap_spec.rb b/test/integration/web-frontend/inspec/cgimap_spec.rb similarity index 51% rename from test/integration/web-frontend/serverspec/cgimap_spec.rb rename to test/integration/web-frontend/inspec/cgimap_spec.rb index d91e14576..8c9b5ce24 100644 --- a/test/integration/web-frontend/serverspec/cgimap_spec.rb +++ b/test/integration/web-frontend/inspec/cgimap_spec.rb @@ -1,13 +1,9 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("cgimap") do it { should be_enabled } it { should be_running } end describe port(8000) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/web-frontend/serverspec/memcached_spec.rb b/test/integration/web-frontend/inspec/memcached_spec.rb similarity index 63% rename from test/integration/web-frontend/serverspec/memcached_spec.rb rename to test/integration/web-frontend/inspec/memcached_spec.rb index 26eccec79..72efd1737 100644 --- a/test/integration/web-frontend/serverspec/memcached_spec.rb +++ b/test/integration/web-frontend/inspec/memcached_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe package("memcached") do it { should be_installed } end @@ -13,5 +8,6 @@ describe service("memcached") do end describe port(11211) do - it { should be_listening.with("tcp") } + it { should be_listening } + its("protocols") { should cmp "tcp" } end diff --git a/test/integration/web-frontend/serverspec/rails_spec.rb b/test/integration/web-frontend/inspec/rails_spec.rb similarity index 81% rename from test/integration/web-frontend/serverspec/rails_spec.rb rename to test/integration/web-frontend/inspec/rails_spec.rb index 1abe820b6..69e9da3a0 100644 --- a/test/integration/web-frontend/serverspec/rails_spec.rb +++ b/test/integration/web-frontend/inspec/rails_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("api-statistics") do it { should be_enabled } it { should be_running } diff --git a/test/integration/web-frontend/serverspec/apache_spec.rb b/test/integration/web-frontend/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/web-frontend/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/web-rails/inspec/apache_spec.rb b/test/integration/web-rails/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/web-rails/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/web-rails/serverspec/rails_spec.rb b/test/integration/web-rails/inspec/rails_spec.rb similarity index 58% rename from test/integration/web-rails/serverspec/rails_spec.rb rename to test/integration/web-rails/inspec/rails_spec.rb index d02a65898..65d82b6e5 100644 --- a/test/integration/web-rails/serverspec/rails_spec.rb +++ b/test/integration/web-rails/inspec/rails_spec.rb @@ -1,8 +1,3 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - describe service("api-statistics") do it { should be_enabled } it { should be_running } diff --git a/test/integration/web-rails/serverspec/apache_spec.rb b/test/integration/web-rails/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/web-rails/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/wiki/inspec/apache_spec.rb b/test/integration/wiki/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/wiki/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/wiki/serverspec/apache_spec.rb b/test/integration/wiki/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/wiki/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end diff --git a/test/integration/wordpress/inspec/apache_spec.rb b/test/integration/wordpress/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/wordpress/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end diff --git a/test/integration/wordpress/serverspec/apache_spec.rb b/test/integration/wordpress/serverspec/apache_spec.rb deleted file mode 100644 index dcd625ae5..000000000 --- a/test/integration/wordpress/serverspec/apache_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening.with("tcp6") } -end - -describe port(443) do - it { should be_listening.with("tcp6") } -end