On 4/3/20 5:11 AM, Max Reitz wrote:
From time to time, my shell decides to repace the bracketed numbers here
by the numbers inside (i.e., "=== Clusters to be compressed [1]" is
printed as "=== Clusters to be compressed 1").  That makes tests that

Namely, any time your environment has a file named '1' in the directory where you are running iotests.

use common.pattern fail.  Prevent that from happening by quoting the
arguments to all echos in common.pattern.

Signed-off-by: Max Reitz <mre...@redhat.com>
---
  tests/qemu-iotests/common.pattern | 22 +++++++++++-----------
  1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/qemu-iotests/common.pattern 
b/tests/qemu-iotests/common.pattern
index 4f5e5bcea0..4caa5de187 100644
--- a/tests/qemu-iotests/common.pattern
+++ b/tests/qemu-iotests/common.pattern
@@ -23,7 +23,7 @@ do_is_allocated() {
      local count=$4
for ((i=1;i<=$count;i++)); do
-        echo alloc $(( start + (i - 1) * step )) $size
+        echo "alloc $(( start + (i - 1) * step )) $size"

No real change on this line because $size is safe, but also no harm at being consistent, and makes it easier to not have to audit $size for being safe.

      # Write the clusters to be compressed
-    echo === Clusters to be compressed [1]
+    echo '=== Clusters to be compressed [1]'

This one is definitely needed to avoid inadvertent globbing.

      # Read them
-    echo === Read used/compressed clusters
+    echo '=== Read used/compressed clusters'

And this one does not buy any safety, but again consistency doesn't hurt.

Reviewed-by: Eric Blake <ebl...@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to