Skip to content

Commit baf61f9

Browse files
authored
Merge pull request #136 from myii/test/standardise-map.jinja-verification
test(map): standardise `map.jinja` verification
2 parents a0fdc61 + 97ccbb3 commit baf61f9

9 files changed

Lines changed: 67 additions & 12 deletions

File tree

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
/docs/AUTHORS.rst @saltstack-formulas/ssf
1616
/docs/CHANGELOG.rst @saltstack-formulas/ssf
1717
/docs/TOFS_pattern.rst @saltstack-formulas/ssf
18+
/*/_mapdata/ @saltstack-formulas/ssf
1819
/*/libsaltcli.jinja @saltstack-formulas/ssf
1920
/*/libtofs.jinja @saltstack-formulas/ssf
21+
/test/integration/**/_mapdata_spec.rb @saltstack-formulas/ssf
22+
/test/integration/**/libraries/system.rb @saltstack-formulas/ssf
2023
/test/integration/**/inspec.yml @saltstack-formulas/ssf
2124
/test/integration/**/README.md @saltstack-formulas/ssf
2225
/.gitignore @saltstack-formulas/ssf
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yamllint disable rule:indentation rule:line-length
2+
# Amazon Linux AMI-2018
3+
---
4+
bin_dir: null
5+
conf_dir: /etc/openvpn
6+
conf_ext: conf
7+
dh_files:
8+
- '512'
9+
dsaparam: false
10+
external_repo_enabled: true
11+
external_repo_supported: []
12+
external_repo_version: stable
13+
group: openvpn
14+
log_user: null
15+
manage_group: true
16+
manage_user: true
17+
multi_services: false
18+
network_manager_pkgs:
19+
- network-manager-openvpn
20+
- network-manager-openvpn-gnome
21+
pkgs:
22+
- openvpn
23+
- openssl
24+
service: openvpn
25+
service_function: running
26+
user: openvpn
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yamllint disable rule:indentation rule:line-length
2+
# CentOS-6
3+
---
4+
bin_dir: null
5+
conf_dir: /etc/openvpn
6+
conf_ext: conf
7+
dh_files:
8+
- '512'
9+
dsaparam: false
10+
external_repo_enabled: true
11+
external_repo_supported: []
12+
external_repo_version: stable
13+
group: openvpn
14+
log_user: null
15+
manage_group: true
16+
manage_user: true
17+
multi_services: false
18+
network_manager_pkgs:
19+
- network-manager-openvpn
20+
- network-manager-openvpn-gnome
21+
pkgs:
22+
- openvpn
23+
- openssl
24+
service: openvpn
25+
service_function: running
26+
user: openvpn

test/integration/default/files/_mapdata/oracle-7.yaml renamed to test/integration/default/files/_mapdata/oraclelinux-7.yaml

File renamed without changes.

test/integration/default/files/_mapdata/oracle-8.yaml renamed to test/integration/default/files/_mapdata/oraclelinux-8.yaml

File renamed without changes.

test/integration/default/files/_mapdata/windows-server-2019.yaml renamed to test/integration/default/files/_mapdata/windows-2019-server.yaml

File renamed without changes.

test/integration/share/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ Its goal is to share the libraries between all profiles.
1111
The `system` library provides easy access to system dependent information:
1212

1313
- `system.platform`: based on `inspec.platform`, modify to values that are more consistent from a SaltStack perspective
14-
- `system.platform[:family]` provide a family name for Arch
15-
- `system.platform[:name]` modify `amazon` to `amazonlinux`
16-
- `system.platform[:release]` tweak Arch and Amazon Linux:
14+
- `system.platform[:family]` provide a family name for Arch and Gentoo
15+
- `system.platform[:name]` append `linux` to both `amazon` and `oracle`; ensure Windows platforms are resolved as simply `windows`
16+
- `system.platform[:release]` tweak Arch, Amazon Linux, Gentoo and Windows:
1717
- `Arch` is always `base-latest`
1818
- `Amazon Linux` release `2018` is resolved as `1`
19+
- `Gentoo` release is trimmed to its major version number and then the init system is appended (i.e. `sysv` or `sysd`)
20+
- `Windows` uses the widely-used release number (e.g. `8.1` or `2019-server`) in place of the actual system release version
1921
- `system.platform[:finger]` is the concatenation of the name and the major release number (except for Ubuntu, which gives `ubuntu-20.04` for example)

test/integration/share/inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vim: ft=yaml
33
---
44
name: share
5-
title: openvpn formula
5+
title: InSpec shared resources
66
maintainer: SaltStack Formulas
77
license: Apache-2.0
88
summary: shared resources

test/integration/share/libraries/system.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,19 @@ def build_platform
2727

2828
def build_platform_family
2929
case inspec.platform[:name]
30-
when 'arch'
31-
'arch'
30+
when 'arch', 'gentoo'
31+
inspec.platform[:name]
3232
else
3333
inspec.platform[:family]
3434
end
3535
end
3636

3737
def build_platform_name
3838
case inspec.platform[:name]
39-
when 'amazon'
40-
'amazonlinux'
41-
when 'windows_8.1_pro'
39+
when 'amazon', 'oracle'
40+
"#{inspec.platform[:name]}linux"
41+
when 'windows_8.1_pro', 'windows_server_2019_datacenter'
4242
'windows'
43-
when 'windows_server_2019_datacenter'
44-
'windows-server'
4543
else
4644
inspec.platform[:name]
4745
end
@@ -60,7 +58,7 @@ def build_platform_release
6058
when 'windows_8.1_pro'
6159
'8.1'
6260
when 'windows_server_2019_datacenter'
63-
'2019'
61+
'2019-server'
6462
else
6563
inspec.platform[:release]
6664
end

0 commit comments

Comments
 (0)