mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
qa/run-tox-mgr-dashboard: Do not write to /tmp/test_sanitize_password.txt file
To allow running multiple instances of the same tests. Fixes: https://tracker.ceph.com/issues/51792 Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
This commit is contained in:
parent
1f8560816e
commit
d04ef800ab
@ -3,6 +3,7 @@
|
||||
|
||||
import errno
|
||||
import json
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
@ -586,7 +587,7 @@ class AccessControlTest(unittest.TestCase, CLICommandTestMixin):
|
||||
def test_sanitize_password(self):
|
||||
self.test_create_user()
|
||||
password = 'myPass\\n\\r\\n'
|
||||
with open('/tmp/test_sanitize_password.txt', 'w+') as pwd_file:
|
||||
with tempfile.TemporaryFile(mode='w+') as pwd_file:
|
||||
# Add new line separators (like some text editors when a file is saved).
|
||||
pwd_file.write('{}{}'.format(password, '\n\r\n\n'))
|
||||
pwd_file.seek(0)
|
||||
|
Loading…
Reference in New Issue
Block a user