Skip to content

Commit

Permalink
test(system): add build_platform_codename [skip ci]
Browse files Browse the repository at this point in the history
* Automated using myii/ssf-formula#415
  • Loading branch information
myii committed Feb 14, 2022
1 parent 8befefc commit f159202
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion test/integration/share/libraries/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Author: Daniel Dehennin <[email protected]>
# Copyright (C) 2020 Daniel Dehennin <[email protected]>

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

Expand All @@ -21,7 +22,8 @@ def build_platform
family: build_platform_family,
name: build_platform_name,
release: build_platform_release,
finger: build_platform_finger
finger: build_platform_finger,
codename: build_platform_codename
}
end

Expand Down Expand Up @@ -89,4 +91,44 @@ def build_finger_release
build_platform_release.split('.')[0]
end
end

# rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity
def build_platform_codename
case build_platform_finger
when 'ubuntu-20.04'
'focal'
when 'ubuntu-18.04'
'bionic'
when 'debian-11'
'bullseye'
when 'debian-10'
'buster'
when 'debian-9'
'stretch'
when 'almalinux-8'
"AlmaLinux #{build_platform_release} (Arctic Sphynx)"
when 'amazonlinux-2'
'Amazon Linux 2'
when 'arch-base-latest'
'Arch Linux'
when 'centos-7'
'CentOS Linux 7 (Core)'
when 'centos-8'
'CentOS Stream 8'
when 'opensuse-tumbleweed'
'openSUSE Tumbleweed'
when 'opensuse-15'
"openSUSE Leap #{build_platform_release}"
when 'oraclelinux-8', 'oraclelinux-7'
"Oracle Linux Server #{build_platform_release}"
when 'gentoo-2-sysd', 'gentoo-2-sysv'
'Gentoo/Linux'
when 'rockylinux-8'
"Rocky Linux #{build_platform_release} (Green Obsidian)"
else
''
end
end
# rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity
end
# rubocop:enable Metrics/ClassLength

0 comments on commit f159202

Please sign in to comment.