ut/rpc: wrap syscalls using spdk.mock.unittest.mk

spdk.mock.unittest.mk contains platform specific definitions to wrap
syscalls. Allow SPDK_MOCK_SYSCALLS to be predefined before it is
included to extend the list of syscalls to be wrapped. Update rpc
Makefile to use this mechanism so that the platform specific definitions
are used.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: If51c0e7a31cf0eda45a844cb8cfa579efe173c42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9621
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Nick Connolly 2021-09-24 13:08:29 +01:00 committed by Keith Lucas
parent 1834811734
commit 367875d455
2 changed files with 7 additions and 2 deletions

View File

@ -30,7 +30,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
SPDK_MOCK_SYSCALLS = \
SPDK_MOCK_SYSCALLS += \
calloc \
pthread_mutexattr_init \
pthread_mutex_init \

View File

@ -35,6 +35,11 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
TEST_FILE = rpc_ut.c
LDFLAGS +=-Wl,--wrap,open -Wl,--wrap,close -Wl,--wrap,unlink -Wl,--wrap,flock
SPDK_MOCK_SYSCALLS = \
open \
close \
flock \
unlink
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk