From 7bba14a61cc0dce496ecda075726bf93c4c8812d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Fri, 4 Feb 2022 20:13:51 -0300 Subject: [PATCH] fix(opensuse): fix repo key parameter Also, fix tests for the different RedHat's family members --- postgres/osfamilymap.yaml | 2 +- test/integration/repo/controls/repository.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/postgres/osfamilymap.yaml b/postgres/osfamilymap.yaml index 47033fcd..f4e64c24 100644 --- a/postgres/osfamilymap.yaml +++ b/postgres/osfamilymap.yaml @@ -145,7 +145,7 @@ Suse: humanname: PostgreSQL {{ repo.version }} $releasever - $basearch # works for postgres 11 onwards baseurl: 'https://download.postgresql.org/pub/repos/zypp/{{ repo.version }}/suse/sles-$releasever-$basearch' - key_url: 'https://download.postgresql.org/pub/repos/zypp/{{ repo.version }}/suse/sles-$releasever-$basearch/repodata/repomd.xml.key' + gpgkey: 'https://download.postgresql.org/pub/repos/zypp/{{ repo.version }}/suse/sles-$releasever-$basearch/repodata/repomd.xml.key' gpgcheck: 1 gpgautoimport: True diff --git a/test/integration/repo/controls/repository.rb b/test/integration/repo/controls/repository.rb index e1875b58..ded44b31 100644 --- a/test/integration/repo/controls/repository.rb +++ b/test/integration/repo/controls/repository.rb @@ -1,9 +1,15 @@ # frozen_string_literal: true case platform.family -when 'redhat' +when 'redhat', 'fedora' repo_file = '/etc/yum.repos.d/pgdg13.repo' - repo_url = 'https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-$releasever-$basearch' + os_name_repo_url = { + 'amazon' => 'https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-7-$basearch', + 'fedora' => 'https://download.postgresql.org/pub/repos/yum/13/fedora/fedora-$releasever-$basearch', + 'default' => 'https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-$releasever-$basearch' + } + repo_url = os_name_repo_url[platform.name] + when 'debian' # Inspec does not provide a `codename` matcher, so we add ours finger_codename = {