Thanks to visit codestin.com
Credit goes to github.com

Skip to content

multi_net/tcp_accept_recv.py: Fix test when using system error numbers. #8678

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

Closed
wants to merge 1 commit into from

Conversation

iabdalkader
Copy link
Contributor

@iabdalkader iabdalkader commented May 17, 2022

If a port is Not using internal error numbers, which match both LWIP and Linux error numbers, ENTOCONN from standard libraries errno.h equals 128 not 107.

To reproduce this issue on PYBD_SF2, disable the MICROPY_USE_INTERNAL_ERRNO macro in stm32/mpconfigport.h and run the test with pyboard as the server:

./run-multitests.py -i pyb:a0 multi_net/tcp_accept_recv.py
multi_net/tcp_accept_recv.py on ttyACM0|micropython: FAIL
### TEST ###
--- instance0 ---
128
--- instance1 ---

### TRUTH ###
--- instance0 ---
107
--- instance1 ---

### DIFF ###
--- /tmp/tmpxv59qd5m	2022-05-17 15:40:41.287993866 +0200
+++ /tmp/tmpd86miwdh	2022-05-17 15:40:41.287993866 +0200
@@ -1,4 +1,4 @@
 --- instance0 ---
-107
+128
 --- instance1 ---
 
1 tests performed
0 tests passed
1 tests failed: multi_net/tcp_accept_recv.py

* If a port is Not using internal error numbers, which match both LWIP and
Linux error numbers, ENTOCONN from standard libraries errno.h equals 128
not 107.
@iabdalkader iabdalkader changed the title multi_net/tcp_accept_recv.py: Fix test when not using internal errno. multi_net/tcp_accept_recv.py: Fix test when using system error numbers. May 17, 2022
@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label May 19, 2022
@robert-hh
Copy link
Contributor

robert-hh commented May 19, 2022

print(er.errno in (107, 128)) returns True. Doesn't the test script expect 107?

@iabdalkader
Copy link
Contributor Author

Doesn't the test script expect 107?

No, I think when there's no exp file, the test runs on the host first and the expected value is whatever the script prints on the host.

@robert-hh
Copy link
Contributor

Tried it: True is accepted.

@dpgeorge
Copy link
Member

Merged in beeb250

@dpgeorge dpgeorge closed this May 24, 2022
@iabdalkader iabdalkader deleted the multi_net_errno branch May 24, 2022 05:47
tannewt added a commit to tannewt/circuitpython that referenced this pull request Mar 12, 2025
And make them available over USB MSC. They can be remount to make
them writable (slowly) from the host PC.

Fixes micropython#9954. Fixes micropython#8678. Fixes micropython#3477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants