mirror of
https://github.com/dynup/kpatch
synced 2025-01-03 11:12:01 +00:00
integration: dynamic module list in multiple.test
Dynamically compile module list based on -LOADED.test files in all multiple.test scripts. The scripts is now the same across all three directories so it might be good to deduplicate it somehow along with other common tests. Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
parent
7c774350fc
commit
70f9221c01
@ -4,6 +4,10 @@ SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
|
||||
ROOTDIR="$(readlink -f $SCRIPTDIR/../../..)"
|
||||
KPATCH="sudo $ROOTDIR/kpatch/kpatch"
|
||||
|
||||
MODULE_PREFIX="test-"
|
||||
MODULE_POSTFIX=".ko"
|
||||
TEST_POSTFIX="-LOADED.test"
|
||||
|
||||
set -o errexit
|
||||
|
||||
die() {
|
||||
@ -12,12 +16,17 @@ die() {
|
||||
}
|
||||
|
||||
ko_to_test() {
|
||||
tmp=${1%.ko}-LOADED.test
|
||||
echo ${tmp#test-}
|
||||
tmp=${1%${MODULE_POSTFIX}}${TEST_POSTFIX}
|
||||
echo ${tmp#${MODULE_PREFIX}}
|
||||
}
|
||||
|
||||
# make sure any modules added here are disjoint
|
||||
declare -a modules=(test-cmdline-string.ko test-meminfo-string.ko)
|
||||
declare -a modules
|
||||
|
||||
for file in "${SCRIPTDIR}"/*"${TEST_POSTFIX}"; do
|
||||
name=$(basename ${file})
|
||||
modules+=(${MODULE_PREFIX}${name%${TEST_POSTFIX}}${MODULE_POSTFIX})
|
||||
done
|
||||
|
||||
for mod in "${modules[@]}"; do
|
||||
testprog=$(ko_to_test $mod)
|
||||
|
@ -4,6 +4,10 @@ SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
|
||||
ROOTDIR="$(readlink -f $SCRIPTDIR/../../..)"
|
||||
KPATCH="sudo $ROOTDIR/kpatch/kpatch"
|
||||
|
||||
MODULE_PREFIX="test-"
|
||||
MODULE_POSTFIX=".ko"
|
||||
TEST_POSTFIX="-LOADED.test"
|
||||
|
||||
set -o errexit
|
||||
|
||||
die() {
|
||||
@ -12,12 +16,17 @@ die() {
|
||||
}
|
||||
|
||||
ko_to_test() {
|
||||
tmp=${1%.ko}-LOADED.test
|
||||
echo ${tmp#test-}
|
||||
tmp=${1%${MODULE_POSTFIX}}${TEST_POSTFIX}
|
||||
echo ${tmp#${MODULE_PREFIX}}
|
||||
}
|
||||
|
||||
# make sure any modules added here are disjoint
|
||||
declare -a modules=(test-data-new.ko test-shadow-newpid.ko)
|
||||
declare -a modules
|
||||
|
||||
for file in "${SCRIPTDIR}"/*"${TEST_POSTFIX}"; do
|
||||
name=$(basename ${file})
|
||||
modules+=(${MODULE_PREFIX}${name%${TEST_POSTFIX}}${MODULE_POSTFIX})
|
||||
done
|
||||
|
||||
for mod in "${modules[@]}"; do
|
||||
testprog=$(ko_to_test $mod)
|
||||
|
@ -4,6 +4,10 @@ SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
|
||||
ROOTDIR="$(readlink -f $SCRIPTDIR/../../..)"
|
||||
KPATCH="sudo $ROOTDIR/kpatch/kpatch"
|
||||
|
||||
MODULE_PREFIX="test-"
|
||||
MODULE_POSTFIX=".ko"
|
||||
TEST_POSTFIX="-LOADED.test"
|
||||
|
||||
set -o errexit
|
||||
|
||||
die() {
|
||||
@ -12,12 +16,17 @@ die() {
|
||||
}
|
||||
|
||||
ko_to_test() {
|
||||
tmp=${1%.ko}-LOADED.test
|
||||
echo ${tmp#test-}
|
||||
tmp=${1%${MODULE_POSTFIX}}${TEST_POSTFIX}
|
||||
echo ${tmp#${MODULE_PREFIX}}
|
||||
}
|
||||
|
||||
# make sure any modules added here are disjoint
|
||||
declare -a modules=(test-cmdline-string.ko test-meminfo-string.ko)
|
||||
declare -a modules
|
||||
|
||||
for file in "${SCRIPTDIR}"/*"${TEST_POSTFIX}"; do
|
||||
name=$(basename ${file})
|
||||
modules+=(${MODULE_PREFIX}${name%${TEST_POSTFIX}}${MODULE_POSTFIX})
|
||||
done
|
||||
|
||||
for mod in "${modules[@]}"; do
|
||||
testprog=$(ko_to_test $mod)
|
||||
|
Loading…
Reference in New Issue
Block a user