Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.ssf-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2.11.11
_commit: v2.11.13
_src_path: https://github.com/dafyddj/copier-ssf-ci
failure_permitted_ignored: []
failure_permitted_patterns: []
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: commitlint
- id: commitlint-ci
- repo: https://github.com/rubocop/rubocop
rev: v1.90.0
rev: v1.89.0
hooks:
- id: rubocop
name: Check Ruby files with rubocop
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org')

# Install the `inspec` gem using `git` because versions after `4.22.22`
# suppress diff output; this version fixes this for our uses.
# rubocop:disable-next Layout/LineLength
# rubocop:disable Layout/LineLength
gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf'
# rubocop:enable Layout/LineLength

# Install the `kitchen-docker` gem using `git` in order to avoid an upstream
# error caused by `kitchen-docker.gemspec`.
# TODO: correct the error upstream
# rubocop:disable-next Layout/LineLength
# rubocop:disable Layout/LineLength
gem 'kitchen-docker', git: 'https://github.com/dafyddj/kitchen-docker', branch: 'chore/gemspec'
# rubocop:enable Layout/LineLength

gem 'kitchen-inspec', '3.1.0'
gem 'kitchen-salt', '0.7.2'
Expand Down
15 changes: 9 additions & 6 deletions test/integration/share/libraries/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: Daniel Dehennin <daniel.dehennin@ac-dijon.fr>
# Copyright (C) 2020 Daniel Dehennin <daniel.dehennin@ac-dijon.fr>

# rubocop:disable-next Metrics/ClassLength
# rubocop:disable Metrics/ClassLength
class SystemResource < Inspec.resource(1)
name 'system'

Expand Down Expand Up @@ -47,7 +47,7 @@ def build_platform_name
end
end

# rubocop:disable-next Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
# rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
def build_platform_release
case inspec.platform[:name]
when 'amazon'
Expand All @@ -60,9 +60,9 @@ def build_platform_release
when 'mac_os_x'
inspec.command('sw_vers -productVersion').stdout.to_s
when 'opensuse'
release = inspec.platform[:release]
# rubocop:disable-next Style/NumericLiterals
release.to_i > 20210101 ? 'tumbleweed' : release
# rubocop:disable Style/NumericLiterals,Layout/LineLength
inspec.platform[:release].to_i > 20210101 ? 'tumbleweed' : inspec.platform[:release]
# rubocop:enable Style/NumericLiterals,Layout/LineLength
when 'windows_8.1_pro'
'8.1'
when 'windows_server_2022_datacenter'
Expand All @@ -75,6 +75,7 @@ def build_platform_release
inspec.platform[:release]
end
end
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity

def derive_gentoo_init_system
inspec.command('systemctl').exist? ? 'sysd' : 'sysv'
Expand All @@ -93,7 +94,7 @@ def build_finger_release
end
end

# rubocop:disable-next Metrics/MethodLength,Metrics/CyclomaticComplexity
# rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity
def build_platform_codename
case build_platform_finger
when 'ubuntu-22.04'
Expand Down Expand Up @@ -132,4 +133,6 @@ def build_platform_codename
''
end
end
# rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity
end
# rubocop:enable Metrics/ClassLength
Loading