[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 59/69] iotests: Add peek_file* functions
From: |
Max Reitz |
Subject: |
[PULL 59/69] iotests: Add peek_file* functions |
Date: |
Mon, 28 Oct 2019 13:14:51 +0100 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/common.rc | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 12b4751848..fa7bae2422 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -53,6 +53,26 @@ poke_file()
printf "$3" | dd "of=$1" bs=1 "seek=$2" conv=notrunc &>/dev/null
}
+# peek_file_le 'test.img' 512 2 => 65534
+peek_file_le()
+{
+ # Wrap in echo $() to strip spaces
+ echo $(od -j"$2" -N"$3" --endian=little -An -vtu"$3" "$1")
+}
+
+# peek_file_be 'test.img' 512 2 => 65279
+peek_file_be()
+{
+ # Wrap in echo $() to strip spaces
+ echo $(od -j"$2" -N"$3" --endian=big -An -vtu"$3" "$1")
+}
+
+# peek_file_raw 'test.img' 512 2 => '\xff\xfe'
+peek_file_raw()
+{
+ dd if="$1" bs=1 skip="$2" count="$3" status=none
+}
+
if ! . ./common.config
then
--
2.21.0
- [PULL 44/69] mirror: Do not dereference invalid pointers, (continued)
- [PULL 44/69] mirror: Do not dereference invalid pointers, Max Reitz, 2019/10/28
- [PULL 45/69] include: Move endof() up from hw/virtio/virtio.h, Max Reitz, 2019/10/28
- [PULL 46/69] qcow2: Use endof(), Max Reitz, 2019/10/28
- [PULL 49/69] qcow2: Make qcow2_write_snapshots() public, Max Reitz, 2019/10/28
- [PULL 47/69] qcow2: Add Error ** to qcow2_read_snapshots(), Max Reitz, 2019/10/28
- [PULL 51/69] qcow2: Write v3-compliant snapshot list on upgrade, Max Reitz, 2019/10/28
- [PULL 50/69] qcow2: Put qcow2_upgrade() into its own function, Max Reitz, 2019/10/28
- [PULL 53/69] qcow2: Add qcow2_check_fix_snapshot_table(), Max Reitz, 2019/10/28
- [PULL 48/69] qcow2: Keep unknown extra snapshot data, Max Reitz, 2019/10/28
- [PULL 62/69] block/cor: Drop cor_co_truncate(), Max Reitz, 2019/10/28
- [PULL 59/69] iotests: Add peek_file* functions,
Max Reitz <=
- [PULL 52/69] qcow2: Separate qcow2_check_read_snapshot_table(), Max Reitz, 2019/10/28
- [PULL 54/69] qcow2: Fix broken snapshot table entries, Max Reitz, 2019/10/28
- [PULL 57/69] qcow2: Repair snapshot table with too many entries, Max Reitz, 2019/10/28
- [PULL 55/69] qcow2: Keep track of the snapshot table length, Max Reitz, 2019/10/28
- [PULL 58/69] qcow2: Fix v3 snapshot table entry compliancy, Max Reitz, 2019/10/28
- [PULL 61/69] block: Handle filter truncation like native impl., Max Reitz, 2019/10/28
- [PULL 63/69] block: Do not truncate file node when formatting, Max Reitz, 2019/10/28
- [PULL 56/69] qcow2: Fix overly long snapshot tables, Max Reitz, 2019/10/28
- [PULL 65/69] block: Evaluate @exact in protocol drivers, Max Reitz, 2019/10/28
- [PULL 60/69] iotests: Test qcow2's snapshot table handling, Max Reitz, 2019/10/28