summaryrefslogtreecommitdiff
path: root/tests/gpt-header-munge
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2014-04-08 17:08:22 -0700
committerBrian C. Lane <bcl@redhat.com>2014-04-10 09:28:59 -0700
commitdbcd731411369cd40c842ca492988308b444c42c (patch)
tree53b45da0512c724d58a8ae65b9c9ce53d86bf4e0 /tests/gpt-header-munge
parent2ee70befff05e6d5004df7491b373445531318e7 (diff)
downloadparted-dbcd731411369cd40c842ca492988308b444c42c.tar.gz
testing: Use little-endian packing in gpt tests
Fix gpt-header-move.py and gpt-header-munge to use little endian when packing and unpacking. This allows us to turn the t0210 and t0211 tests back on for big-endian systems. * tests/gpt-header-move.py: Use little endian for pack/unpack * tests/gpt-header-munge: Same * tests/t-lib-helpers.sh: Add requires_64bit_ that checks for x86_64 and ppc64 * tests/t0210-gpt-resized-partition-entry-array.sh: Remove x86_64 test * tests/t0211-gpt-rewrite-header.sh: Same
Diffstat (limited to 'tests/gpt-header-munge')
-rwxr-xr-xtests/gpt-header-munge6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/gpt-header-munge b/tests/gpt-header-munge
index e7d3d43..5c0dd80 100755
--- a/tests/gpt-header-munge
+++ b/tests/gpt-header-munge
@@ -107,7 +107,7 @@ sub check_GPT_header ($$$)
}
# Save a copy of the CRC, then zero that field, bytes 16..19:
- my $orig_crc = unpack ('L', substr ($buf, 16, 4));
+ my $orig_crc = unpack ('L<', substr ($buf, 16, 4));
substr ($buf, 16, 4) = "\0" x 4;
# Compute CRC32 of header: it'd better match.
@@ -133,7 +133,7 @@ sub set_CRCs ($$$$)
# Compute CRC of primary partition array and put it in substr ($pri, 88, 4)
my $pa_crc = partition_array_crc $pri_or_backup, $n_pe, $in;
- substr ($$buf, 88, 4) = pack ('L', $pa_crc);
+ substr ($$buf, 88, 4) = pack ('L<', $pa_crc);
# In the backup header, we must also set the 8-byte "Partition entries
# starting LBA number" field to reflect our new value of $n_pe.
@@ -151,7 +151,7 @@ sub set_CRCs ($$$$)
# slot into which we'll store the result.
substr ($$buf, 16, 4) = "\0" x 4;
my $crc = crc32($$buf);
- substr ($$buf, 16, 4) = pack ('L', $crc);
+ substr ($$buf, 16, 4) = pack ('L<', $crc);
}
sub usage ($)