-
Notifications
You must be signed in to change notification settings - Fork 66
/
pulp_scheduled_repo_spec.rb
87 lines (74 loc) · 2.27 KB
/
pulp_scheduled_repo_spec.rb
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
require 'spec_helper'
describe 'pulp::scheduled_repo' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
let :title do
'centos-7'
end
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to have_pulp_rpmrepo_resource_count(1) }
it { is_expected.to have_pulp_schedule_resource_count(1) }
it { is_expected.to contain_pulp_rpmrepo('centos-7') }
it { is_expected.to contain_pulp_schedule('centos-7').with_schedule_time('2000-01-01T22:38Z/P1D') }
end
context 'when repo_type is \'puppet\'' do
let :params do
{
repo_type: 'puppet'
}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to have_pulp_rpmrepo_resource_count(0) }
it { is_expected.to have_pulp_puppetrepo_resource_count(1) }
it { is_expected.to contain_pulp_puppetrepo('centos-7') }
end
context 'when repo_type is \'iso\'' do
let :params do
{
repo_type: 'iso'
}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to have_pulp_rpmrepo_resource_count(0) }
it { is_expected.to have_pulp_isorepo_resource_count(1) }
it { is_expected.to contain_pulp_isorepo('centos-7') }
end
context 'with custom schedule' do
let :params do
{
repo_schedule: '2019-01-01T00:42Z/P1D'
}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_pulp_schedule('centos-7').with_schedule_time('2019-01-01T00:42Z/P1D') }
end
context 'with valid repo_config set' do
let :params do
{
repo_config: {
'display_name' => 'CentOS 7 Base Repo',
'feed' => 'https://www.mirrorservice.org/sites/mirror.centos.org/7/os/x86_64'
}
}
end
it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_pulp_rpmrepo('centos-7').with(
'display_name' => 'CentOS 7 Base Repo',
'feed' => 'https://www.mirrorservice.org/sites/mirror.centos.org/7/os/x86_64'
)
}
end
context 'with invalid repo_config set' do
let :params do
{
repo_config: {
'no_such_parameter' => 'foo'
}
}
end
it { is_expected.to compile.and_raise_error(/no parameter named 'no_such_parameter'/) }
end
end