Compare commits

...

10 Commits

Author SHA1 Message Date
pxinwr 00a6568ba3
bpo-31904: remove libnet dependency from detect_socket() for VxWorks (GH-23394)
Previously on VxWorks compiling socket extension module needs the libnet to link. Now VxWorks has moved the replied functions to libc. So removing libnet from setup.py.
2020-11-28 14:14:16 -08:00
pxinwr 6a273fdc2a
bpo-31904: skip some tests related to fifo on VxWorks (GH-23473)
On VxWork RTOS, FIFO must be created under directory "/fifos/". Some test cases related to fifo is invalid on VxWorks. So skip them.
2020-11-28 14:06:36 -08:00
pxinwr a86a274b72
bpo-31904: add shell requirement for test_pipes (GH-23489)
VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.
2020-11-28 14:04:50 -08:00
pxinwr 996a1ef8ae
skip test_test of test_mailcap on VxWorks (GH-23507) 2020-11-28 13:49:47 -08:00
pxinwr 64c8f81047
skip test_getaddrinfo_ipv6_scopeid_symbolic and test_getnameinfo_ipv6_scopeid_symbolic on VxWorks (GH-23518) 2020-11-28 13:48:38 -08:00
Zackery Spytz 7a240aef15
Fix an error in the news entry for _posixsubprocess multiphase init (GH-23516)
Commit 035deee265 converted the
_posixsubprocess module to multiphase initialization, but the news entry
mentions the _posixshmem module.
2020-11-28 13:46:30 -08:00
Andre Delfino fa840cc81d
Fix dis markup (GH-23524) 2020-11-28 13:43:22 -08:00
Andre Delfino 4b44472966
Fix multiprocessing markup (GH-23525) 2020-11-28 13:42:23 -08:00
Soumendra Ganguly 74311aeb45
bpo-41818: Fix test_master_read() so that it succeeds on all platforms that either raise OSError or return b"" upon reading from master (GH-23536)
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
2020-11-28 23:04:20 +02:00
pxinwr aa1b8a168d
bpo-31904: Fix test_os.test_getcwd_long_path() failure for VxWorks (GH-20256) 2020-11-28 21:21:30 +01:00
20 changed files with 45 additions and 27 deletions

View File

@ -861,7 +861,7 @@ All of the following opcodes use their arguments.
.. opcode:: LIST_TO_TUPLE
Pops a list from the stack and pushes a tuple containing the same values.
Pops a list from the stack and pushes a tuple containing the same values.
.. versionadded:: 3.9
@ -889,7 +889,7 @@ All of the following opcodes use their arguments.
.. opcode:: DICT_MERGE
Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys.
Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys.
.. versionadded:: 3.9
@ -907,14 +907,14 @@ All of the following opcodes use their arguments.
.. opcode:: IS_OP (invert)
Performs ``is`` comparison, or ``is not`` if ``invert`` is 1.
Performs ``is`` comparison, or ``is not`` if ``invert`` is 1.
.. versionadded:: 3.9
.. opcode:: CONTAINS_OP (invert)
Performs ``in`` comparison, or ``not in`` if ``invert`` is 1.
Performs ``in`` comparison, or ``not in`` if ``invert`` is 1.
.. versionadded:: 3.9
@ -955,8 +955,8 @@ All of the following opcodes use their arguments.
.. opcode:: JUMP_IF_NOT_EXC_MATCH (target)
Tests whether the second value on the stack is an exception matching TOS,
and jumps if it is not. Pops two values from the stack.
Tests whether the second value on the stack is an exception matching TOS,
and jumps if it is not. Pops two values from the stack.
.. versionadded:: 3.9

View File

@ -2569,9 +2569,9 @@ Address Formats
filesystem.
* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.
:samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.
Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.

View File

@ -17,6 +17,8 @@ The :mod:`pipes` module defines a class to abstract the concept of a *pipeline*
Because the module uses :program:`/bin/sh` command lines, a POSIX or compatible
shell for :func:`os.system` and :func:`os.popen` is required.
.. availability:: Unix. Not available on VxWorks.
The :mod:`pipes` module defines the following class:

View File

@ -421,7 +421,7 @@ is_jython = sys.platform.startswith('java')
is_android = hasattr(sys, 'getandroidapilevel')
if sys.platform != 'win32':
if sys.platform not in ('win32', 'vxworks'):
unix_shell = '/system/bin/sh' if is_android else '/bin/sh'
else:
unix_shell = None

View File

@ -4,6 +4,7 @@ import copy
import test.support
from test.support import os_helper
import unittest
import sys
# Location of mailcap file
MAILCAPFILE = test.support.findfile("mailcap.txt")
@ -214,6 +215,7 @@ class FindmatchTest(unittest.TestCase):
self._run_cases(cases)
@unittest.skipUnless(os.name == "posix", "Requires 'test' command on system")
@unittest.skipIf(sys.platform == "vxworks", "'test' command is not supported on VxWorks")
def test_test(self):
# findmatch() will automatically check any "test" conditions and skip
# the entry if the check fails.

View File

@ -116,6 +116,10 @@ class MiscTests(unittest.TestCase):
# than MAX_PATH if long paths support is disabled:
# see RtlAreLongPathsEnabled().
min_len = 2000 # characters
# On VxWorks, PATH_MAX is defined as 1024 bytes. Creating a path
# longer than PATH_MAX will fail.
if sys.platform == 'vxworks':
min_len = 1000
dirlen = 200 # characters
dirname = 'python_test_dir_'
dirname = dirname + ('a' * (dirlen - len(dirname)))

