]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test_librados_build.sh: use branch name printed by librados-config 31693/head
authorKefu Chai <kchai@redhat.com>
Sun, 17 Nov 2019 15:44:51 +0000 (23:44 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 17 Nov 2019 17:29:52 +0000 (01:29 +0800)
Fixes: https://tracker.ceph.com/issues/42782
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/rados/test_librados_build.sh

index 41500151cb54bf0055dc36d2b162b13184c0e980..fbd7b0784a68013abe24201f998a911a8abf5899 100755 (executable)
@@ -22,7 +22,17 @@ hello_world_cpp
 "
 BINARIES="${BINARIES_TO_RUN}hello_radosstriper_cpp
 "
-DL_PREFIX="http://git.ceph.com/?p=ceph.git;a=blob_plain;hb=master;f=examples/librados/"
+# parse output like "octopus (dev)"
+case $(librados-config --release | grep -Po ' \(\K[^\)]+') in
+    dev)
+        BRANCH=master;;
+    rc|stable)
+        BRANCH=$(librados-config --release | cut -d' ' -f1);;
+    *)
+        echo "unknown release '$(librados-config --release)'" >&2
+        return 1;;
+esac
+DL_PREFIX="http://git.ceph.com/?p=ceph.git;a=blob_plain;hb=${BRANCH};f=examples/librados/"
 #DL_PREFIX="https://raw.githubusercontent.com/ceph/ceph/master/examples/librados/"
 DESTDIR=$(pwd)