diff --git a/CODEOWNERS b/CODEOWNERS index 723b37d..083ac56 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -15,8 +15,11 @@ /docs/AUTHORS.rst @saltstack-formulas/ssf /docs/CHANGELOG.rst @saltstack-formulas/ssf /docs/TOFS_pattern.rst @saltstack-formulas/ssf +/*/_mapdata/ @saltstack-formulas/ssf /*/libsaltcli.jinja @saltstack-formulas/ssf /*/libtofs.jinja @saltstack-formulas/ssf +/test/integration/**/_mapdata_spec.rb @saltstack-formulas/ssf +/test/integration/**/libraries/system.rb @saltstack-formulas/ssf /test/integration/**/inspec.yml @saltstack-formulas/ssf /test/integration/**/README.md @saltstack-formulas/ssf /.gitignore @saltstack-formulas/ssf diff --git a/test/integration/default/files/_mapdata/amazonlinux-1.yaml b/test/integration/default/files/_mapdata/amazonlinux-1.yaml new file mode 100644 index 0000000..2e399d4 --- /dev/null +++ b/test/integration/default/files/_mapdata/amazonlinux-1.yaml @@ -0,0 +1,26 @@ +# yamllint disable rule:indentation rule:line-length +# Amazon Linux AMI-2018 +--- +bin_dir: null +conf_dir: /etc/openvpn +conf_ext: conf +dh_files: +- '512' +dsaparam: false +external_repo_enabled: true +external_repo_supported: [] +external_repo_version: stable +group: openvpn +log_user: null +manage_group: true +manage_user: true +multi_services: false +network_manager_pkgs: +- network-manager-openvpn +- network-manager-openvpn-gnome +pkgs: +- openvpn +- openssl +service: openvpn +service_function: running +user: openvpn diff --git a/test/integration/default/files/_mapdata/centos-6.yaml b/test/integration/default/files/_mapdata/centos-6.yaml new file mode 100644 index 0000000..d6eba42 --- /dev/null +++ b/test/integration/default/files/_mapdata/centos-6.yaml @@ -0,0 +1,26 @@ +# yamllint disable rule:indentation rule:line-length +# CentOS-6 +--- +bin_dir: null +conf_dir: /etc/openvpn +conf_ext: conf +dh_files: +- '512' +dsaparam: false +external_repo_enabled: true +external_repo_supported: [] +external_repo_version: stable +group: openvpn +log_user: null +manage_group: true +manage_user: true +multi_services: false +network_manager_pkgs: +- network-manager-openvpn +- network-manager-openvpn-gnome +pkgs: +- openvpn +- openssl +service: openvpn +service_function: running +user: openvpn diff --git a/test/integration/default/files/_mapdata/oracle-7.yaml b/test/integration/default/files/_mapdata/oraclelinux-7.yaml similarity index 100% rename from test/integration/default/files/_mapdata/oracle-7.yaml rename to test/integration/default/files/_mapdata/oraclelinux-7.yaml diff --git a/test/integration/default/files/_mapdata/oracle-8.yaml b/test/integration/default/files/_mapdata/oraclelinux-8.yaml similarity index 100% rename from test/integration/default/files/_mapdata/oracle-8.yaml rename to test/integration/default/files/_mapdata/oraclelinux-8.yaml diff --git a/test/integration/default/files/_mapdata/windows-server-2019.yaml b/test/integration/default/files/_mapdata/windows-2019-server.yaml similarity index 100% rename from test/integration/default/files/_mapdata/windows-server-2019.yaml rename to test/integration/default/files/_mapdata/windows-2019-server.yaml diff --git a/test/integration/share/README.md b/test/integration/share/README.md index 7de80b2..5bc510c 100644 --- a/test/integration/share/README.md +++ b/test/integration/share/README.md @@ -11,9 +11,11 @@ Its goal is to share the libraries between all profiles. The `system` library provides easy access to system dependent information: - `system.platform`: based on `inspec.platform`, modify to values that are more consistent from a SaltStack perspective - - `system.platform[:family]` provide a family name for Arch - - `system.platform[:name]` modify `amazon` to `amazonlinux` - - `system.platform[:release]` tweak Arch and Amazon Linux: + - `system.platform[:family]` provide a family name for Arch and Gentoo + - `system.platform[:name]` append `linux` to both `amazon` and `oracle`; ensure Windows platforms are resolved as simply `windows` + - `system.platform[:release]` tweak Arch, Amazon Linux, Gentoo and Windows: - `Arch` is always `base-latest` - `Amazon Linux` release `2018` is resolved as `1` + - `Gentoo` release is trimmed to its major version number and then the init system is appended (i.e. `sysv` or `sysd`) + - `Windows` uses the widely-used release number (e.g. `8.1` or `2019-server`) in place of the actual system release version - `system.platform[:finger]` is the concatenation of the name and the major release number (except for Ubuntu, which gives `ubuntu-20.04` for example) diff --git a/test/integration/share/inspec.yml b/test/integration/share/inspec.yml index add5342..697417a 100644 --- a/test/integration/share/inspec.yml +++ b/test/integration/share/inspec.yml @@ -2,7 +2,7 @@ # vim: ft=yaml --- name: share -title: openvpn formula +title: InSpec shared resources maintainer: SaltStack Formulas license: Apache-2.0 summary: shared resources diff --git a/test/integration/share/libraries/system.rb b/test/integration/share/libraries/system.rb index 91ebbc8..ef23499 100644 --- a/test/integration/share/libraries/system.rb +++ b/test/integration/share/libraries/system.rb @@ -27,8 +27,8 @@ def build_platform def build_platform_family case inspec.platform[:name] - when 'arch' - 'arch' + when 'arch', 'gentoo' + inspec.platform[:name] else inspec.platform[:family] end @@ -36,12 +36,10 @@ def build_platform_family def build_platform_name case inspec.platform[:name] - when 'amazon' - 'amazonlinux' - when 'windows_8.1_pro' + when 'amazon', 'oracle' + "#{inspec.platform[:name]}linux" + when 'windows_8.1_pro', 'windows_server_2019_datacenter' 'windows' - when 'windows_server_2019_datacenter' - 'windows-server' else inspec.platform[:name] end @@ -60,7 +58,7 @@ def build_platform_release when 'windows_8.1_pro' '8.1' when 'windows_server_2019_datacenter' - '2019' + '2019-server' else inspec.platform[:release] end