summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-03-16 20:07:56 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-03-16 20:07:56 +0100
commitde6b129187ea1655b550ed274bd06dd7dc72d43a (patch)
tree3166b7d0db3dbaa2206eae3f1df1ccd4dda0e3cf
parentddd02e390644a7ecf9a8d5a4b451cc19724dcd77 (diff)
downloadpython-linuxnamespaces-de6b129187ea1655b550ed274bd06dd7dc72d43a.tar.gz
slightly simplify tests
-rw-r--r--tests/test_simple.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_simple.py b/tests/test_simple.py
index e3d0fd9..8d87dae 100644
--- a/tests/test_simple.py
+++ b/tests/test_simple.py
@@ -152,8 +152,7 @@ class UnshareIdmapTest(unittest.TestCase):
pid = os.getpid()
@linuxnamespaces.run_in_fork
def setup() -> None:
- linuxnamespaces.newgidmap(pid, [gidmap])
- linuxnamespaces.newuidmap(pid, [uidmap])
+ linuxnamespaces.newidmaps(pid, [uidmap], [gidmap])
linuxnamespaces.unshare(linuxnamespaces.CloneFlags.NEWUSER)
setup()
self.assertEqual(os.getuid(), overflowuid)
@@ -174,8 +173,7 @@ class UnshareIdmapTest(unittest.TestCase):
pid = os.getpid()
@linuxnamespaces.run_in_fork
def setup() -> None:
- linuxnamespaces.newgidmap(pid, [gidmap])
- linuxnamespaces.newuidmap(pid, [uidmap])
+ linuxnamespaces.newidmaps(pid, [uidmap], [gidmap])
linuxnamespaces.unshare(
linuxnamespaces.CloneFlags.NEWUSER
| linuxnamespaces.CloneFlags.NEWNS