Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manage_file_capabilities #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

b3n4kh
Copy link

@b3n4kh b3n4kh commented May 25, 2020

SUMMARY

Fixes a bug where manage_file_capabilities is true and $::vault::package_name is custom name (not 'vault')

TESTS/SPECS

I would like to add a spec test for this, but I would need to host a repository with a different package name. If anyone has a suggestions on how to mock that?
Rest would be smth like:

        context 'when installed from package repository with managed_capability' do
          let(:params) do
            {
              install_method: 'repo',
              package_name: 'vault-private',
              package_ensure: 'installed',
              manage_file_capabilities: true
            }
          end

          it { is_expected.to contain_package('vault') }
          it { is_expected.to contain_file_capability('vault_binary_capability') }

Fixes a bug where manage_file_capabilities is true and $::vault::package_name is custom name (not 'vault')
Copy link
Owner

@jsok jsok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be any need to setup a real package repository to write a spec for this.
See

context 'when installed from package repository' do
let(:params) do
{
install_method: 'repo',
package_name: 'vault',
package_ensure: 'installed'
}
end
it { is_expected.to contain_package('vault') }
it { is_expected.not_to contain_file_capability('vault_binary_capability') }
context 'when managing file capabilities' do
let(:params) do
super().merge(
manage_file_capabilities: true,
)
end
it { is_expected.to contain_file_capability('vault_binary_capability') }
it { is_expected.to contain_package('vault').that_notifies(['File_capability[vault_binary_capability]']) }
end
end
for how it's currently done, it should only require a small modification to verify this change.

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.

2 participants