From 1ad296f011443a075b0ac19efc5e260f4ff6f33d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20B=C3=A9rtoli?= Date: Sun, 8 Aug 2021 16:42:47 -0300 Subject: [PATCH] Update inspec tests to manage RVM usage in different distros MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit refs #17990 Arvados-DCO-1.1-Signed-off-by: Javier Bértoli --- .../integration/api/controls/packages_spec.rb | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/test/integration/api/controls/packages_spec.rb b/test/integration/api/controls/packages_spec.rb index 804b274..969bf07 100644 --- a/test/integration/api/controls/packages_spec.rb +++ b/test/integration/api/controls/packages_spec.rb @@ -12,15 +12,7 @@ control 'arvados api package' do end end -control 'arvados cli gem' do - title 'should be installed' - - describe gem('arvados-cli') do - it { should be_installed } - end -end - -control 'RVM and dependencies' do +control 'RVM dependencies' do title 'should be installed' only_if("Forced requirement for RedHat's family") do @@ -46,8 +38,44 @@ control 'RVM and dependencies' do it { should be_installed } end end +end + +control 'RVM ruby manager' do + title 'should be installed' + + only_if('Forced requirement for Centos-7 and Ubuntu-18.04') do + (os.redhat? and platform[:release].to_f.truncate == 7) or + (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18) + end + describe command('/usr/local/rvm/bin/rvm list') do its(:exit_status) { should eq 0 } its('stdout') { should match(/ruby-2.7.2/) } end end + +control 'arvados cli gem' do + title 'should be installed' + + only_if('Skipped in Centos-7 and Ubuntu-18.04') do + !((os.redhat? and platform[:release].to_f.truncate == 7) or + (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18)) + end + + describe gem('arvados-cli') do + it { should be_installed } + end +end + +control 'RVM arvados cli gem' do + title 'should be installed' + + only_if('Forced requirement for Centos-7 and Ubuntu-18.04') do + (os.redhat? and platform[:release].to_f.truncate == 7) or + (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18) + end + + describe gem('arvados-cli', '/usr/local/rvm/bin/rvm all do gem') do + it { should be_installed } + end +end -- 2.30.2