classification
Title: Add tests for posix.mknod() and posix.mkfifo()
Type: enhancement Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: baikie, benjamin.peterson, pitrou
Priority: normal Keywords: patch

Created on 2010-08-11 18:11 by baikie, last changed 2010-08-17 01:27 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
test-mknod-mkfifo-3.x.diff baikie, 2010-08-11 18:11 For 3.x
test-mknod-mkfifo-2.x.diff baikie, 2010-08-11 18:11 For 2.x
test-mknod-mkfifo-2.x-2.diff baikie, 2010-08-12 20:29 Updated - also change tearDown() to use test_support.unlink()
add-errno-check-2.x.diff baikie, 2010-08-12 20:30 Add check for mknod() errno
add-errno-check-3.x.diff baikie, 2010-08-12 20:30 Add check for mknod() errno
Messages (6)
msg113609 - (view) Author: David Watson (baikie) Date: 2010-08-11 18:11
Attaching simple tests for these functions, which aren't currently tested.
msg113614 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-08-11 19:09
Can you qualify the OSError except by checking it's errno?
msg113702 - (view) Author: David Watson (baikie) Date: 2010-08-12 19:26
I'm not quite sure what you mean, but the man page for FreeBSD 5.3 specifies EPERM for an unprivileged user and EINVAL for an attempt to create something other than a device node.  POSIX requires creating a FIFO to work for any user, and just says that EINVAL is for an "invalid argument".
msg113703 - (view) Author: David Watson (baikie) Date: 2010-08-12 20:29
OK, these patches work on FreeBSD 5.3 (root and non-root) if you want to check the errno.  I don't know what other systems might return though.  I did also find that the 2.x tests were failing on cleanup because the test class used os.unlink rather than support.unlink (which ignores missing files) as its 3.x counterpart does, so I've updated the patch to change that as well.
msg113704 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-08-12 20:43
The 3.x patches work fine for me under Mandriva Linux.
msg114092 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-08-17 01:27
Thanks for the patch. r84129
History
Date User Action Args
2010-08-17 01:27:19benjamin.petersonsetstatus: open -> closed
resolution: accepted
messages: + msg114092
2010-08-12 20:43:14pitrousetnosy: + pitrou
messages: + msg113704
2010-08-12 20:30:38baikiesetfiles: + add-errno-check-3.x.diff
2010-08-12 20:30:27baikiesetfiles: + add-errno-check-2.x.diff
2010-08-12 20:29:49baikiesetfiles: + test-mknod-mkfifo-2.x-2.diff

messages: + msg113703
2010-08-12 19:26:47baikiesetmessages: + msg113702
2010-08-11 19:09:06benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg113614
2010-08-11 18:11:59baikiesetfiles: + test-mknod-mkfifo-2.x.diff
2010-08-11 18:11:38baikiecreate