forked from rplessl/puppet-influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfluxdb_install_spec.rb
More file actions
107 lines (102 loc) · 2.55 KB
/
influxdb_install_spec.rb
File metadata and controls
107 lines (102 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
require 'spec_helper'
describe 'influxdb::install', :type => :class do
it { should create_class('influxdb::install') }
# it { should contain_package('influxdb') }
context 'installing from a repository' do
let(:pre_condition) {
'class{"influxdb":
ensure => "installed",
install_from_repository => true,
}'
}
context 'on debian' do
let(:facts) {
{
:osfamily => 'Debian',
:architecture => 'x86_64',
}
}
it { should contain_package('influxdb').with(
:ensure => 'installed',
)}
end
context 'on redhat' do
let(:facts) {
{
:osfamily => 'RedHat',
:architecture => 'x86_64',
}
}
it { should contain_package('influxdb').with(
:ensure => 'installed',
)}
end
end
context 'installing from web' do
context 'with default preset url' do
let(:pre_condition) {
'class{"influxdb":
ensure => "installed",
install_from_repository => false,
}'
}
context 'on Debian' do
let(:facts) {
{
:osfamily => 'Debian',
:architecture => 'x86_64',
}
}
it { should contain_exec('influxdb_wget')
.with_command(/influxdb.s3.amazonaws/)
}
end
context 'on redhat' do
let(:facts) {
{
:osfamily => 'RedHat',
:architecture => 'x86_64',
}
}
context 'with default preset url' do
it { should contain_exec('influxdb_rpm')
.with_command(/influxdb.s3.amazonaws/)
}
end
end
end
context 'with download_url set' do
let(:pre_condition) {
'class{"influxdb":
ensure => "installed",
install_from_repository => false,
download_url => "https://download.test.com/proxy/influxdb/influxdb-1.0.0.rpm"
}'
}
context 'on Debian' do
let(:facts) {
{
:osfamily => 'Debian',
:architecture => 'x86_64',
}
}
it { should contain_exec('influxdb_wget')
.with_command(/download.test.com/)
}
end
context 'on redhat' do
let(:facts) {
{
:osfamily => 'RedHat',
:architecture => 'x86_64',
}
}
context 'with default preset url' do
it { should contain_exec('influxdb_rpm')
.with_command(/download.test.com/)
}
end
end
end
end
end