From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- .../test_ceph-erasure-code-tool.sh | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 src/test/ceph-erasure-code-tool/test_ceph-erasure-code-tool.sh (limited to 'src/test/ceph-erasure-code-tool') diff --git a/src/test/ceph-erasure-code-tool/test_ceph-erasure-code-tool.sh b/src/test/ceph-erasure-code-tool/test_ceph-erasure-code-tool.sh new file mode 100755 index 000000000..442e7ada5 --- /dev/null +++ b/src/test/ceph-erasure-code-tool/test_ceph-erasure-code-tool.sh @@ -0,0 +1,43 @@ +#!/bin/sh -ex + +TMPDIR=/tmp/test_ceph-erasure-code-tool.$$ +mkdir $TMPDIR +trap "rm -fr $TMPDIR" 0 + +ceph-erasure-code-tool test-plugin-exists INVALID_PLUGIN && exit 1 +ceph-erasure-code-tool test-plugin-exists jerasure + +ceph-erasure-code-tool validate-profile \ + plugin=jerasure,technique=reed_sol_van,k=2,m=1 + +test "$(ceph-erasure-code-tool validate-profile \ + plugin=jerasure,technique=reed_sol_van,k=2,m=1 chunk_count)" = 3 + +test "$(ceph-erasure-code-tool calc-chunk-size \ + plugin=jerasure,technique=reed_sol_van,k=2,m=1 4194304)" = 2097152 + +dd if="$(which ceph-erasure-code-tool)" of=$TMPDIR/data bs=770808 count=1 +cp $TMPDIR/data $TMPDIR/data.orig + +ceph-erasure-code-tool encode \ + plugin=jerasure,technique=reed_sol_van,k=2,m=1 \ + 4096 \ + 0,1,2 \ + $TMPDIR/data +test -f $TMPDIR/data.0 +test -f $TMPDIR/data.1 +test -f $TMPDIR/data.2 + +rm $TMPDIR/data + +ceph-erasure-code-tool decode \ + plugin=jerasure,technique=reed_sol_van,k=2,m=1 \ + 4096 \ + 0,2 \ + $TMPDIR/data + +size=$(stat -c '%s' $TMPDIR/data.orig) +truncate -s "${size}" $TMPDIR/data # remove stripe width padding +cmp $TMPDIR/data.orig $TMPDIR/data + +echo OK -- cgit v1.2.3