diff options
author | Simon McVittie <smcv@collabora.com> | 2018-01-03 08:23:10 +0000 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-04 12:32:47 +0000 |
commit | 994cd66744e559c92644f36028c6c262605ad75a (patch) | |
tree | a7203a5994fe761f47fee008a0301c6319feedd8 /tests/basic-test.sh | |
parent | 95f9b392a44974a91bd3bf61e33779cdedda29e7 (diff) | |
download | ostree-994cd66744e559c92644f36028c6c262605ad75a.tar.gz |
tests: Assert that byte-order is swapped on LE but not BE CPUs
Closes: #1392
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1393
Approved by: cgwalters
Diffstat (limited to 'tests/basic-test.sh')
-rw-r--r-- | tests/basic-test.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh index 87cb9fa2..c4eb9cad 100644 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -759,8 +759,20 @@ $OSTREE show --print-metadata-key=FOO test2 > test2-meta assert_file_has_content test2-meta "BAR" $OSTREE show --print-metadata-key=KITTENS test2 > test2-meta assert_file_has_content test2-meta "CUTE" + $OSTREE show --print-metadata-key=SOMENUM test2 > test2-meta -assert_file_has_content test2-meta "uint64 3026418949592973312" +case "$("${test_builddir}/get-byte-order")" in + (4321) + assert_file_has_content test2-meta "uint64 42" + ;; + (1234) + assert_file_has_content test2-meta "uint64 3026418949592973312" + ;; + (*) + fatal "neither little-endian nor big-endian?" + ;; +esac + $OSTREE show -B --print-metadata-key=SOMENUM test2 > test2-meta assert_file_has_content test2-meta "uint64 42" $OSTREE show --print-detached-metadata-key=SIGNATURE test2 > test2-meta |