File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -888,32 +888,32 @@ function test_tell_output_file()
888888 # only one line of json
889889 expect_true sed ' 2q1' < /tmp/foo > /dev/null
890890 expect_true jq -e ' .version | length > 0' < /tmp/foo
891- rm -f /tmp/foo
891+ sudo rm -f /tmp/foo
892892
893893 J=$( ceph tell --format=json-pretty --daemon-output-file=/tmp/foo " $name " version)
894894 expect_true jq -e ' .path == "/tmp/foo"' <<< " $J"
895895 expect_true test -e /tmp/foo
896896 # more than one line of json
897897 expect_false sed ' 2q1' < /tmp/foo > /dev/null
898898 expect_true jq -e ' .version | length > 0' < /tmp/foo
899- rm -f /tmp/foo
899+ sudo rm -f /tmp/foo
900900
901901 # Test --daemon-output-file=:tmp:
902902 J=$( ceph tell --format=json --daemon-output-file=" :tmp:" " $name " version)
903903 path=$( jq -r .path <<< " $J" )
904904 expect_true test -e " $path "
905905 # only one line of json
906- expect_true sed ' 2q1' < " $path " > /dev/null
907- expect_true jq -e ' .version | length > 0' < " $path "
908- rm -f " $path "
906+ expect_true sudo sh -c " sed '2q1' < \ "$path \ " > /dev/null"
907+ expect_true sudo sudo sh -c " jq -e '.version | length > 0' < \ "$path \" "
908+ sudo rm -f " $path "
909909
910910 J=$( ceph tell --format=json-pretty --daemon-output-file=" :tmp:" " $name " version)
911911 path=$( jq -r .path <<< " $J" )
912912 expect_true test -e " $path "
913913 # only one line of json
914- expect_false sed ' 2q1' < " $path " > /dev/null
915- expect_true jq -e ' .version | length > 0' < " $path "
916- rm -f " $path "
914+ expect_false sudo sh -c " sed '2q1' < \ "$path \ " > /dev/null"
915+ expect_true sudo sh -c " jq -e '.version | length > 0' < \ "$path \" "
916+ sudo rm -f " $path "
917917}
918918
919919function test_mds_tell()
You can’t perform that action at this time.
0 commit comments