Skip to content

Commit bad9b9e

Browse files
authored
Merge pull request #501 from puppetlabs/CAT-270-Troubleshooting_pdk_integration_tests
(CAT-270) Adjusting tests for pdk integration testing
2 parents 6416e0b + 33d8863 commit bad9b9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/classes/motd_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
it do
4545
expect(subject).to contain_File('/etc/motd').with(
4646
ensure: 'file', backup: 'false',
47-
content: "RedHat 9.0 x86_64\n\nFQDN: foo.example.com (10.109.1.2)\nProcessor: Intel Xeon Processor (Cascadelake)\nKernel: Linux\nMemory Size: 3.10 GiB\n",
47+
# The following Regex checks for the matching content in this comment and allows for two different IP values to be matched after foo.example.com. This is a workaround to ensure that PDK
48+
# integration testing passes while the MOTD unit tests dont break. The string we are looking for is:
49+
# "RedHat 9.0 x86_64\n\nFQDN: foo.example.com (172.16.254.254 OR 10.109.1.2)\nProcessor: Intel Xeon Processor (Cascadelake)\nKernel: Linux\nMemory Size: 3.10 GiB\n",
50+
content: %r{RedHat\s9\.0\sx86_64\n\nFQDN:\s*foo.example.com\s\((172\.16\.254\.254|10\.109\.1\.2)\)\nProcessor:\s*Intel\sXeon\sProcessor\s\(Cascadelake\)\nKernel:\s*Linux\nMemory\sSize:\s*3.10\sGiB}, # rubocop:disable Layout/LineLength
4851
owner: 'root', group: 'root', mode: '0644'
4952
)
5053
end
@@ -200,7 +203,10 @@
200203
expect(subject).to contain_Registry_value('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system\legalnoticetext').with(
201204
ensure: 'present',
202205
type: 'string',
203-
data: "windows 10 x64\n\nFQDN: foo.example.com (10.138.1.5)\nProcessor: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz\nKernel: windows\nMemory Size: 14.34 GiB\n",
206+
# The following Regex checks for the matching content in this comment and allows for two different IP values to be matched after foo.example.com. This is a workaround to ensure that PDK
207+
# integration testing passes while the MOTD unit tests dont break. The string we are looking for is:
208+
# "windows 10 x64\n\nFQDN: foo.example.com (172.16.254.254)\nProcessor: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz\nKernel: windows\nMemory Size: 14.34 GiB\n",
209+
data: %r{windows\s10\sx64\n\nFQDN:\s*foo.example.com\s\((172\.16\.254\.254|10\.138\.1\.5)\)\nProcessor:\s*Intel\(R\)\sXeon\(R\)\sPlatinum\s8272CL\sCPU\s@\s2\.60GHz\nKernel:\s*windows\nMemory\sSize:\s*14\.34\sGiB}, # rubocop:disable Layout/LineLength
204210
)
205211
end
206212
end

0 commit comments

Comments
 (0)