test/make: fix the confirm_abi_deps test.
I reversed the arguments to abidiff when I first submitted this test which was causing additions to be reported as removals and vice versa. Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: Iac50243f7cda7c1f9c2302af13a34eca844e0689 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1705 Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
3509378604
commit
4021f34520
@ -34,8 +34,8 @@
|
|||||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
|
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||||
|
|
||||||
SO_VER := 2
|
SO_VER := 3
|
||||||
SO_MINOR := 1
|
SO_MINOR := 0
|
||||||
SO_SUFFIX := $(SO_VER).$(SO_MINOR)
|
SO_SUFFIX := $(SO_VER).$(SO_MINOR)
|
||||||
|
|
||||||
C_SRCS = bdev_nvme.c bdev_nvme_rpc.c nvme_rpc.c common.c bdev_ocssd.c bdev_ocssd_rpc.c
|
C_SRCS = bdev_nvme.c bdev_nvme_rpc.c nvme_rpc.c common.c bdev_ocssd.c bdev_ocssd_rpc.c
|
||||||
|
@ -11,6 +11,7 @@ source "$rootdir/test/common/autotest_common.sh"
|
|||||||
libdir="$rootdir/build/lib"
|
libdir="$rootdir/build/lib"
|
||||||
libdeps_file="$rootdir/mk/spdk.lib_deps.mk"
|
libdeps_file="$rootdir/mk/spdk.lib_deps.mk"
|
||||||
source_abi_dir="$HOME/spdk_20_01/build/lib"
|
source_abi_dir="$HOME/spdk_20_01/build/lib"
|
||||||
|
suppression_file="$HOME/abigail_suppressions.ini"
|
||||||
|
|
||||||
function confirm_abi_deps() {
|
function confirm_abi_deps() {
|
||||||
local processed_so=0
|
local processed_so=0
|
||||||
@ -25,6 +26,8 @@ function confirm_abi_deps() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
touch $suppression_file
|
||||||
|
|
||||||
for object in "$libdir"/libspdk_*.so; do
|
for object in "$libdir"/libspdk_*.so; do
|
||||||
so_file=$(basename $object)
|
so_file=$(basename $object)
|
||||||
if [ ! -f "$source_abi_dir/$so_file" ]; then
|
if [ ! -f "$source_abi_dir/$so_file" ]; then
|
||||||
@ -32,9 +35,9 @@ function confirm_abi_deps() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! abidiff $libdir/$so_file $source_abi_dir/$so_file --leaf-changes-only --stat > /dev/null; then
|
if ! abidiff $source_abi_dir/$so_file $libdir/$so_file --leaf-changes-only --suppressions $suppression_file --stat > /dev/null; then
|
||||||
found_abi_change=false
|
found_abi_change=false
|
||||||
output=$(abidiff $libdir/$so_file $source_abi_dir/$so_file --leaf-changes-only --stat) || true
|
output=$(abidiff $source_abi_dir/$so_file $libdir/$so_file --leaf-changes-only --suppressions $suppression_file --stat) || true
|
||||||
new_so_maj=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1)
|
new_so_maj=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1)
|
||||||
new_so_min=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f2)
|
new_so_min=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f2)
|
||||||
old_so_maj=$(readlink $source_abi_dir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1)
|
old_so_maj=$(readlink $source_abi_dir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1)
|
||||||
@ -42,6 +45,8 @@ function confirm_abi_deps() {
|
|||||||
so_name_changed=$(grep "ELF SONAME changed" <<< "$output") || so_name_changed="No"
|
so_name_changed=$(grep "ELF SONAME changed" <<< "$output") || so_name_changed="No"
|
||||||
function_summary=$(grep "functions summary" <<< "$output")
|
function_summary=$(grep "functions summary" <<< "$output")
|
||||||
variable_summary=$(grep "variables summary" <<< "$output")
|
variable_summary=$(grep "variables summary" <<< "$output")
|
||||||
|
# remove any filtered out variables.
|
||||||
|
variable_summary=$(sed "s/ [()][^)]*[)]//g" <<< "$variable_summary")
|
||||||
|
|
||||||
read -r _ _ _ removed_functions _ changed_functions _ added_functions _ <<< "$function_summary"
|
read -r _ _ _ removed_functions _ changed_functions _ added_functions _ <<< "$function_summary"
|
||||||
read -r _ _ _ removed_vars _ changed_vars _ added_vars _ <<< "$variable_summary"
|
read -r _ _ _ removed_vars _ changed_vars _ added_vars _ <<< "$variable_summary"
|
||||||
@ -75,12 +80,18 @@ function confirm_abi_deps() {
|
|||||||
echo "SO name for $so_file changed without a change to abi. please revert that change."
|
echo "SO name for $so_file changed without a change to abi. please revert that change."
|
||||||
touch $fail_file
|
touch $fail_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$new_so_maj" != "$old_so_maj" ] && [ "$new_so_min" != "0" ]; then
|
||||||
|
echo "SO major version for $so_file was bumped. Please reset the minor version to 0."
|
||||||
|
touch $fail_file
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
processed_so=$((processed_so+1))
|
processed_so=$((processed_so+1))
|
||||||
done
|
done
|
||||||
|
rm -f $suppression_file
|
||||||
echo "Processed $processed_so objects."
|
echo "Processed $processed_so objects."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user