From c20d6110163a28bad83065d0a1f8d03fc2232c9e Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Thu, 29 Apr 2021 23:22:54 -0500 Subject: [PATCH] Drop the unnecessary sudo from probe tests While innocently running probe tests that usued to work, they started dropping to [sudo] prompt and hang. Apparently, someone added an harmless-looking sudo, but this does not work if the testing user does not have sudo priviletes. The code checks very explicitly above that these operations would be allowed, and thus the sudo is unnecessary. We can just omit it, and get probe tests working again. Change-Id: I654c3d954711d4892ff43d7a8df7c3248cdf7aff --- test/probe/test_object_partpower_increase.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/probe/test_object_partpower_increase.py b/test/probe/test_object_partpower_increase.py index 1d6f735e62..da21953688 100755 --- a/test/probe/test_object_partpower_increase.py +++ b/test/probe/test_object_partpower_increase.py @@ -16,7 +16,7 @@ import os from errno import EEXIST -from shutil import copyfile +from shutil import copyfile, move from tempfile import mkstemp from time import time from unittest import main @@ -68,10 +68,8 @@ class TestPartPowerIncrease(ProbeTest): copyfile(self.builder_file, backup_name) # Restore original ring - os.system('sudo mv %s %s' % ( - self.ring_file_backup, self.ring_file)) - os.system('sudo mv %s %s' % ( - self.builder_file_backup, self.builder_file)) + move(self.ring_file_backup, self.ring_file) + move(self.builder_file_backup, self.builder_file) def _find_objs_ondisk(self, container, obj): locations = []