Skip to content

Commit

Permalink
use sudo -n in soak
Browse files Browse the repository at this point in the history
Skip-build: true

Signed-off-by: Dalton Bohning <dalton.bohning@intel.com>
  • Loading branch information
daltonbohning committed Jul 29, 2024
1 parent fe932a2 commit 0ae5b72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tests/ftest/util/soak_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def run_soak(self, test_param):
resv_bytes = self.params.get("resv_bytes", test_param + "*", 500000000)
ignore_soak_errors = self.params.get("ignore_soak_errors", test_param + "*", False)
self.enable_il = self.params.get("enable_intercept_lib", test_param + "*", False)
self.sudo_cmd = "sudo" if enable_sudo else ""
self.sudo_cmd = "sudo -n" if enable_sudo else ""
self.enable_remote_logging = self.params.get(
"enable_remote_logging", os.path.join(test_param, "*"), False)
self.enable_scrubber = self.params.get(
Expand Down
6 changes: 4 additions & 2 deletions src/tests/ftest/util/soak_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import slurm_utils
from avocado.core.exceptions import TestFail
from avocado.utils.distro import detect
from command_utils import command_as_user
from command_utils_base import EnvironmentVariables
from daos_racer_utils import DaosRacerCommand
from data_mover_utils import DcpCommand, FsCopy
Expand Down Expand Up @@ -494,7 +495,7 @@ def launch_reboot(self, pools, name, results, args):
self.log.info(
"<<<PASS %s: %s started on ranks %s at %s >>>\n", self.loop, name, ranks, time.ctime())
# reboot host in 1 min
result = run_remote(self.log, reboot_host, "sudo shutdown -r +1")
result = run_remote(self.log, reboot_host, command_as_user("shutdown -r +1", "root"))
if result.passed:
status = True
else:
Expand Down Expand Up @@ -533,7 +534,8 @@ def launch_reboot(self, pools, name, results, args):
# issue a restart
self.log.info("<<<PASS %s: Issue systemctl restart daos_server on %s at %s>>>\n",
self.loop, name, reboot_host, time.ctime())
cmd_results = run_remote(self.log, reboot_host, "sudo systemctl restart daos_server")
cmd_results = run_remote(
self.log, reboot_host, command_as_user("systemctl restart daos_server", "root"))
if cmd_results.passed:
self.dmg_command.system_query()
for pool in pools:
Expand Down

0 comments on commit 0ae5b72

Please sign in to comment.