mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
test: drop the use of tempfile.mktemp()
and use `uuid.uuid4()` instead to generate a sufficiently pseudo-random file name. Resolves: https://github.com/systemd/systemd/security/code-scanning/142
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
import uuid
|
||||
from enum import Enum
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class ExecutionResumeTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.unit = 'test-issue-518.service'
|
||||
self.unitfile_path = f'/run/systemd/system/{self.unit}'
|
||||
self.output_file = tempfile.mktemp()
|
||||
self.output_file = f"/tmp/test-issue-518-{uuid.uuid4()}"
|
||||
self.unit_files = {}
|
||||
|
||||
unit_file_content = f'''
|
||||
|
||||
Reference in New Issue
Block a user