Merge pull request #842 from sm00th/unit-submodule

Unittests submodule
This commit is contained in:
Joe Lawrence 2018-04-26 14:20:56 -04:00 committed by GitHub
commit 404111f635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 14 additions and 204 deletions

3
.gitattributes vendored
View File

@ -1,3 +0,0 @@
*.ORIG.o filter=lfs diff=lfs merge=lfs -text
*.PATCHED.o filter=lfs diff=lfs merge=lfs -text
*.PATCHED.FAIL.o filter=lfs diff=lfs merge=lfs -text

4
.gitignore vendored
View File

@ -7,10 +7,6 @@
*.swp *.swp
*.d *.d
*.so *.so
*.test.out
!*.ORIG.o
!*.PATCHED.o
!*.PATCHED.FAIL.o
.tmp_versions .tmp_versions
Module.symvers Module.symvers
kmod/core/.cache.mk kmod/core/.cache.mk

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "test/unit/objs"]
path = test/unit/objs
url = https://github.com/dynup/kpatch-unit-test-objs.git

View File

@ -1,7 +1,11 @@
ARCH=$(shell uname -m) ARCH = $(shell uname -m)
OBJDIR ?= objs/$(ARCH)
all: Makefile.include $(ARCH)/Makefile .PHONY: all clean
$(MAKE) -C $(ARCH)
clean: Makefile.include $(ARCH)/Makefile all: Makefile.include
$(MAKE) -C $(ARCH) clean git submodule update --init --rebase
$(MAKE) -C $(OBJDIR)
clean: Makefile.include
$(MAKE) -C $(OBJDIR) clean

View File

