Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

fix port detection in containers - #32374

Merged
wfurt merged 2 commits into
dotnet:masterfrom
wfurt:serial_conatiner
Sep 25, 2018
Merged

wfurt merged 2 commits into
dotnet:masterfrom
wfurt:serial_conatiner

Conversation

@wfurt

@wfurt wfurt commented Sep 20, 2018

Copy link
Copy Markdown
Member

fixes #32204

The last failure has nothing to do with Alpine it self.
However we run Alpine tests in containers and the /sysfs sees ports from host but they are not available in guest.

This change improves port detection and eliminates unaccessible one.

I also updated the error message when port cannot be opened:

System.ArgumentException: The given port name is invalid. It may be a valid port, but not a serial port.

The extended version does not have references to COM.

We get ENOENT errno so we could possibly make exception more specific but "port name invalid" may be sufficient hint.

@wfurt wfurt self-assigned this Sep 20, 2018
@danmoseley

Copy link
Copy Markdown

@dotnet-bot test Linux arm64 Release Build please

@pjanotti pjanotti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the paramName on the exception constructor.

@stephentoub stephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than Paulo's comments, LGTM.

@wfurt
wfurt merged commit 443723f into dotnet:master Sep 25, 2018
@safern safern mentioned this pull request Sep 26, 2018
@karelz karelz added this to the 3.0 milestone Oct 8, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* fix port detection in containers

* update exception message


Commit migrated from dotnet/corefx@443723f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.IO.Ports.Tests.GetPortNames/OpenEveryPortName failing on Unix

5 participants