Browse Source

Fix failing unit tests

 * Fix Layout/MultilineOperationIndentation Rubocop issue
 * Set an upper version limit for metadata.json dependencies
 * Inline ignore wildcard regex line that's longer than 140 characters
 * Set rspec-mocks as default mocking framework as recommended by
   puppetlabs_spec_helper
master
Kim Hallen 2 months ago
parent
commit
a8ab075493
4 changed files with 11 additions and 6 deletions
  1. 2
    2
      files/dehydrated_job_runner.rb
  2. 4
    4
      metadata.json
  3. 3
    0
      spec/spec_helper.rb
  4. 2
    0
      types/wildcarddn.pp

+ 2
- 2
files/dehydrated_job_runner.rb View File

@@ -290,8 +290,8 @@ def handle_request(fqdn, dn, config)

if cert_still_valid(crt_file) && cert_still_valid(ca_file)
ocsp_uptodate = File.exist?(ocsp_file) &&
(File.mtime(ocsp_file) + 24 * 60 * 60) > Time.now &&
File.mtime(ocsp_file) > File.mtime(crt_file)
(File.mtime(ocsp_file) + 24 * 60 * 60) > Time.now &&
File.mtime(ocsp_file) > File.mtime(crt_file)
unless ocsp_uptodate
stdout, stderr, status = update_ocsp(ocsp_file, crt_file, ca_file)
return ['OCSP update failed', stdout, stderr, status] if status > 0

+ 4
- 4
metadata.json View File

@@ -10,19 +10,19 @@
"dependencies": [
{
"name": "puppetlabs-stdlib",
"version_requirement": ">= 4.25.1"
"version_requirement": ">= 4.25.1 < 7.0.0"
},
{
"name": "puppetlabs-concat",
"version_requirement": ">= 4.1.0"
"version_requirement": ">= 4.1.0 < 7.0.0"
},
{
"name": "puppetlabs-vcsrepo",
"version_requirement": ">= 2.3.0"
"version_requirement": ">= 2.3.0 < 4.0.0"
},
{
"name": "puppetlabs-cron_core",
"version_requirement": ">= 1.0.0"
"version_requirement": ">= 1.0.0 < 2.0.0"
}
],
"operatingsystem_support": [

+ 3
- 0
spec/spec_helper.rb View File

@@ -1,3 +1,6 @@
RSpec.configure do |c|
c.mock_with :rspec
end
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'


+ 2
- 0
types/wildcarddn.pp View File

@@ -1,2 +1,4 @@
# based on Stdlib::Fqdn
# lint:ignore:140chars
type Dehydrated::WildcardDN = Pattern[/^\*\.(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/]
# lint:endignore

Loading…
Cancel
Save