-
Notifications
You must be signed in to change notification settings - Fork 54
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 open ports parsing from yaml. #834
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #834 +/- ##
==========================================
+ Coverage 62.71% 62.73% +0.02%
==========================================
Files 341 341
Lines 14299 14307 +8
==========================================
+ Hits 8967 8975 +8
Misses 5332 5332 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
assert agent_definition.caps == ["NET_ADMIN"] | ||
assert agent_definition.open_ports == [ | ||
utils_defintions.PortMapping( | ||
source_port=4242, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you may want to test with different ports so you make sure everything is in the right place
The
open_ports
field of theAgentDefinition
class is of typePortMapping
.When reading the raw yaml agent definition to create the
AgentDefinition
instance, the current implementation doesn't convert the raw dict to the correspondingPortMapping
objects.This PR handles this cases in the
from_yaml
classmethod of theAgentDefinition
class.