Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix fifo test cases for VxWorks
  • Loading branch information
pxinwr committed Nov 30, 2020
commit abb33eaf5efa77926e44a75c72a3a2aee02ebbe0
10 changes: 7 additions & 3 deletions Lib/test/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,16 @@ def test_stat(self):

@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)
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")
Expand Down
10 changes: 8 additions & 2 deletions Lib/test/test_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,17 @@ def test_link(self):

@unittest.skipUnless(hasattr(os, 'mkfifo'), 'os.mkfifo not available')
def test_fifo(self):
if sys.platform == "vxworks":
fifo_path = os.path.join("/fifos/", TESTFN)
else:
fifo_path = TESTFN
try:
os.mkfifo(TESTFN, 0o700)
os.mkfifo(fifo_path, 0o700)
except PermissionError as e:
self.skipTest('os.mkfifo(): %s' % e)
st_mode, modestr = self.get_mode()
st_mode, modestr = self.get_mode(fifo_path)
if sys.platform == "vxworks":
os.remove(fifo_path)
self.assertEqual(modestr, 'prwx------')
self.assertS_IS("FIFO", st_mode)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix fifo test cases for VxWorks RTOS.