Merge branch '18642-don-t-install-ruby-bundler'
[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 'ruby bundler package' do
8   title 'should not be installed'
9
10   describe package('ruby-bundler') do
11     it { should_not be_installed }
12   end
13   describe package('bundler') do
14     it { should_not be_installed }
15   end
16 end
17
18 control 'arvados api package' do
19   title 'should be installed'
20
21   describe package('arvados-api-server') do
22     it { should be_installed }
23   end
24 end
25
26 control 'RVM dependencies' do
27   title 'should be installed'
28
29   only_if("Forced requirement for RedHat's family") do
30     os.redhat?
31   end
32
33   %w[
34     centos-release-scl
35     curl
36     gcc
37     git
38     libcurl
39     libcurl-devel
40     libxml2
41     libxml2-devel
42     make
43     pam-devel
44     postgresql12-libs
45     python3-devel
46     zlib-devel
47   ].each do |p|
48     describe package(p) do
49       it { should be_installed }
50     end
51   end
52 end
53
54 control 'RVM ruby manager' do
55   title 'should be installed'
56
57   only_if('Forced requirement for Centos-7, Ubuntu-18.04 and Debian-10') do
58     (os.redhat? and platform[:release].to_f.truncate == 7) or
59       (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18) or
60       (os.name == 'debian' and platform[:release].to_f.truncate == 10)
61   end
62
63   describe command('/usr/local/rvm/bin/rvm list') do
64     its(:exit_status) { should eq 0 }
65     its('stdout') { should match(/ruby-2.7.2/) }
66   end
67 end
68
69 control 'arvados cli gem' do
70   title 'should be installed'
71
72   only_if('Skipped in Centos-7, Ubuntu-18.04 and Debian-10') do
73     !((os.redhat? and platform[:release].to_f.truncate == 7) or
74     (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18) or
75     (os.name == 'debian' and platform[:release].to_f.truncate == 10))
76   end
77
78   describe gem('arvados-cli') do
79     it { should be_installed }
80   end
81 end
82
83 control 'RVM arvados cli gem' do
84   title 'should be installed'
85
86   only_if('Forced requirement for Centos-7, Ubuntu-18.04 and Debian-10') do
87     (os.redhat? and platform[:release].to_f.truncate == 7) or
88       (os.name == 'ubuntu' and platform[:release].to_f.truncate == 18) or
89       (os.name == 'debian' and platform[:release].to_f.truncate == 10)
90   end
91
92   describe gem('arvados-cli', '/usr/local/rvm/bin/rvm all do gem') do
93     it { should be_installed }
94   end
95 end