From e7f10b6f40fd442df32ac177c34a617aee3fd6ea Mon Sep 17 00:00:00 2001 From: Jason St-Cyr Date: Tue, 27 Oct 2026 17:22:52 -0400 Subject: [PATCH] (TESTS-1330) Omit `Trusted` for deb822 sources when `allow_unsigned` is false Co-authored-by: Brian Witt --- manifests/source.pp | 2 +- spec/defines/source_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/manifests/source.pp b/manifests/source.pp index 05c6b07682..3c1393ffdd 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -346,7 +346,7 @@ 'enabled' => $enabled ? { true => 'yes', false => 'no' }, 'architectures' => $_architecture, 'allow_insecure' => $allow_insecure ? { true => 'yes', false => 'no', default => undef }, - 'repo_trusted' => $allow_unsigned ? { true => 'yes', false => 'no', default => undef }, + 'repo_trusted' => $allow_unsigned ? { true => 'yes', false => undef, default => undef }, 'check_valid_until' => $check_valid_until ? { true => 'yes', false => 'no', default => undef }, 'signed_by' => $keyring, } diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 4d18c7f157..824aee4642 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -580,6 +580,20 @@ it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Trusted: yes}) } end + context 'deb822 source with allow_unsigned false' do + let :params do + super().merge( + { + location: ['http://debian.mirror.iweb.ca/debian/'], + repos: ['main'], + allow_unsigned: false, + }, + ) + end + + it { is_expected.to contain_apt__setting("sources-#{title}").without_content(%r{Trusted:}) } + end + context '.list backwards compatibility' do let :params do super().merge(