summaryrefslogtreecommitdiff
path: root/tests/basic-test.sh
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-01-03 08:23:10 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-04 12:32:47 +0000
commit994cd66744e559c92644f36028c6c262605ad75a (patch)
treea7203a5994fe761f47fee008a0301c6319feedd8 /tests/basic-test.sh
parent95f9b392a44974a91bd3bf61e33779cdedda29e7 (diff)
downloadostree-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.sh14
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