]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/.../osd-scrub-test.sh: don't use /etc/fstab to corrupt the data
authorSamuel Just <sjust@redhat.com>
Thu, 23 Feb 2023 00:27:47 +0000 (16:27 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 23 Feb 2023 00:27:47 +0000 (16:27 -0800)
Generally, it's more portable not to rely on specific system files to be
readable.  Specifically, container environments may not have an fstab.
Instead, just generate another random file.

Signed-off-by: Samuel Just <sjust@redhat.com>
qa/standalone/scrub/osd-scrub-test.sh

index d9e11be9bd20bc2a2135c50f31d5897e73b5391c..c88e0bec1e04658d591cb80e721c029de14d16e1 100755 (executable)
@@ -75,7 +75,10 @@ function TEST_scrub_test() {
       local anotherosd="2"
     fi
 
-    objectstore_tool $dir $anotherosd obj1 set-bytes /etc/fstab
+    CORRUPT_DATA="corrupt-data.$$"
+    dd if=/dev/urandom of=$CORRUPT_DATA bs=512 count=1
+    objectstore_tool $dir $anotherosd obj1 set-bytes $CORRUPT_DATA
+    rm -f $CORRUPT_DATA
 
     local pgid="${poolid}.0"
     pg_deep_scrub "$pgid" || return 1