diff options
author | Richard W.M. Jones <[email protected]> | 2012-06-09 20:18:09 +0100 |
---|---|---|
committer | Richard W.M. Jones <[email protected]> | 2012-06-09 20:18:09 +0100 |
commit | 20137c8731d142797e2476e35fe724c95a8a7a06 (patch) | |
tree | 7bc249388cfe91f4fe605019bd06562726766606 /fish | |
parent | ac2f9a42fbdacbea4840f9334ed50575f1006089 (diff) | |
download | libguestfs-20137c8731d142797e2476e35fe724c95a8a7a06.tar.gz libguestfs-20137c8731d142797e2476e35fe724c95a8a7a06.tar.xz libguestfs-20137c8731d142797e2476e35fe724c95a8a7a06.zip |
fish: Change test-escapes so test is not endian-sensitive.
The test used the external 'od' command to compare the output of
guestfish with what it's supposed to be. Unfortunately by default
this outputs groups of 2-byte words, with the words' endianness
affected by the current hardware endianness. For example:
x86-64$ echo -n ab | od
0000000 061141
0000002
ppc64$ echo -n ab | od
0000000 060542
0000002
By using 'od -b' instead we can output bytes instead of words, and
there is no endianness issue, and the output is clearer:
x86-64$ echo -n ab | od -b
0000000 141 142
0000002
ppc64$ echo -n ab | od -b
0000000 141 142
0000002
Diffstat (limited to 'fish')
-rwxr-xr-x | fish/test-escapes.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fish/test-escapes.sh b/fish/test-escapes.sh index 4cd3cf2e..79762e53 100755 --- a/fish/test-escapes.sh +++ b/fish/test-escapes.sh @@ -22,7 +22,7 @@ set -e rm -f test.output test.error test.error.old -./guestfish <<'EOF' 2>test.error | od > test.output +./guestfish <<'EOF' 2>test.error | od -b > test.output echo "" echo " " echo " " @@ -75,8 +75,8 @@ command arguments not separated by whitespace" ]; then fi if [ "$(cat test.output)" != "\ -0000000 020012 020012 005040 005012 005015 005012 000412 000412 -0000020 040012 000012 +0000000 012 040 012 040 040 012 012 012 015 012 012 012 012 001 012 001 +0000020 012 100 012 0000023" ]; then echo "unexpected stdout from guestfish:" cat test.output |