Skip to content
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

UDPLITE tests fail on android #83032

Closed
xdegaye mannequin opened this issue Nov 19, 2019 · 5 comments · Fixed by #116674
Closed

UDPLITE tests fail on android #83032

xdegaye mannequin opened this issue Nov 19, 2019 · 5 comments · Fixed by #116674
Labels
3.9 only security fixes OS-android tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 19, 2019

BPO 38851
Nosy @asvetlov, @gappleto97
Files
  • test_socket.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2019-11-19.19:40:49.552>
    labels = ['type-bug', 'tests', '3.9']
    title = 'UDPLITE tests fail on android'
    updated_at = <Date 2019-12-10.07:54:29.574>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2019-12-10.07:54:29.574>
    actor = 'xdegaye'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2019-11-19.19:40:49.552>
    creator = 'xdegaye'
    dependencies = []
    files = ['48722']
    hgrepos = []
    issue_num = 38851
    keywords = []
    message_count = 3.0
    messages = ['356985', '358167', '358171']
    nosy_count = 2.0
    nosy_names = ['asvetlov', 'gappleto97']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38851'
    versions = ['Python 3.9']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 19, 2019

    Attached test_socket.txt is the output of running 'python -m test -v test_socket' on android API 24. The 108 tests in error are UDPLITE tests introduced in issue bpo-37345.

    @xdegaye xdegaye mannequin added 3.9 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Nov 19, 2019
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 10, 2019

    Not interested anymore in android stuff.

    @gappleto97
    Copy link
    Mannequin

    gappleto97 mannequin commented Dec 10, 2019

    Also, isn't this just a permissions error? I wouldn't think that would indicate a failure of the feature, but instead one of the testing environment.

    On December 10, 2019 7:47:10 AM UTC, Xavier de Gaye <report@bugs.python.org> wrote:

    Xavier de Gaye <xdegaye@gmail.com> added the comment:

    Not interested anymore in android stuff.

    ----------


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue38851\>


    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @mhsmith
    Copy link
    Member

    mhsmith commented Feb 25, 2024

    Also, isn't this just a permissions error? I wouldn't think that would indicate a failure of the feature, but instead one of the testing environment.

    Yes, this was probably caused by running the tests within an app which didn't have the INTERNET permission. With the permission present, I've confirmed that the UDPLITE tests all pass on the current main branch.

    @encukou: So I think this issue can be closed.

    @encukou encukou closed this as completed Feb 26, 2024
    @encukou encukou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
    @mhsmith
    Copy link
    Member

    mhsmith commented Mar 13, 2024

    Actually, I can reproduce this now on API level 21:

    18:03:27.410 python.stdout    I  testRecvFrom (test.test_socket.BasicUDPLITETest.testRecvFrom) ...
    18:03:27.404 .python.testbed  W  type=1400 audit(0.0:379): avc: denied { node_bind } for saddr=127.0.0.1 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:node:s0 tclass=rawip_socket permissive=0
    18:03:27.413 python.stdout    I  ERROR
    ...
    18:04:00.887 python.stdout    I  ======================================================================
    18:04:00.887 python.stdout    I  ERROR: testRecvFrom (test.test_socket.BasicUDPLITETest.testRecvFrom)
    18:04:00.887 python.stdout    I  ----------------------------------------------------------------------
    18:04:00.887 python.stdout    I  Traceback (most recent call last):
    18:04:00.887 python.stdout    I    File "/data/data/org.python.testbed/files/python/lib/python3.13/test/test_socket.py", line 389, in _setUp
    18:04:00.887 python.stdout    I      self.__setUp()
    18:04:00.887 python.stdout    I      ~~~~~~~~~~~~^^
    18:04:00.887 python.stdout    I    File "/data/data/org.python.testbed/files/python/lib/python3.13/test/test_socket.py", line 246, in setUp
    18:04:00.887 python.stdout    I      self.port = socket_helper.bind_port(self.serv)
    18:04:00.887 python.stdout    I                  ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
    18:04:00.887 python.stdout    I    File "/data/data/org.python.testbed/files/python/lib/python3.13/test/support/socket_helper.py", line 116, in bind_port
    18:04:00.887 python.stdout    I      sock.bind((host, 0))
    18:04:00.887 python.stdout    I      ~~~~~~~~~^^^^^^^^^^^
    18:04:00.887 python.stdout    I  PermissionError: [Errno 13] Permission denied
    

    "avc" is an SELinux log message, so it looks like UDPLITE is blocked on older versions of Android. I'll update #116674 to deal with this.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes OS-android tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    2 participants