-
Notifications
You must be signed in to change notification settings - Fork 683
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
Deprecation of array matcher #738
Comments
Let's add a solution to test either all or at least one item in a list: Describe at least one item from the list, for which the following condition succeeds: describe.one auditd_rules.LIST_RULES do
it { should match /^exit,always watch=\/etc\/group perm=wa key=identity/ }
end Describe all items from a list and make sure they pass the test: describe.all passwd.users do
it { should_not be_empty }
end Let's think some more on duplicate checking. It may end up sticking with the matcher, but i feel there may also be a different pattern... |
Did you come up with a replacement for |
The documentation for the auditd_rules resource recommends using 'contain_match' as the preferred way of matching lines for audit >= 2.3. If 'contain_match' is being deprecated, what is the preferred method for matching lines with audit >= 2.3? Also, noticed that using 'contain_match' with the auditd_rules always returns success when matching a rule, even if the rule doesn't match (this is using inspec 1.7.2). Example provided in resource documentation: describe auditd_rules do
its('lines') { should contain_match(%r{-w /etc/ssh/sshd_config/}) }
end |
I am in the same boat as qvallance-ctc . Whats my alternative ? control 'check-passwd-duplicates' do |
@chris-rock @arlimus As of v1.19.2 I am still getting depreciation warnings:
Error:
|
Description
We should use plain Ruby mechanism instead of re-inventing the wheel. RSpec matchers have the disadvantage that they split up the implementation (resource + matcher). Instead the goal is to cover the use case without requiring matchers. Therefore we will deprecate 3 matcher:
contain_duplicates
contain_match
contain_legacy_plus
InSpec and Platform Version
0.20.1
Replication Case
Case 1: contain_match
Case 2: contain_duplicates
Case 3: contain_legacy_plus
Possible Solutions
We need a way to iterate over an array and use basic matchers or Ruby logic to do tests. One example could be:
Case 1: contain_match
Case 2: contain_duplicates
Case 3: contain_legacy_plus
The text was updated successfully, but these errors were encountered: