-
Notifications
You must be signed in to change notification settings - Fork 217
exporter: limit ser2net port range #1743
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
base: master
Are you sure you want to change the base?
exporter: limit ser2net port range #1743
Conversation
6229841
to
f72b887
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1743 +/- ##
========================================
- Coverage 45.4% 45.3% -0.1%
========================================
Files 172 172
Lines 13503 13514 +11
========================================
+ Hits 6131 6132 +1
- Misses 7372 7382 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This allows for specifying a start port and a range up from that to be used when looking for a free port to use with ser2net when creating a networkserialport resource. This can be helpful on networks where access to ports on the network is limited. Signed-off-by: Benjamin B. Frost <benjamin@geanix.com>
f72b887
to
85b2413
Compare
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 it's usually more common to have a STARTPORT:ENDPORT
definition instead of the PORT:RANGE
used here, e.g. 4000:5000
instead of 4000:1000
. This might also simplify the code, what do you think?
I think this should not be limited to I'm not a huge fan of adding more environment variables, a CLI argument for |
Yeah I see what you mean and will look into it.
Do you mean a global range for everything else that also needs a port? |
Letting the exporter bind something is a rather special case. Apart from USBSerialPort/RawSerialPort exports running That being said, maybe it makes more sense (in such a regulated environment) to run |
Please keep in mind that without allocating a new port on acquire, you have the risk that an out of date client connects to the port it knows even if it no longer has a lock. |
This allows for specifying a start port and a range up from that to be used when looking for a free port to use with ser2net when creating a networkserialport resource. This can be helpful on networks where access to ports on the network is limited.
Currently this feature is planed for use in a labgrid setup where the exporter and duts are placed on a network separate from the main network the developers are on and there are restrictions on the tcp ports. Being able to specify what port(s) labgrid can use makes it easier to manage and keep track of what ports are open between the two networks.
Checklist