Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
salt-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
salt-formula
Commits
6b5598a8
Unverified
Commit
6b5598a8
authored
3 years ago
by
Imran Iqbal
Browse files
Options
Downloads
Patches
Plain Diff
test(system): add `build_platform_codename` [skip ci]
* Automated using
https://github.com/myii/ssf-formula/pull/415
parent
47efbc04
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/integration/share/libraries/system.rb
+43
-1
43 additions, 1 deletion
test/integration/share/libraries/system.rb
with
43 additions
and
1 deletion
test/integration/share/libraries/system.rb
+
43
−
1
View file @
6b5598a8
...
...
@@ -4,6 +4,7 @@
# Author: Daniel Dehennin <daniel.dehennin@ac-dijon.fr>
# Copyright (C) 2020 Daniel Dehennin <daniel.dehennin@ac-dijon.fr>
# rubocop:disable Metrics/ClassLength
class
SystemResource
<
Inspec
.
resource
(
1
)
name
'system'
...
...
@@ -21,7 +22,8 @@ class SystemResource < Inspec.resource(1)
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
...
...
@@ -89,4 +91,44 @@ class SystemResource < Inspec.resource(1)
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
This diff is collapsed.
Click to expand it.
Jan Philipp Timme
@timmej
mentioned in commit
53b631c3
·
11 months ago
mentioned in commit
53b631c3
mentioned in commit 53b631c391f2f75a656a0a3f9c63fe7a82b774dc
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment