diff options
author | pxinwr <peixing.xin@windriver.com> | 2020-12-01 08:20:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 08:20:50 (GMT) |
commit | b2d0c66e881301ed8908da3cb41bbf253c449b0c (patch) | |
tree | c89359246f95ce02862d5c2290864ebc5c2398ee /Lib/test/test_posix.py | |
parent | cc061d0e6fb2569efa91531686f75b89e94ec865 (diff) | |
download | cpython-b2d0c66e881301ed8908da3cb41bbf253c449b0c.zip cpython-b2d0c66e881301ed8908da3cb41bbf253c449b0c.tar.gz cpython-b2d0c66e881301ed8908da3cb41bbf253c449b0c.tar.bz2 |
bpo-31904: Fix fifo test cases for VxWorks (GH-20254)
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index a522717..18afbef 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -642,12 +642,17 @@ class PosixTester(unittest.TestCase): @unittest.skipUnless(hasattr(posix, 'mkfifo'), "don't have mkfifo()") def test_mkfifo(self): - os_helper.unlink(os_helper.TESTFN) + if sys.platform == "vxworks": + fifo_path = os.path.join("/fifos/", os_helper.TESTFN) + else: + fifo_path = os_helper.TESTFN + os_helper.unlink(fifo_path) + self.addCleanup(os_helper.unlink, fifo_path) try: - posix.mkfifo(os_helper.TESTFN, stat.S_IRUSR | stat.S_IWUSR) + posix.mkfifo(fifo_path, stat.S_IRUSR | stat.S_IWUSR) except PermissionError as e: self.skipTest('posix.mkfifo(): %s' % e) - self.assertTrue(stat.S_ISFIFO(posix.stat(os_helper.TESTFN).st_mode)) + self.assertTrue(stat.S_ISFIFO(posix.stat(fifo_path).st_mode)) @unittest.skipUnless(hasattr(posix, 'mknod') and hasattr(stat, 'S_IFIFO'), "don't have mknod()/S_IFIFO") @@ -1929,7 +1934,7 @@ class TestPosixSpawnP(unittest.TestCase, _PosixSpawnMixin): class TestPosixWeaklinking(unittest.TestCase): # These test cases verify that weak linking support on macOS works # as expected. These cases only test new behaviour introduced by weak linking, - # regular behaviour is tested by the normal test cases. + # regular behaviour is tested by the normal test cases. # # See the section on Weak Linking in Mac/README.txt for more information. def setUp(self): |