Skip to content

Conversation

@tenajsystems
Copy link
Contributor

This pull request adds an exec timeout for all the exec resources. The default timeout is 300 seconds and can be overwritten with the parameter exec_timeout(example: exec_timeout => 3600). This will resolve #17. Also, the issue #18 was fixed in this pull request so issue #18 can be closed: https://github.com/MiamiOH/puppet-duo_authproxy/pull/11. I also set the correct authproxy.cfg config file owner per the duo auth proxy documentation. In addition to adding the exec timeout parameter I also fixed some pdk validation issues for:

pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:33:9)
pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:34:12)
pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:36:9)
pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:37:12)
pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:39:9)
pdk (WARNING): puppet-lint: absolute class name reference (manifests/init.pp:40:12)

This pull request also fixes unit test for the config_spec.rb. Since you set the content as Sensitive, in the unit test, specifying an actual content causes the unit test to fail per pdk test unit --parallel. See below:

     Failure/Error:
       is_expected.to contain_file('authproxy.cfg').with(
         'ensure'  => 'file',
         'path'    => '/opt/duoauthproxy/conf/authproxy.cfg',
         'owner'   => 'duo_authproxy_svc',
         'group'   => 'root',
         'mode'    => '0400',
         'content' => "# Managed by Puppet.\n\n[main]\ndebug=true\n\n",
       )

       expected that the catalogue would contain File[authproxy.cfg] with content set to supplied string
       Diff:
       @@ -1,5 +1,2 @@
       -# Managed by Puppet.
       -
       -[main]
       -debug=true
       +Sensitive [value redacted]

Lastly, I also fixed some deprecation warnings as well. See below:

puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you

All pdk validation and unit tests passes with no issues now.

pdk (INFO): Using Ruby 2.7.2s .......
pdk (INFO): Using Puppet 7.5.0st syntax (**/*.pp).son).
pdk (INFO): Running all available validators...a.json).
pdk (INFO): Validator 'puppet-epp' skipped for '/home/tenajsystems/puppet-duo_authproxy'. No files matching '["**/*.epp"]' found to validate.
pdk (INFO): Validator 'task-name' skipped for '/home/tenajsystems/puppet-duo_authproxy'. No files matching '["tasks/**/*"]' found to validate.
pdk (INFO): Validator 'task-metadata-lint' skipped for '/home/tenajsystems/puppet-duo_authproxy'. No files matching '["tasks/*.json"]' found to validate.
┌ [✔] Running metadata validators ...
├── [✔] Checking metadata syntax (metadata.json tasks/*.json).
└── [✔] Checking module metadata style (metadata.json).
┌ [✔] Running puppet validators ...
├── [✔] Checking Puppet manifest syntax (**/*.pp).
└── [✔] Checking Puppet manifest style (**/*.pp).
┌ [✔] Running ruby validators ...
└── [✔] Checking Ruby code style (**/**.rb).
┌ [✔] Running tasks validators ...
├── [✔] Checking task names (tasks/**/*).
└── [✔] Checking task metadata style (tasks/*.json).
┌ [✔] Running yaml validators ...
└── [✔] Checking YAML syntax (**/*.yaml **/*.yml).

root@tenajsystems:/home/tenajsystems/puppet-duo_authproxy# pdk test unit --parallel
pdk (INFO): Using Ruby 2.7.2
pdk (INFO): Using Puppet 7.5.0
[✔] Preparing to run the unit tests.
4 processes for 4 specs, ~ 1 specs per process
Run options: exclude {:bolt=>true}
Run options: exclude {:bolt=>true}
Run options: exclude {:bolt=>true}
Run options: exclude {:bolt=>true}
.......................................................................

Finished in 9.27 seconds (files took 7.26 seconds to load)
8 examples, 0 failures

..

Finished in 9.12 seconds (files took 7.42 seconds to load)
16 examples, 0 failures

..

Finished in 9.37 seconds (files took 7.27 seconds to load)
16 examples, 0 failures

.....

Finished in 9.51 seconds (files took 7.28 seconds to load)
40 examples, 0 failures


80 examples, 0 failures

Took 17 seconds

Let me know if you have any questions.

@tenajsystems
Copy link
Contributor Author

@edestecd Any thoughts on when this pull request would be merged? New versions of the Duo Auth proxy compilation seems to be taking more than the 5 min timeout value for the exec resource which this pull request fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant