(self)
| 1796 | and hasattr(stat, 'S_IFIFO'), |
| 1797 | "test requires both stat.S_IFIFO and dir_fd support for os.mknod()") |
| 1798 | def test_mknod_dir_fd(self): |
| 1799 | # Test using mknodat() to create a FIFO (the only use specified |
| 1800 | # by POSIX). |
| 1801 | with self.prepare() as (dir_fd, name, fullname): |
| 1802 | mode = stat.S_IFIFO | stat.S_IRUSR | stat.S_IWUSR |
| 1803 | try: |
| 1804 | posix.mknod(name, mode, 0, dir_fd=dir_fd) |
| 1805 | except OSError as e: |
| 1806 | # Some old systems don't allow unprivileged users to use |
| 1807 | # mknod(), or only support creating device nodes. |
| 1808 | self.assertIn(e.errno, (errno.EPERM, errno.EINVAL, errno.EACCES)) |
| 1809 | else: |
| 1810 | self.addCleanup(posix.unlink, fullname) |
| 1811 | self.assertTrue(stat.S_ISFIFO(posix.stat(fullname).st_mode)) |
| 1812 | |
| 1813 | @unittest.skipUnless(os.open in os.supports_dir_fd, "test needs dir_fd support in os.open()") |
| 1814 | def test_open_dir_fd(self): |
nothing calls this directly
no test coverage detected