-
Notifications
You must be signed in to change notification settings - Fork 150
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
Feature file broken since 1.0.17 #127
Comments
Fix has been introduced in Can you please have a try ? Build is started, must be there in few minutes. |
Tested my simple terraform script with 1.0.22. The errors at the top are now gone. The scenario outline for protocol/port/cidr verification still has some problems. If I change the aws_security_group in my terraform to something like the following:
It should fail with the following scenario outline:
But it passes the test. I believe it has to do with having multiple ingress blocks. When I remove the first one ingress block it fails the test (as it should). If I have the two ingress blocks but invert the order it still incorrectly passes the test. Also, in trying to troubleshoot that issue I tried changing the scenario outline to use "must" instead of "must not" as follows:
and got the following error:
Should these be new issues?? |
Let me answer both issues at once.
Thus, if you change your step from ; Then it must have tcp protocol and port 443 for 10.0.0.0/8 to Then it must only have tcp protocol and port 443 for 10.0.0.0/8 it should work. |
Thank you for the quick reply. I actually looked at the documentation and misread it. :( I just tested briefly with the only condition. I guess that is only usable within a scenario, not a scenario outline? For example could I do something like "the only ingress rules allowed are tcp on port 80 and tcp on port 443 for 2.2.2.2/8 " ? |
…les within the same SG definition. (#127)
You can also use for both Here is the test that should work for your previous scenario ; Scenario: Ensure we only allow a port range for ingress rule
Given I have AWS Security Group defined
When it contains ingress
Then it must only have tcp protocol and port 22 for 10.0.0.0/8 and the results ;
which is valid (but the error message is misleading a bit, it should have said If we create a Scenario like this ; Scenario: Ensure we only allow a port range for ingress rule
Given I have AWS Security Group defined
When it contains ingress
Then it must only have tcp protocol and port 8080 for 0.0.0.0/0 Then the tests will pass, because the other port defined in SGs are |
Sorry but I don't fully understand the explanation. I understand the first portion where we are setting a rule that only tcp/22 is allowed for 10.0.0.0/8, but in another ingress block declaration we are allowing tcp/8080 for 0.0.0.0/0. Since 0.0.0.0/0 basically means all IP addresses (including 10.0.0.0/8) the the test should fail. In you other scenario we are setting a rule that only tcp/8080 is allowed for 0.0.0.0/0 (which should mean all IPs). If I then have the other ingress block allowing tcp/22 for 10.0.0.0/8 shouldn't that fail as well?? Isn't 10.0.0.0/8 a subset of 0.0.0.0/0? |
Yes it is, but you need to switch the logic :) Then it must only have tcp protocol and port 8080 for 0.0.0.0/0 This means, for A sample use case could be an SG attached to an ELB, allowing On the opposite, if my ELB only allows |
Still not clear for me but I don't really have that use case at the moment so I won't worry too much about it for now :) |
You are not alone. I had quite hard times to understand while implementing it. The use case is quite limited on |
Closing the issue, since the initial problem is fixed :) Please don't hesitate to re-open it, if you still have problem with the same issue. Thanks again 🎉 |
Will you address the multiple ingress blocks in another issue? |
It is already released :) Please try with the latest version, was a busy evening :) |
Just tested with 1.0.24. Works good. Thank you for your support!! |
Glad it is working! 🎉 Thanks for reporting it. :) Closing the issue. |
I had been testing with a plan.out.json file over the last several releases (at least up until 1.0.13). I was trying out a more complex tf script with 1.0.20 and had errors. In trying to troubleshoot I reverted back to 1.0.13 (same errors). I created ( #124) for that problem.
I went back to try my previous plan.out.json (the simple one) with 1.0.20 and that was broken as well. I ran some tests with several versions. Up to version 1.0.16 everything worked fine with the output json from the simpler script. Here are the results for other versions (with the same plan.out.json):
1.0.17:
1.0.21:
on 1.0.21 I also get additional errors that worked fine on 1.0.17:
I am attaching the output json file.
plan.out.json.txt
The text was updated successfully, but these errors were encountered: