From: Laura Flores Date: Thu, 11 Jul 2024 22:20:50 +0000 (-0500) Subject: qa/workunits/cephtool: add extra privileges to cephtool script X-Git-Tag: v20.0.0~1521^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F58566%2Fhead;p=ceph.git qa/workunits/cephtool: add extra privileges to cephtool script This is more of a workaround to an issue in the infrastructure where files are made with root privileges, causing permission issues when operations are used on them without sudo. Fixes: https://tracker.ceph.com/issues/66881 Signed-off-by: Laura Flores --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index ee8b6029a52dc..89fdcaf05933a 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -888,7 +888,7 @@ function test_tell_output_file() # only one line of json expect_true sed '2q1' < /tmp/foo > /dev/null expect_true jq -e '.version | length > 0' < /tmp/foo - rm -f /tmp/foo + sudo rm -f /tmp/foo J=$(ceph tell --format=json-pretty --daemon-output-file=/tmp/foo "$name" version) expect_true jq -e '.path == "/tmp/foo"' <<<"$J" @@ -896,24 +896,24 @@ function test_tell_output_file() # more than one line of json expect_false sed '2q1' < /tmp/foo > /dev/null expect_true jq -e '.version | length > 0' < /tmp/foo - rm -f /tmp/foo + sudo rm -f /tmp/foo # Test --daemon-output-file=:tmp: J=$(ceph tell --format=json --daemon-output-file=":tmp:" "$name" version) path=$(jq -r .path <<<"$J") expect_true test -e "$path" # only one line of json - expect_true sed '2q1' < "$path" > /dev/null - expect_true jq -e '.version | length > 0' < "$path" - rm -f "$path" + expect_true sudo sh -c "sed '2q1' < \"$path\" > /dev/null" + expect_true sudo sudo sh -c "jq -e '.version | length > 0' < \"$path\"" + sudo rm -f "$path" J=$(ceph tell --format=json-pretty --daemon-output-file=":tmp:" "$name" version) path=$(jq -r .path <<<"$J") expect_true test -e "$path" # only one line of json - expect_false sed '2q1' < "$path" > /dev/null - expect_true jq -e '.version | length > 0' < "$path" - rm -f "$path" + expect_false sudo sh -c "sed '2q1' < \"$path\" > /dev/null" + expect_true sudo sh -c "jq -e '.version | length > 0' < \"$path\"" + sudo rm -f "$path" } function test_mds_tell()