]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/encoding/readable.sh: add non-whole type skip 6932/head
authorIgor Podoski <igor.podoski@ts.fujitsu.com>
Wed, 2 Dec 2015 06:25:00 +0000 (07:25 +0100)
committerIgor Podoski <igor.podoski@ts.fujitsu.com>
Tue, 15 Dec 2015 11:08:17 +0000 (12:08 +0100)
With this modification there will be possibility to skip only one/few
object/s of particular type, not whole type as it was before.

Before:
- To skip whole TYPE create file named TYPE in forward_incompat
directory.

Now:
- To skip whole TYPE create file or empty directory named TYPE in
forward_incompat directory.
- To skip one/few object/s of TYPE create directory named TYPE in
forward_incompat and put into symbolic links to objects that
you wantt to skip.

Signed-off-by: Igor Podoski <igor.podoski@ts.fujitsu.com>
src/test/encoding/readable.sh

index f1cc7f4b8622a8d6021d7d0b83b8c3aaa3776d41..2116f45fb3da1e0a02e93c725a44e71a31903e1b 100755 (executable)
@@ -27,6 +27,7 @@ for arversion in `ls -v $dir/archive`; do
 
       # is there a fwd incompat change between $arversion and $version?
       incompat=""
+      incompat_paths=""
       sawarversion=0
       for iv in `ls -v $dir/archive`; do
         if [ "$iv" = "$arversion" ]; then
@@ -35,6 +36,17 @@ for arversion in `ls -v $dir/archive`; do
 
         if [ $sawarversion -eq 1 ] && [ -e "$dir/archive/$iv/forward_incompat/$type" ]; then
           incompat="$iv"
+
+          # Check if we'll be ignoring only specified objects, not whole type. If so, remember
+          # all paths for this type into variable. Assuming that this path won't contain any
+          # whitechars (implication of above for loop).
+          if [ -d "$dir/archive/$iv/forward_incompat/$type" ]; then
+            if [ -n "`ls -v $dir/archive/$iv/forward_incompat/$type/`" ]; then
+              incompat_paths="$incompat_paths $dir/archive/$iv/forward_incompat/$type"
+            else
+              echo "type $type directory empty, ignoring whole type instead of single objects"
+            fi;
+          fi
         fi
 
         if [ "$iv" = "$version" ]; then
@@ -43,11 +55,35 @@ for arversion in `ls -v $dir/archive`; do
       done
 
       if [ -n "$incompat" ]; then
-        echo "skipping incompat $type version $arversion, changed at $incompat < code $myversion"
-        continue
+        if [ -z "$incompat_paths" ]; then
+          echo "skipping incompat $type version $arversion, changed at $incompat < code $myversion"
+          continue
+        else
+          # If we are ignoring not whole type, but objects that are in $incompat_path,
+          # we don't skip here, just give info.
+          echo "postponed skip one of incompact $type version $arversion, changed at $incompat < code $myversion"
+        fi;
       fi
 
       for f in `ls $vdir/objects/$type`; do
+
+        skip=0;
+        # Check if processed object $f of $type should be skipped (postponed skip)
+        if [ -n "$incompat_paths" ]; then
+            for i_path in $incompat_paths; do
+              # Check if $f is a symbolic link and if it's pointing to existing target
+              if [ -L "$i_path/$f" ]; then
+                echo "skipping object $f of type $type"
+                skip=1
+                break
+              fi;
+            done;
+        fi;
+
+        if [ $skip -ne 0 ]; then
+          continue
+        fi;
+
         #echo "\t$vdir/$type/$f"
         if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1; then
           echo "**** failed to decode $vdir/objects/$type/$f ****"