X-Git-Url: https://git.arvados.org/arvados-formula.git/blobdiff_plain/06050e0a5377d3d6a4c54c7f50fe53a06a07c837..HEAD:/test/integration/repo/controls/repo_spec.rb diff --git a/test/integration/repo/controls/repo_spec.rb b/test/integration/repo/controls/repo_spec.rb index 27cf73f..49078c6 100644 --- a/test/integration/repo/controls/repo_spec.rb +++ b/test/integration/repo/controls/repo_spec.rb @@ -1,12 +1,45 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + # frozen_string_literal: true case os[:name] when 'centos' repo_file = '/etc/yum.repos.d/arvados.repo' repo_url = 'baseurl=http://rpm.arvados.org/CentOS/$releasever/os/$basearch/' -when 'debian' +when 'debian', 'ubuntu' + # Inspec does not provide a `codename` matcher, so we add ours + case platform[:release].to_f.truncate + # ubuntu + when 18 + codename = 'bionic' + when 20 + codename = 'focal' + # debian + when 10 + codename = 'buster' + when 11 + codename = 'bullseye' + end repo_file = '/etc/apt/sources.list.d/arvados.list' - repo_url = 'deb http://apt.arvados.org buster main' + repo_keyring = '/usr/share/keyrings/arvados-archive-keyring.gpg' + repo_url = "deb [signed-by=/usr/share/keyrings/arvados-archive-keyring.gpg arch=amd64] http://apt.arvados.org/#{codename} #{codename} main" +end + +control 'arvados repository keyring' do + title 'should be installed' + + only_if('Requirement for Debian family') do + platform.family == 'debian' + end + + describe file(repo_keyring) do + it { should exist } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } + its('mode') { should cmp '0644' } + end end control 'arvados repository' do @@ -14,6 +47,6 @@ control 'arvados repository' do title 'should be configured' desc 'Ensures arvados source is correctly configured' describe file(repo_file) do - its('content') { should match repo_url } + its('content') { should include repo_url } end end