View File

@ -2219,6 +2219,8 @@ class _BasePathTest(object):
self.assertIs((P / 'fileA\x00').is_fifo(), False)
@unittest.skipUnless(hasattr(os, "mkfifo"), "os.mkfifo() required")
@unittest.skipIf(sys.platform == "vxworks",
"fifo requires special path on VxWorks")
def test_is_fifo_true(self):
P = self.cls(BASE, 'myfifo')
try:

View File

@ -3,13 +3,16 @@ import os
import string
import unittest
import shutil
from test.support import run_unittest, reap_children
from test.support import run_unittest, reap_children, unix_shell
from test.support.os_helper import TESTFN, unlink
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
if not (unix_shell and os.path.exists(unix_shell)):
raise unittest.SkipTest('pipes module requires a shell')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit

View File

@ -17,7 +17,6 @@ import unittest
import struct
import tty
import fcntl
import platform
import warnings
TEST_STRING_1 = b"I wish to buy a fish license.\n"
@ -82,12 +81,6 @@ def expectedFailureIfStdinIsTTY(fun):
pass
return fun
def expectedFailureOnBSD(fun):
PLATFORM = platform.system()
if PLATFORM.endswith("BSD") or PLATFORM == "Darwin":
return unittest.expectedFailure(fun)
return fun
def _get_term_winsz(fd):
s = struct.pack("HHHH", 0, 0, 0, 0)
return fcntl.ioctl(fd, _TIOCGWINSZ, s)
@ -314,7 +307,6 @@ class PtyTest(unittest.TestCase):
os.close(master_fd)
@expectedFailureOnBSD
def test_master_read(self):
debug("Calling pty.openpty()")
master_fd, slave_fd = pty.openpty()
@ -324,10 +316,13 @@ class PtyTest(unittest.TestCase):
os.close(slave_fd)
debug("Reading from master_fd")
with self.assertRaises(OSError):
os.read(master_fd, 1)
try:
data = os.read(master_fd, 1)
except OSError: # Linux
data = b""
os.close(master_fd)
self.assertEqual(data, b"")
class SmallPtyTests(unittest.TestCase):
"""These tests don't spawn children or hang."""

View File

@ -683,6 +683,8 @@ class TestCopyTree(BaseTest, unittest.TestCase):
# Issue #3002: copyfile and copytree block indefinitely on named pipes
@unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
@os_helper.skip_unless_symlink
@unittest.skipIf(sys.platform == "vxworks",
"fifo requires special path on VxWorks")
def test_copytree_named_pipe(self):
os.mkdir(TESTFN)
try:
@ -1206,6 +1208,8 @@ class TestCopy(BaseTest, unittest.TestCase):
# Issue #3002: copyfile and copytree block indefinitely on named pipes
@unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
@unittest.skipIf(sys.platform == "vxworks",
"fifo requires special path on VxWorks")
def test_copyfile_named_pipe(self):
try:
os.mkfifo(TESTFN)

View File

@ -1738,6 +1738,7 @@ class GeneralModuleTests(unittest.TestCase):
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.')
@unittest.skipIf(sys.platform == 'win32', 'does not work on Windows')
@unittest.skipIf(AIX, 'Symbolic scope id does not work')
@unittest.skipUnless(hasattr(socket, 'if_nameindex'), "test needs socket.if_nameindex()")
def test_getaddrinfo_ipv6_scopeid_symbolic(self):
# Just pick up any network interface (Linux, Mac OS X)
(ifindex, test_interface) = socket.if_nameindex()[0]
@ -1770,6 +1771,7 @@ class GeneralModuleTests(unittest.TestCase):
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.')
@unittest.skipIf(sys.platform == 'win32', 'does not work on Windows')
@unittest.skipIf(AIX, 'Symbolic scope id does not work')
@unittest.skipUnless(hasattr(socket, 'if_nameindex'), "test needs socket.if_nameindex()")
def test_getnameinfo_ipv6_scopeid_symbolic(self):
# Just pick up any network interface.
(ifindex, test_interface) = socket.if_nameindex()[0]

View File

@ -0,0 +1 @@
remove libnet dependency from detect_socket() for VxWorks

View File

@ -1 +1,2 @@
Port _posixshmem extension module to multiphase initialization (:pep:`489`).
Port _posixsubprocess extension module to multiphase initialization
(:pep:`489`).

View File

@ -0,0 +1 @@
Fix test_master_read() so that it succeeds on all platforms that either raise OSError or return b"" upon reading from master.

View File

@ -0,0 +1 @@
Fix os module failures for VxWorks RTOS.

View File

@ -0,0 +1 @@
skip some tests related to fifo on VxWorks

View File

@ -0,0 +1 @@
add shell requirement for test_pipes

View File

@ -0,0 +1 @@
skip test_test of test_mailcap on VxWorks

View File

@ -0,0 +1 @@
skip test_getaddrinfo_ipv6_scopeid_symbolic and test_getnameinfo_ipv6_scopeid_symbolic on VxWorks

View File

@ -1132,11 +1132,7 @@ class PyBuildExt(build_ext):
def detect_socket(self):
# socket(2)
kwargs = {'depends': ['socketmodule.h']}
if VXWORKS:
if not self.compiler.find_library_file(self.lib_dirs, 'net'):
return
kwargs['libraries'] = ['net']
elif MACOS:
if MACOS:
# Issue #35569: Expose RFC 3542 socket options.
kwargs['extra_compile_args'] = ['-D__APPLE_USE_RFC_3542']