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

Testing of set_config_file function with BATS 2 #4659

Merged

Conversation

matejak
Copy link
Member

@matejak matejak commented Jul 26, 2019

This PR is a successor to #4656

Differences:

  • The cmake setup is simpler, analogous to e.g. linkchecker setup.
  • The test that fails has been removed, so the PR can be merged. Another tests can be added later.

@matejak matejak added the Bash Bash remediation update. label Jul 26, 2019
@matejak matejak added this to the 0.1.46 milestone Jul 26, 2019
@mildas
Copy link
Contributor

mildas commented Jul 26, 2019

@matejak I forgot commit 1 small fix for set_config_file which probably causes failing of that one test scenario.
The problem is here. lineinfile_absent function is called with 3 arguments, so there's no 8th argument. The change should be easy "${8:-true}" -> "${3:-true}". Can you please try it, if with this change the test will pass so we can use it? (sorry, I can't push commit now, otherwise I'd create PR with fix)

@matejak
Copy link
Member Author

matejak commented Jul 26, 2019

@mildas Great point, I have added that fix to the PR.

@ggbecker ggbecker self-assigned this Jul 29, 2019
@matejak matejak force-pushed the mildas_set_config_file_testing branch from 036494e to bf0f877 Compare July 29, 2019 11:46
@matejak
Copy link
Member Author

matejak commented Jul 29, 2019

Seems to work:

       Start  60: bash-unit-tests
59/308 Test  #60: bash-unit-tests ...........................................................   Passed    0.36 sec

@matejak matejak force-pushed the mildas_set_config_file_testing branch from bf0f877 to 9430298 Compare July 29, 2019 15:28
@ggbecker
Copy link
Member

LGTM, thanks for the patch.

@ggbecker ggbecker merged commit b412ee0 into ComplianceAsCode:master Jul 30, 2019
@matejak matejak deleted the mildas_set_config_file_testing branch August 8, 2019 11:36
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants