|
19 | 19 | allow(Puppet::FileSystem).to receive(:exist?).and_call_original
|
20 | 20 | allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
|
21 | 21 | allow(Puppet::FileSystem).to receive(:exist?).with('/opt/puppetlabs/puppet/VERSION').and_return true
|
22 |
| - allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).with('/opt/puppetlabs/puppet/VERSION').and_return "5.10.200\n" |
23 | 22 | end
|
24 | 23 |
|
25 | 24 | shared_examples 'aix' do |aixver, pkg_aixver, powerver|
|
|
61 | 60 | let(:facts) do
|
62 | 61 | common_facts.merge({
|
63 | 62 | architecture: 'PowerPC_POWER8',
|
64 |
| - platform_tag: 'aix-6.1-power', |
| 63 | + platform_tag: 'aix-7.1-power', |
65 | 64 | })
|
66 | 65 | end
|
67 | 66 | let(:params) do
|
68 | 67 | {
|
69 |
| - package_version: '5.10.100.1', |
70 |
| - collection: 'puppet5', |
| 68 | + package_version: '7.10.100.1', |
| 69 | + collection: 'puppet7', |
71 | 70 | source: 'https://fake-pe-master.com',
|
72 | 71 | }
|
73 | 72 | end
|
|
77 | 76 | end
|
78 | 77 |
|
79 | 78 | it {
|
80 |
| - is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.100.1-1.aix7.1.ppc.rpm').with_source('https://fake-pe-master.com/packages/2000.0.0/aix-7.1-power/puppet-agent-5.10.100.1-1.aix7.1.ppc.rpm') |
| 79 | + is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-7.10.100.1-1.aix7.1.ppc.rpm').with_source('https://fake-pe-master.com/packages/2000.0.0/aix-7.1-power/puppet-agent-7.10.100.1-1.aix7.1.ppc.rpm') |
81 | 80 | }
|
82 | 81 | end
|
83 | 82 |
|
84 |
| - context 'with a PC1 collection' do |
85 |
| - let(:params) do |
86 |
| - { |
87 |
| - package_version: '1.10.100', |
88 |
| - collection: 'PC1', |
89 |
| - } |
90 |
| - end |
91 |
| - |
92 |
| - [['7.2', '7.1', '8'], ['7.1', '7.1', '8'], ['7.1', '7.1', '7'], ['6.1', '6.1', '7']].each do |aixver, pkg_aixver, powerver| |
93 |
| - context "aix #{aixver}" do |
94 |
| - include_examples 'aix', aixver, pkg_aixver, powerver |
95 |
| - end |
96 |
| - end |
97 |
| - end |
98 |
| - |
99 |
| - context 'with a puppet5 collection' do |
100 |
| - context 'with versions up to 5.5.22' do |
101 |
| - let(:params) do |
102 |
| - { |
103 |
| - package_version: '5.4.3', |
104 |
| - collection: 'puppet5', |
105 |
| - } |
106 |
| - end |
107 |
| - |
108 |
| - [['7.2', '7.1', '8'], ['7.1', '7.1', '8'], ['7.1', '7.1', '7'], ['6.1', '6.1', '7']].each do |aixver, pkg_aixver, powerver| |
109 |
| - context "aix #{aixver}" do |
110 |
| - include_examples 'aix', aixver, pkg_aixver, powerver |
111 |
| - end |
112 |
| - end |
113 |
| - end |
114 |
| - |
115 |
| - context 'with versions higher than 5.5.22' do |
116 |
| - let(:params) do |
117 |
| - { |
118 |
| - package_version: '5.5.23', |
119 |
| - collection: 'puppet5', |
120 |
| - } |
121 |
| - end |
122 |
| - |
123 |
| - [['7.2', '7.1', '8'], ['7.1', '7.1', '8'], ['7.1', '7.1', '7'], ['6.1', '7.1', '7']].each do |aixver, pkg_aixver, powerver| |
124 |
| - context "aix #{aixver}" do |
125 |
| - include_examples 'aix', aixver, pkg_aixver, powerver |
126 |
| - end |
127 |
| - end |
128 |
| - end |
129 |
| - end |
130 |
| - |
131 | 83 | context 'with a puppet6 collection' do
|
132 | 84 | context 'with versions up to 6.19.1' do
|
133 | 85 | let(:params) do
|
|
177 | 129 | end
|
178 | 130 | end
|
179 | 131 |
|
| 132 | + context 'with a puppet8 collection' do |
| 133 | + context 'with versions greater than or equal to 8.0.0' do |
| 134 | + let(:params) do |
| 135 | + { |
| 136 | + package_version: '8.0.0', |
| 137 | + collection: 'puppet8', |
| 138 | + } |
| 139 | + end |
| 140 | + |
| 141 | + [['7.2', '7.2', '7']].each do |aixver, pkg_aixver, powerver| |
| 142 | + context "aix #{aixver}" do |
| 143 | + include_examples 'aix', aixver, pkg_aixver, powerver |
| 144 | + end |
| 145 | + end |
| 146 | + end |
| 147 | + end |
| 148 | + |
180 | 149 | context 'with package_version auto' do
|
181 | 150 | let(:params) do
|
182 | 151 | {
|
|
185 | 154 | end
|
186 | 155 | let(:facts) do
|
187 | 156 | common_facts.merge({
|
188 |
| - serverversion: '5.10.200' |
| 157 | + serverversion: '7.10.200' |
189 | 158 | })
|
190 | 159 | end
|
191 |
| - let(:rpmname) { 'puppet-agent-5.10.200-1.aix7.1.ppc.rpm' } |
| 160 | + let(:rpmname) { 'puppet-agent-7.10.200-1.aix7.1.ppc.rpm' } |
| 161 | + |
| 162 | + before(:each) do |
| 163 | + allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).with('/opt/puppetlabs/puppet/VERSION').and_return "7.10.200\n" |
| 164 | + end |
192 | 165 |
|
193 | 166 | it {
|
194 | 167 | is_expected.to contain_package('puppet-agent')
|
195 | 168 | .with({
|
196 | 169 | 'source' => "/opt/puppetlabs/packages/#{rpmname}",
|
197 |
| - 'ensure' => '5.10.200', |
| 170 | + 'ensure' => '7.10.200', |
198 | 171 | 'provider' => 'rpm',
|
199 | 172 | })
|
200 | 173 | }
|
|
0 commit comments