969bf0752f16052d8ac2d5c28d68cd163a2ed002
[arvados-formula.git] / test / integration / api / controls / packages_spec.rb
1 # frozen_string_literal: true
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 control 'arvados api package' do
8   title 'should be installed'
9
10   describe package('arvados-api-server') do
11     it { should be_installed }
12   end
13 end
14
15 control 'RVM dependencies' do
16   title 'should be installed'
17
18   only_if("Forced requirement for RedHat's family") do
19     os.redhat?
20   end
21
22   %w[
23     centos-release-scl
24     curl
25     gcc
26     git
27     libcurl
28     libcurl-devel
29     libxml2
30     libxml2-devel
31     make
32     pam-devel
33     postgresql12-libs
34     python3-devel
35     zlib-devel
36   ].each do |p|
37     describe package(p) do
38       it { should be_installed }
39     end
40   end
41 end
42
43 control 'RVM ruby manager' do
44   title 'should be installed'
45
46   only_if('Forced requirement for Centos-7 and Ubuntu-18.04') do
47     (os.redhat? and platform[:release].to_f.truncate == 7) or
48       (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18)
49   end
50
51   describe command('/usr/local/rvm/bin/rvm list') do
52     its(:exit_status) { should eq 0 }
53     its('stdout') { should match(/ruby-2.7.2/) }
54   end
55 end
56
57 control 'arvados cli gem' do
58   title 'should be installed'
59
60   only_if('Skipped in Centos-7 and Ubuntu-18.04') do
61     !((os.redhat? and platform[:release].to_f.truncate == 7) or
62     (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18))
63   end
64
65   describe gem('arvados-cli') do
66     it { should be_installed }
67   end
68 end
69
70 control 'RVM arvados cli gem' do
71   title 'should be installed'
72
73   only_if('Forced requirement for Centos-7 and Ubuntu-18.04') do
74     (os.redhat? and platform[:release].to_f.truncate == 7) or
75       (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18)
76   end
77
78   describe gem('arvados-cli', '/usr/local/rvm/bin/rvm all do gem') do
79     it { should be_installed }
80   end
81 end