diff options
author | 2012-12-15 17:14:05 +0000 | |
---|---|---|
committer | 2012-12-15 12:19:02 -0500 | |
commit | 1b8987b294acdcb452c3eefce2c14b4b0385a064 (patch) | |
tree | 75cac7b677a0295cc8c1fec997f04d7ca62535f5 /tests | |
parent | tests/revdeppaxtest: complete test for revdep-pax (diff) | |
download | elfix-1b8987b294acdcb452c3eefce2c14b4b0385a064.tar.gz elfix-1b8987b294acdcb452c3eefce2c14b4b0385a064.tar.bz2 elfix-1b8987b294acdcb452c3eefce2c14b4b0385a064.zip |
tests/paxmodule: no longer require python module to be installed
Diffstat (limited to 'tests')
-rw-r--r-- | tests/paxmodule/Makefile.am | 2 | ||||
-rwxr-xr-x | tests/paxmodule/paxmodtest.sh | 31 |
2 files changed, 28 insertions, 5 deletions
diff --git a/tests/paxmodule/Makefile.am b/tests/paxmodule/Makefile.am index 6c5930d..86f3acb 100644 --- a/tests/paxmodule/Makefile.am +++ b/tests/paxmodule/Makefile.am @@ -9,4 +9,4 @@ check_SCRIPTS = paxmodtest TEST = $(check_SCRIPTS) paxmodtest: - ./paxmodtest.sh 0 + ./paxmodtest.sh 0 $(CFLAGS) diff --git a/tests/paxmodule/paxmodtest.sh b/tests/paxmodule/paxmodtest.sh index b820d5e..319dad5 100755 --- a/tests/paxmodule/paxmodtest.sh +++ b/tests/paxmodule/paxmodtest.sh @@ -1,19 +1,42 @@ #!/bin/bash verbose=${1-0} +shift -PWD=$(pwd) -TESTFILE="${PWD}"/dummy +TESTFILE="$(pwd)/dummy" PAXCTLNG="../../src/paxctl-ng" PYPAXCTL="../../scripts/pypaxctl" -count=0 - echo "================================================================================" echo echo " RUNNIG PAXMODULE TEST" + + +unamem=$(uname -m) +pythonversion=$(python --version 2>&1) +pythonversion=$(echo ${pythonversion} | awk '{ print $2 }') +pythonversion=${pythonversion%\.*} +PYTHONPATH="../../scripts/build/lib.linux-${unamem}-${pythonversion}" + +if [ ! -d ${PYTHONPATH} ]; then + echo " (Re)building pax module" + + #NOTE: the last -D or -U wins as it does for gcc $CFLAGS + for f in $@; do + [ $f = "-UXTPAX" ] && unset XTPAX + [ $f = "-DXTPAX" ] && XTPAX=1 + [ $f = "-UPTPAX" ] && unset PTPAX + [ $f = "-DPTPAX" ] && PTPAX=1 + done + export XTPAX + export PTPAX + + ( cd ../../scripts; exec ./setup.py build ) >/dev/null +fi echo +count=0 + for pf in "p" "P" "-"; do for ef in "e" "E" "-"; do for mf in "m" "M" "-"; do |