Skip to content

Commit 8279624

Browse files
committed
vhd-tool: Add read_headers_interval to the cram test
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
1 parent 6477bd0 commit 8279624

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ocaml/vhd-tool/cli/read_headers.t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ Check if the right clusters are found to be allocated (legacy JSON format)
99
$ ./main.exe read_headers test.vhd
1010
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[0,1,2,13,14,15]}
1111

12+
Check if the right clusters are found to be allocated (interval-based JSON format)
13+
$ ./main.exe read_headers_interval test.vhd
14+
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[[0,2],[13,15]]}
15+
1216
Check fully allocated file
1317
$ dd if=/dev/random of=test.raw bs=2097152 count=16 > /dev/null 2>&1
1418
$ qemu-img convert -f raw -O vpc test.raw test.vhd
1519
$ ./main.exe read_headers test.vhd
1620
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]}
21+
$ ./main.exe read_headers_interval test.vhd
22+
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[[0,15]]}
1723

1824
Check empty file
1925
$ dd if=/dev/zero of=test.raw bs=2097152 count=16 > /dev/null 2>&1
2026
$ qemu-img convert -f raw -O vpc test.raw test.vhd
2127
$ ./main.exe read_headers test.vhd
2228
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[]}
29+
$ ./main.exe read_headers_interval test.vhd
30+
{"virtual_size":33562624,"cluster_bits":21,"data_clusters":[]}

0 commit comments

Comments
 (0)