Git Product home page Git Product logo

Comments (8)

vrbcntrl avatar vrbcntrl commented on May 23, 2024 1

Thank you so much @eerkunt .
I have tested the above BDD with v 1.0.7 and both positive and negatives tests are working as expected.
I also tested the use case mentioned in #93 and it is also working fine.

Thanks again!

from cli.

eerkunt avatar eerkunt commented on May 23, 2024

Thanks for reporting @vrbcntrl. The problem is due to inline configuration in terraform. Unfortunately, inline configuration is not supported, since it may vary a lot!

This feature might be supported after having #72 and #66.

from cli.

vrbcntrl avatar vrbcntrl commented on May 23, 2024

Thank you @eerkunt for the response. I'll wait for the update from you then :)

from cli.

eerkunt avatar eerkunt commented on May 23, 2024

This should be fixed in 1.0.0. Please let us know if it doesn't work for you.

from cli.

vrbcntrl avatar vrbcntrl commented on May 23, 2024

Hi @eerkunt ,

I have again tested this use case with 1.0.4, unfortunately it still throws me a different error now

Scenario: AWS EMR Encryption at Rest Given I have aws_emr_security_configuration defined When it contains configuration Then encryption must be enabled KeyError: 'type'

Please find my tf template, out file and the results in the attachments.
In this case also, I have 2 encryption properties that I want to test, but I suppose I cant use the above scenario, so I have also tried the scenario outline just like I have tried in #93 but that also throws me error...

aws_emr_security_configuration.zip
AWS_EMR_Encryption_at_rest Test Results

from cli.

eerkunt avatar eerkunt commented on May 23, 2024

Thanks for trying it again. #101 introduces a fix and enhancement on these kind of conditions. Now we support heredoc json strings. Please have a try with 1.0.5 and let me know if it doesn't work for you ?

from cli.

vrbcntrl avatar vrbcntrl commented on May 23, 2024

Thanks @eerkunt for fixing the issue. The new version 1.0.5 works fine if I wanted to test a single encryption property i.e 'aws_emr_security_configuration': 'EnableAtRestEncryption' because this is configure in init.py , however I have 2 encryption properties in the same json as shown below
"EnableInTransitEncryption": false, "EnableAtRestEncryption": false

so I tried to test them using the same technique used for #93 , however it didn't work :(

` Scenario Ouline: AWS EMR Encryption at Rest
Given I have aws_emr_security_configuration defined
When it contains configuration
Then it must contain

Examples:
| encryption |
| EnableInTransitEncryption |
| EnableAtRestEncryption |`

I got the below error:

`Error Oracle says:
There is no step defintion for 'Then it must contain '.
All steps should be declared in a module located in c:\users\vrb.cntrl\appdata\local\programs\python\python37\lib\site-packages\terraform_compliance\steps.
For example you could do:

@step(r"Then it must contain ")
def my_step(step):
raise NotImplementedError("This step is not implemented yet")`

so, if you could let me know how to test the 2 or 3 related properties in the same resource, that would be really helpful...thanks in advance!

from cli.

eerkunt avatar eerkunt commented on May 23, 2024

There are multiple problems here.

  1. Your BDD test is wrong, there are both some typos and it s not structured correctly. I think you are trying to achieve this ;
  Scenario Outline: AWS EMR Encryption at Rest and In-Flight
    Given I have aws_emr_security_configuration defined
    When it contains configuration
    Then it must contain <encryption>
    Then its value must match the "<value>" regex

    Examples:
      | encryption                | value |
      | EnableInTransitEncryption | true  |
      | EnableAtRestEncryption    | true  |
  1. There was a case where Boolean values were not checked on Then its value must match the "<value>" regex step. It is not fixed on #103.

Could you please try with 1.0.6 and the BDD test above together ?

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.