Skip to content

Commit 03fa2ff

Browse files
committed
Drop privileges before creating temporary directory
Otherwise, when the tests are run as root, the temporary directory gets created as root, but the cleanup code runs with dropped privileges, so it cannot remove it.
1 parent 49ab311 commit 03fa2ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

intelmq/tests/bin/test_intelmqctl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class TestIntelMQController(unittest.TestCase):
6565
def setUp(self):
6666
super().setUp()
6767

68+
utils.drop_privileges()
69+
6870
self.tmp_config_dir = TemporaryDirectory()
6971

7072
self.tmp_runtime = f"{self.tmp_config_dir.name}/runtime.yaml"

0 commit comments

Comments
 (0)