some fixes to run tests from pycharm with a suid-python binary

This commit is contained in:
Edwin Eefting 2024-09-17 12:10:02 +02:00
parent c52857f7b9
commit a2f4dd4227
No known key found for this signature in database
GPG Key ID: 0F3C35D8E9887737
2 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import os
# To run tests as non-root, use this hack:
# chmod 4755 /usr/sbin/zpool /usr/sbin/zfs
@ -51,6 +51,10 @@ if sys.version_info.major==2:
else:
OutputIO=io.StringIO
# for when we're using a suid-root python binary during development
os.setuid(0)
os.setgid(0)
# for python2 compatibility (python 3 has this already)
@contextlib.contextmanager

1
tests/tests Symbolic link
View File

@ -0,0 +1 @@
.