Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Donny Wong committed Mar 25, 2024
1 parent 1d14fd8 commit 8516d17
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/autotest_server/tests/test_autotest_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import subprocess
from pwd import getpwnam

import pytest
Expand Down Expand Up @@ -36,9 +37,12 @@ def test_sticky():
path = f'{autotest_worker_working_dir}/test_sticky'

if not os.path.exists(path):
os.system(f"sudo -u {autotest_worker} mkdir {path}")
os.system(f"sudo -u {autotest_worker} chmod 000 {path}")
os.system(f"sudo -u {autotest_worker} chmod +t {path}")
mkdir_cmd = f"sudo -u {autotest_worker} mkdir {path}"
chmod_cmd = f"sudo -u {autotest_worker} chmod 000 {path}"
chmod_sticky_cmd = f"sudo -u {autotest_worker} chmod +t {path}"
subprocess.run(mkdir_cmd, shell=True)
subprocess.run(chmod_cmd, shell=True)
subprocess.run(chmod_sticky_cmd, shell=True)

autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker)

Expand Down

0 comments on commit 8516d17

Please sign in to comment.