@ -12,7 +12,7 @@ MUTE_FAIL := >/dev/null 2>&1
.SILENT: $(TARGETS) $(TEST_TARGETS) .SILENT: $(TARGETS) $(TEST_TARGETS)
endif endif
SRC_PATH ?= $(realpath ../../../) SRC_PATH ?= $(realpath ../../../../)
CDO ?= $(SRC_PATH)/kpatch-build/create-diff-object CDO ?= $(SRC_PATH)/kpatch-build/create-diff-object
TEST_LIBRARY ?= $(SRC_PATH)/test/test-functions.sh TEST_LIBRARY ?= $(SRC_PATH)/test/test-functions.sh
@ -22,12 +22,6 @@ TEST_ENV = KPATCH_TEST_LIBRARY=$(TEST_LIBRARY)
TARGETS = $(patsubst %.$(EXT_ORIG),%.$(EXT_OUTPUT),$(wildcard *.$(EXT_ORIG))) TARGETS = $(patsubst %.$(EXT_ORIG),%.$(EXT_OUTPUT),$(wildcard *.$(EXT_ORIG)))
TEST_TARGETS = $(patsubst %.$(EXT_TEST),%.$(EXT_TEST_OUTPUT),$(wildcard *.$(EXT_TEST))) TEST_TARGETS = $(patsubst %.$(EXT_TEST),%.$(EXT_TEST_OUTPUT),$(wildcard *.$(EXT_TEST)))
define check_lfs =
$(if $(shell head -1 $(1) | grep git-lfs.github.com),
$(error $(1) is not fetched. Unittests require https://git-lfs.github.com/),
)
endef
define check_stripped = define check_stripped =
$(if $(shell readelf --debug-dump $(1)), $(if $(shell readelf --debug-dump $(1)),
$(error $(1) is not properly stripped, use 'strip --strip-debug --keep-file-symbols $(1)' to fix this), $(error $(1) is not properly stripped, use 'strip --strip-debug --keep-file-symbols $(1)' to fix this),
@ -35,7 +29,6 @@ define check_stripped =
endef endef
define check_all = define check_all =
$(call check_lfs,$(1))
$(call check_stripped,$(1)) $(call check_stripped,$(1))
endef endef

1
test/unit/objs Submodule

@ -0,0 +1 @@
Subproject commit 5e9ba838509a38817bf394fdbb43b4f1ce5a9229

View File

@ -1 +0,0 @@
include ../Makefile.include

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c90532c33be3e1059d1c4e11e8a0a45b910397628bb7ad23d257d1f5793743fb
size 44992

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a5d756499e91c19b712ca0534c3469bb0576941ae649f51d21505643719b8f2
size 45272

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c49c9fdd4df5bac01c1abe0947c404393a4e9d6654f2c883e0413f9d54b3962
size 157736

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22f6c80ae9217515a773d9298297c7beca7715aef356e57e698bbe46bd383b79
size 157984

View File

@ -1,9 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1
bind=$(nm $1 |awk '/__kmalloc/ {print $2}')
[[ $bind = 't' ]] || exit 1
exit 0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c82d4048941bbe8fb85dae796eec63ad838925150cd740aec18fa506132b52f5
size 9528

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ae5708808a8ef41d1d6dda664871b3a4351291c6cba7de6257db96a467ea5dc
size 9608

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74577f1c6457f5dd2d46997377ef57a22f75644cf6f1239699b4d566c9a391c0
size 315504

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e7c643e5e190617a08d8625d8cecc979d48b00de171bdc048bdecdd7cbe14aeb
size 315616

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3564e932091cad1ebea8e3124ff2e695a6cdeb2e77385cb28b2864f02da0a409
size 25760

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:792c261bef5723fa88f5c2a546fdf8d54737c8ecb979ed09d1ba7f3ce299a389
size 26048

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:550e34f0e1ad732f6fb2adee2b8ef40c23959770f3885a99b03387df1ca8b479
size 9696

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f71d13f5f4f31dc025ef9a270d7afbb3eb591d09b56a604e578ae23d05d43ff
size 10344

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf616b62df11ad10b14707061ba24a4711107680612eb13deab2668d55d36a7f
size 71704

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d60e3a1f928b7a526f8f1a150bdd29487cd85e9d0b47516fd73b641c57af9fee
size 71704

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0529108c62c58a736a1cdc88f9d5b32d5230705b9d5e44baf56ee1bc563516ad
size 28600

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:735b1f6eb57d75ad0fd188a7ed0bcf4ca8afb96d9ed19e4421825f65ac04271e
size 29232

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3d2d05a244e8c0006968e71f2fffc71eee0286e4b7dbbe5880a8e51eedb3625
size 75720

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1545d26ae126d67e7b8545db1e9060ed7fcd27e5868e7d7e82a3e23bee76fca0
size 77224

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 5

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c82d4048941bbe8fb85dae796eec63ad838925150cd740aec18fa506132b52f5
size 9528

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:78203d10a0e5140ab608ff932932e3ec6cb807e609a59c50b6d908b45821a694
size 9608

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c82d4048941bbe8fb85dae796eec63ad838925150cd740aec18fa506132b52f5
size 9528

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5feaf8bfa5d9195bc4566e644324c0992ca318b2191b5090b645ce0cae690ca1
size 9688

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:550e34f0e1ad732f6fb2adee2b8ef40c23959770f3885a99b03387df1ca8b479
size 9696

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2db6c477940a25d879a91b92d2913f7f268602187d81be551d7623e3caed0f49
size 9696

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7269c12c89ea0f716fdc7859912540708917c49ca877a9c4c68484ba99aa8878
size 35912

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e25c16a5039a5300f3816f40b93f7e0dc8976dfc0a637f77937ec60f83fb82fb
size 36176

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:383827483e470394fb5d41fce5d9a71de2b281974b034a3415062902df198dec
size 547392

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f54a179c6a4abb64557016221a283c71fcdda2c524b9688dfc2730b35d22e251
size 547680

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8718b5b17db29fbf52f82eb40cfcd36c4f79e119e368f61321ab6578399c3cf1
size 16784

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb7a7b77873bb58768fd9c23fc56f1d1890530fac83290349db6bbaa8eb05c1e
size 17088

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2331c16208f12843c84eb277fb63c7564e1b930f45632e4e423064413606a861
size 525184

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6db5ec7322ebc78086c8334235453c9fc99119447f02fcbdc2883936a88bc5a5
size 525888

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b901d86e5d599e6a88c12431df55a465d7afa2939af779b8dc720bbafa56522a
size 89288

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2cd61e78c41a68816a93a0de97a2d30043c5279f0e5c80ad2692321ff0d6f4b
size 89760

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f00c311e4b79b03805ccd367e3ea889cef25c3f5db887b9c871ce1f200aa59e
size 95048

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:198143f177fa687b07cc3f35f6af262a3901514416a4f69d4bbc701164f427d3
size 95280

View File

@ -1,4 +0,0 @@
#!/bin/bash
source $KPATCH_TEST_LIBRARY
assert_num_funcs 1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e3dd874c11ffe5f92fbaf3cd4975e93b991896963a329b12d45828a45a63f50
size 267648

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:152b15d618ed8c2ae3476bf179147a02501920b948e81ad15d6e8e124d456933
size 267648