From 8d3d6bf59aec3877c0231e637270e371d9ed3b8c Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 13 Sep 2014 13:36:09 +0200 Subject: [PATCH] erasure-code: workunit to check for encoding regression Clone the archive of encoded objects and decode all archived objects, up to and including the current ceph version. http://tracker.ceph.com/issues/9420 Refs: #9420 Signed-off-by: Loic Dachary --- .gitmodules | 4 ++ ceph-erasure-code-corpus | 1 + .../encode-decode-non-regression.sh | 38 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 160000 ceph-erasure-code-corpus create mode 100755 qa/workunits/erasure-code/encode-decode-non-regression.sh diff --git a/.gitmodules b/.gitmodules index 0d5258c96babf..dc3712ef25957 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,3 +15,7 @@ path = src/erasure-code/jerasure/gf-complete url = https://github.com/ceph/gf-complete.git branch = v1-ceph +[submodule "ceph-erasure-code-corpus"] + path = ceph-erasure-code-corpus + url = https://github.com/ceph/ceph-erasure-code-corpus.git + diff --git a/ceph-erasure-code-corpus b/ceph-erasure-code-corpus new file mode 160000 index 0000000000000..f6992da17b10e --- /dev/null +++ b/ceph-erasure-code-corpus @@ -0,0 +1 @@ +Subproject commit f6992da17b10e8d51c21ece1a175518918fe1f4f diff --git a/qa/workunits/erasure-code/encode-decode-non-regression.sh b/qa/workunits/erasure-code/encode-decode-non-regression.sh new file mode 100755 index 0000000000000..5ddd25c445c97 --- /dev/null +++ b/qa/workunits/erasure-code/encode-decode-non-regression.sh @@ -0,0 +1,38 @@ +#!/bin/bash -ex +# +# Copyright (C) 2014 Red Hat +# +# Author: Loic Dachary +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library Public License for more details. +# +: ${CORPUS:=https://github.com/dachary/ceph-erasure-code-corpus.git} +: ${DIRECTORY:=../ceph-erasure-code-corpus} + +# when running from sources, the current directory must have precedence +export PATH=:$PATH + +if ! test -d $DIRECTORY ; then + git clone $CORPUS $DIRECTORY +fi + +my_version=v$(ceph --version | cut -f3 -d ' ') + +all_versions=$((ls -d $DIRECTORY/v* ; echo $DIRECTORY/$my_version ) | sort) + +for version in $all_versions ; do + if test -d $version ; then + $version/non-regression.sh + fi + if test $version = $DIRECTORY/$my_version ; then + break + fi +done -- 2.39.5