[Open-scap] [PATCH 2/4] Add ./run script.

Richard W.M. Jones rjones at redhat.com
Mon Apr 15 14:02:44 UTC 2013


From: "Richard W.M. Jones" <rjones at redhat.com>

In libguestfs & libvirt we have very successfully use a ./run script
in the top level directory to set environment variables so the program
can be run from the local directory.

eg:
  ./run utils/oscap oval eval [...]
or:
  ./run gdb --args utils/oscap oval eval [...]
or from another project that uses openscap libraries:
  ../openscap/run ./another-program

The same idea appears in the utils/oscap-local.sh script, but ./run is
more flexible since it can also be used for tests, or for running any
external program that happens to use the openscap libraries.

As well as being easier to type.
---
 .gitignore                                     |  1 +
 configure.ac                                   |  3 ++
 run.in                                         | 62 ++++++++++++++++++++++++++
 tests/API/OVAL/unittests/Makefile.am           |  9 ++--
 tests/API/OVAL/validate/Makefile.am            | 10 ++---
 tests/API/XCCDF/applicability/Makefile.am      |  9 ++--
 tests/API/XCCDF/default_cpe/Makefile.am        |  9 ++--
 tests/API/XCCDF/fix/Makefile.am                | 10 ++---
 tests/API/XCCDF/guide/Makefile.am              | 10 ++---
 tests/API/XCCDF/parser/Makefile.am             |  6 +--
 tests/API/XCCDF/progress/Makefile.am           | 10 ++---
 tests/API/XCCDF/report/Makefile.am             | 10 ++---
 tests/API/XCCDF/tailoring/Makefile.am          |  9 ++--
 tests/API/XCCDF/unittests/Makefile.am          | 10 ++---
 tests/API/probes/Makefile.am                   |  5 +--
 tests/DS/Makefile.am                           | 11 ++---
 tests/DS/signed/Makefile.am                    | 10 ++---
 tests/DS/validate/Makefile.am                  | 10 ++---
 tests/bindings/Makefile.am                     | 11 +----
 tests/mitre/Makefile.am                        |  9 ++--
 tests/probes/environmentvariable/Makefile.am   |  8 ++--
 tests/probes/environmentvariable58/Makefile.am |  8 ++--
 tests/probes/family/Makefile.am                |  8 ++--
 tests/probes/file/Makefile.am                  |  8 ++--
 tests/probes/fileextendedattribute/Makefile.am |  8 ++--
 tests/probes/filehash/Makefile.am              |  8 ++--
 tests/probes/filehash58/Makefile.am            |  8 ++--
 tests/probes/filemd5/Makefile.am               |  8 ++--
 tests/probes/iflisteners/Makefile.am           |  8 ++--
 tests/probes/interface/Makefile.am             |  8 ++--
 tests/probes/isainfo/Makefile.am               |  7 ++-
 tests/probes/maskattr/Makefile.am              |  9 ++--
 tests/probes/password/Makefile.am              |  8 ++--
 tests/probes/process/Makefile.am               |  8 ++--
 tests/probes/rpminfo/Makefile.am               |  8 ++--
 tests/probes/rpmverify/Makefile.am             |  9 ++--
 tests/probes/runlevel/Makefile.am              |  8 ++--
 tests/probes/selinuxboolean/Makefile.am        |  8 ++--
 tests/probes/shadow/Makefile.am                |  8 ++--
 tests/probes/sysinfo/Makefile.am               |  8 ++--
 tests/probes/textfilecontent54/Makefile.am     |  9 ++--
 tests/probes/uname/Makefile.am                 |  8 ++--
 tests/probes/vgtest/Makefile.am                |  8 ++--
 tests/probes/xinetd/Makefile.am                |  7 ++-
 tests/sce/Makefile.am                          |  7 +--
 tests/schemas/Makefile.am                      | 11 ++---
 utils/oscap-local.sh                           | 35 ++++-----------
 47 files changed, 197 insertions(+), 273 deletions(-)
 create mode 100644 run.in

diff --git a/.gitignore b/.gitignore
index 31d76ce..d9a8108 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ ltmain.sh
 install-sh
 missing
 .dirstamp
+/run
 stamp-*
 .deps/
 .libs/
diff --git a/configure.ac b/configure.ac
index 27f9426..54ad332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1289,6 +1289,9 @@ AC_CONFIG_FILES([Makefile
                  src/SCE/Makefile
                  tests/sce/Makefile])
 
+AC_CONFIG_FILES([run],
+                [chmod +x,-w run])
+
 AC_OUTPUT
 
 echo "******************************************************"
diff --git a/run.in b/run.in
new file mode 100644
index 0000000..6755d51
--- /dev/null
+++ b/run.in
@@ -0,0 +1,62 @@
+#!/bin/bash -
+# openscap 'run' programs locally script
+# Copyright (C) 2011-2013 Red Hat Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#----------------------------------------------------------------------
+
+# With this script you can run oscap without needing to
+# install the utility first.  You just have to do for example:
+#
+#   ./run ./utils/oscap [args ...]
+#
+# This works for any C program or test that uses the openscap
+# libraries.
+
+#----------------------------------------------------------------------
+
+# Find this script.
+b=@abs_builddir@
+
+# Preload testing library.
+export LD_PRELOAD=$b/src/.libs/libopenscap_testing.so${LD_PRELOAD:+:$LD_PRELOAD}
+
+# Set library.
+export LD_LIBRARY_PATH=$b/src/.libs:$b/swig/.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+
+# Set paths to probes, schemas, transformations and cpes.
+export OVAL_PROBE_DIR=$b/src/OVAL/probes${OVAL_PROBE_DIR:+:$OVAL_PROBE_DIR}
+export OSCAP_SCHEMA_PATH=$b/schemas${OSCAP_SCHEMA_PATH:+:$OSCAP_SCHEMA_PATH}
+export OSCAP_XSLT_PATH=$b/xsl${OSCAP_XSLT_PATH:+:$OSCAP_XSLT_PATH}
+export OSCAP_CPE_PATH=$b/cpe${OSCAP_CPE_PATH:+:$OSCAP_CPE_PATH}
+
+# For SWIG bindings.
+export PERL5LIB=$b/swig:$b/swig/.libs${PERL5LIB:+:$PERL5LIB}
+export PYTHONPATH=$b/swig:$b/swig/.libs${PYTHONPATH:+:$PYTHONPATH}
+
+# This is a cheap way to find some use-after-free and uninitialized
+# read problems when using glibc.
+random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)"
+export MALLOC_PERTURB_=$random_val
+
+# Do we have libtool?  If we have it then we can use it to make
+# running valgrind simpler.  However don't depend on it.
+if libtool --help >/dev/null 2>&1; then
+    libtool="libtool --mode=execute"
+fi
+
+# Run the program.
+exec $libtool "$@"
diff --git a/tests/API/OVAL/unittests/Makefile.am b/tests/API/OVAL/unittests/Makefile.am
index 0124527..3ac7f81 100644
--- a/tests/API/OVAL/unittests/Makefile.am
+++ b/tests/API/OVAL/unittests/Makefile.am
@@ -4,13 +4,10 @@ DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/OVAL/validate/Makefile.am b/tests/API/OVAL/validate/Makefile.am
index 027e452..2883688 100644
--- a/tests/API/OVAL/validate/Makefile.am
+++ b/tests/API/OVAL/validate/Makefile.am
@@ -3,14 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-				  OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-                  OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/applicability/Makefile.am b/tests/API/XCCDF/applicability/Makefile.am
index 5b3bdb0..4f01f24 100644
--- a/tests/API/XCCDF/applicability/Makefile.am
+++ b/tests/API/XCCDF/applicability/Makefile.am
@@ -1,12 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/default_cpe/Makefile.am b/tests/API/XCCDF/default_cpe/Makefile.am
index ff23e2d..07cb333 100644
--- a/tests/API/XCCDF/default_cpe/Makefile.am
+++ b/tests/API/XCCDF/default_cpe/Makefile.am
@@ -1,12 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/fix/Makefile.am b/tests/API/XCCDF/fix/Makefile.am
index 7ecd64b..533026c 100644
--- a/tests/API/XCCDF/fix/Makefile.am
+++ b/tests/API/XCCDF/fix/Makefile.am
@@ -1,13 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/guide/Makefile.am b/tests/API/XCCDF/guide/Makefile.am
index 6b88cfe..d5b7d47 100644
--- a/tests/API/XCCDF/guide/Makefile.am
+++ b/tests/API/XCCDF/guide/Makefile.am
@@ -1,13 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/parser/Makefile.am b/tests/API/XCCDF/parser/Makefile.am
index 281b9ac..88cf007 100644
--- a/tests/API/XCCDF/parser/Makefile.am
+++ b/tests/API/XCCDF/parser/Makefile.am
@@ -19,11 +19,7 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.out*
 CLEANFILES = *.log *.out*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		  OSCAP_CPE_PATH=$(top_srcdir)/cpe
+TESTS_ENVIRONMENT= $(top_builddir)/run
 
 TESTS = test_api_xccdf.sh
 check_PROGRAMS = test_api_xccdf
diff --git a/tests/API/XCCDF/progress/Makefile.am b/tests/API/XCCDF/progress/Makefile.am
index 1397e1e..ff36efe 100644
--- a/tests/API/XCCDF/progress/Makefile.am
+++ b/tests/API/XCCDF/progress/Makefile.am
@@ -1,13 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/report/Makefile.am b/tests/API/XCCDF/report/Makefile.am
index 7ecd64b..533026c 100644
--- a/tests/API/XCCDF/report/Makefile.am
+++ b/tests/API/XCCDF/report/Makefile.am
@@ -1,13 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/tailoring/Makefile.am b/tests/API/XCCDF/tailoring/Makefile.am
index 6418755..2e5afda 100644
--- a/tests/API/XCCDF/tailoring/Makefile.am
+++ b/tests/API/XCCDF/tailoring/Makefile.am
@@ -1,12 +1,9 @@
 DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		builddir=$(top_builddir)
+TESTS_ENVIRONMENT= \
+		builddir=$(top_builddir) \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/API/XCCDF/unittests/Makefile.am b/tests/API/XCCDF/unittests/Makefile.am
index 381e942..53da27d 100644
--- a/tests/API/XCCDF/unittests/Makefile.am
+++ b/tests/API/XCCDF/unittests/Makefile.am
@@ -26,14 +26,10 @@ DISTCLEANFILES = *.log *.out* $(check_DATA)
 CLEANFILES = *.log *.out* $(check_DATA)
 
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-		LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-		OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 check_PROGRAMS = \
diff --git a/tests/API/probes/Makefile.am b/tests/API/probes/Makefile.am
index f2eea90..e803ae4 100644
--- a/tests/API/probes/Makefile.am
+++ b/tests/API/probes/Makefile.am
@@ -22,10 +22,7 @@ DISTCLEANFILES = *.log *.out*
 CLEANFILES = *.log *.out*
 
 TESTS_ENVIRONMENT = \
-	LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-	LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-	OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-	$(SHELL) -x
+		$(top_builddir)/run $(SHELL) -x
 TESTS = all.sh
 check_PROGRAMS = test_api_probes_smoke oval_fts_list
 
diff --git a/tests/DS/Makefile.am b/tests/DS/Makefile.am
index 3f2a0e3..9788e7d 100644
--- a/tests/DS/Makefile.am
+++ b/tests/DS/Makefile.am
@@ -3,15 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-# We use absolute paths for LD_* because relative paths would break tests
-# whenever cd/pushd is used in them.
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(shell cd $(top_builddir); pwd)/src/OVAL/probes \
-                  LD_PRELOAD=$(shell cd $(top_builddir); pwd)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(shell cd $(top_builddir); pwd)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(shell cd $(top_srcdir); pwd)/schemas \
-				  OSCAP_CPE_PATH=$(shell cd $(top_srcdir); pwd)/cpe \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-                  OSCAP_FULL_VALIDATION=1
+                OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_ds.sh
 
diff --git a/tests/DS/signed/Makefile.am b/tests/DS/signed/Makefile.am
index f394667..8e78312 100644
--- a/tests/DS/signed/Makefile.am
+++ b/tests/DS/signed/Makefile.am
@@ -3,14 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-				  OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-				  OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-				  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/DS/validate/Makefile.am b/tests/DS/validate/Makefile.am
index c3834ab..8e9defa 100644
--- a/tests/DS/validate/Makefile.am
+++ b/tests/DS/validate/Makefile.am
@@ -3,14 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-				  OSCAP_CPE_PATH=$(top_srcdir)/cpe \
-				  OSCAP_XSLT_PATH=$(top_srcdir)/xsl \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-				  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/bindings/Makefile.am b/tests/bindings/Makefile.am
index 3de6750..dacfa5c 100644
--- a/tests/bindings/Makefile.am
+++ b/tests/bindings/Makefile.am
@@ -3,15 +3,8 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-# We use absolute paths for LD_* because relative paths would break tests
-# whenever cd/pushd is used in them.
-TESTS_ENVIRONMENT =	OVAL_PROBE_DIR=$(shell cd $(top_builddir); pwd)/src/OVAL/probes \
-			LD_PRELOAD=$(shell cd $(top_builddir); pwd)/src/.libs/libopenscap_testing.so \
-			LD_LIBRARY_PATH=$(shell cd $(top_builddir); pwd)/src/.libs:$(shell cd $(top_builddir); pwd)/swig/.libs \
-			PYTHONPATH=$(shell cd $(top_builddir); pwd)/swig:$(shell cd $(top_srcdir); pwd)/swig:$(shell cd $(top_builddir); pwd)/swig/.libs \
-			PERL5LIB=$(shell cd $(top_builddir); pwd)/swig:$(shell cd $(top_srcdir); pwd)/swig:$(shell cd $(top_builddir); pwd)/swig/.libs \
-			OSCAP_SCHEMA_PATH=$(shell cd $(top_srcdir); pwd)/schemas \
-			OSCAP_CPE_PATH=$(shell cd $(top_srcdir); pwd)/cpe
+TESTS_ENVIRONMENT = \
+		$(top_builddir)/run
 
 TESTS =
 if WANT_PYTHON
diff --git a/tests/mitre/Makefile.am b/tests/mitre/Makefile.am
index 4216148..928a0d3 100644
--- a/tests/mitre/Makefile.am
+++ b/tests/mitre/Makefile.am
@@ -3,13 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-				  OSCAP_CPE_PATH=$(top_srcdir)/cpe \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_mitre.sh
 
diff --git a/tests/probes/environmentvariable/Makefile.am b/tests/probes/environmentvariable/Makefile.am
index 5aa8fa6..bcf5892 100644
--- a/tests/probes/environmentvariable/Makefile.am
+++ b/tests/probes/environmentvariable/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_environmentvariable.sh
 
diff --git a/tests/probes/environmentvariable58/Makefile.am b/tests/probes/environmentvariable58/Makefile.am
index bd13683..62f2e58 100644
--- a/tests/probes/environmentvariable58/Makefile.am
+++ b/tests/probes/environmentvariable58/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_environmentvariable58.sh
 
diff --git a/tests/probes/family/Makefile.am b/tests/probes/family/Makefile.am
index c694dcf..bda9010 100644
--- a/tests/probes/family/Makefile.am
+++ b/tests/probes/family/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log results.xml oscap_debug.log.*
 CLEANFILES = *.log results.xml oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_family.sh
 
diff --git a/tests/probes/file/Makefile.am b/tests/probes/file/Makefile.am
index dd191dd..08b2c36 100644
--- a/tests/probes/file/Makefile.am
+++ b/tests/probes/file/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log results.xml
 CLEANFILES = *.log results.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_file.sh
 
diff --git a/tests/probes/fileextendedattribute/Makefile.am b/tests/probes/fileextendedattribute/Makefile.am
index f00a574..014deda 100644
--- a/tests/probes/fileextendedattribute/Makefile.am
+++ b/tests/probes/fileextendedattribute/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log results.xml
 CLEANFILES = *.log results.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_fileextendedattribute.sh
 
diff --git a/tests/probes/filehash/Makefile.am b/tests/probes/filehash/Makefile.am
index 5c39f31..6e619e3 100644
--- a/tests/probes/filehash/Makefile.am
+++ b/tests/probes/filehash/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_filehash.sh
 
diff --git a/tests/probes/filehash58/Makefile.am b/tests/probes/filehash58/Makefile.am
index cf1546d..8b8bd76 100644
--- a/tests/probes/filehash58/Makefile.am
+++ b/tests/probes/filehash58/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_filehash58.sh
 
diff --git a/tests/probes/filemd5/Makefile.am b/tests/probes/filemd5/Makefile.am
index 80a6a39..aad8b0a 100644
--- a/tests/probes/filemd5/Makefile.am
+++ b/tests/probes/filemd5/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_filemd5.sh
 
diff --git a/tests/probes/iflisteners/Makefile.am b/tests/probes/iflisteners/Makefile.am
index 119c911..9695a1b 100644
--- a/tests/probes/iflisteners/Makefile.am
+++ b/tests/probes/iflisteners/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_iflisteners.sh
 
diff --git a/tests/probes/interface/Makefile.am b/tests/probes/interface/Makefile.am
index 4186aba..d702596 100644
--- a/tests/probes/interface/Makefile.am
+++ b/tests/probes/interface/Makefile.am
@@ -6,12 +6,10 @@ CLEANFILES = *.log *.xml
 check_PROGRAMS = test_probes_interface
 test_probes_interface_SOURCES = test_probes_interface.c
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_interface.sh
 
diff --git a/tests/probes/isainfo/Makefile.am b/tests/probes/isainfo/Makefile.am
index 7a9ddbf..02aac01 100644
--- a/tests/probes/isainfo/Makefile.am
+++ b/tests/probes/isainfo/Makefile.am
@@ -3,11 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = oscap_debug.log.*
 CLEANFILES = oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_isainfo.sh
 
diff --git a/tests/probes/maskattr/Makefile.am b/tests/probes/maskattr/Makefile.am
index 0fa637d..a20b7dc 100644
--- a/tests/probes/maskattr/Makefile.am
+++ b/tests/probes/maskattr/Makefile.am
@@ -6,12 +6,9 @@ DISTCLEANFILES = \
 CLEANFILES = $(DISTCLEANFILES)
 
 TESTS_ENVIRONMENT = \
-	LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-	LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-	builddir=$(top_builddir) \
-	OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-	OSCAP_FULL_VALIDATION=1 \
-	OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes
+		builddir=$(top_builddir) \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 if WANT_PROBES_UNIX
 if probe_file_enabled
diff --git a/tests/probes/password/Makefile.am b/tests/probes/password/Makefile.am
index 1fb0e6d..15e8fa0 100644
--- a/tests/probes/password/Makefile.am
+++ b/tests/probes/password/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_password.sh
 
diff --git a/tests/probes/process/Makefile.am b/tests/probes/process/Makefile.am
index 64a1a4b..37271a4 100644
--- a/tests/probes/process/Makefile.am
+++ b/tests/probes/process/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_process.sh
 
diff --git a/tests/probes/rpminfo/Makefile.am b/tests/probes/rpminfo/Makefile.am
index 56ebf93..136a9c8 100644
--- a/tests/probes/rpminfo/Makefile.am
+++ b/tests/probes/rpminfo/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_rpminfo.sh
 
diff --git a/tests/probes/rpmverify/Makefile.am b/tests/probes/rpmverify/Makefile.am
index 777fcac..2c8b19c 100644
--- a/tests/probes/rpmverify/Makefile.am
+++ b/tests/probes/rpmverify/Makefile.am
@@ -6,12 +6,9 @@ DISTCLEANFILES = \
 CLEANFILES = $(DISTCLEANFILES)
 
 TESTS_ENVIRONMENT = \
-	LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-	LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-	builddir=$(top_builddir) \
-	OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-	OSCAP_FULL_VALIDATION=1 \
-	OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes
+		builddir=$(top_builddir) \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 if WANT_PROBES_LINUX
 if probe_rpmverify_enabled
diff --git a/tests/probes/runlevel/Makefile.am b/tests/probes/runlevel/Makefile.am
index e3dda4e..715dd1d 100644
--- a/tests/probes/runlevel/Makefile.am
+++ b/tests/probes/runlevel/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_runlevel.sh
 
diff --git a/tests/probes/selinuxboolean/Makefile.am b/tests/probes/selinuxboolean/Makefile.am
index c500af8..a1614f3 100644
--- a/tests/probes/selinuxboolean/Makefile.am
+++ b/tests/probes/selinuxboolean/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_selinuxboolean.sh
 
diff --git a/tests/probes/shadow/Makefile.am b/tests/probes/shadow/Makefile.am
index f15ce8c..a97aea9 100644
--- a/tests/probes/shadow/Makefile.am
+++ b/tests/probes/shadow/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_shadow.sh
 
diff --git a/tests/probes/sysinfo/Makefile.am b/tests/probes/sysinfo/Makefile.am
index 4bcb492..cba8d0f 100644
--- a/tests/probes/sysinfo/Makefile.am
+++ b/tests/probes/sysinfo/Makefile.am
@@ -19,11 +19,9 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh \
 DISTCLEANFILES = *.log
 CLEANFILES = *.log
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-		  OSCAP_FULL_VALIDATION=1
+TESTS_ENVIRONMENT= \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_sysinfo.sh
 
diff --git a/tests/probes/textfilecontent54/Makefile.am b/tests/probes/textfilecontent54/Makefile.am
index 65430fc..c28bae0 100644
--- a/tests/probes/textfilecontent54/Makefile.am
+++ b/tests/probes/textfilecontent54/Makefile.am
@@ -6,12 +6,9 @@ CLEANFILES = \
 	*results.xml
 
 TESTS_ENVIRONMENT = \
-	LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-	LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-	builddir=$(top_builddir) \
-	OSCAP_FULL_VALIDATION=1 \
-	OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
-	OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes
+		builddir=$(top_builddir) \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/tests/probes/uname/Makefile.am b/tests/probes/uname/Makefile.am
index 8919599..d3d34b6 100644
--- a/tests/probes/uname/Makefile.am
+++ b/tests/probes/uname/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.xml
 CLEANFILES = *.log *.xml
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_uname.sh
 
diff --git a/tests/probes/vgtest/Makefile.am b/tests/probes/vgtest/Makefile.am
index 6ba0b38..0bdfba0 100644
--- a/tests/probes/vgtest/Makefile.am
+++ b/tests/probes/vgtest/Makefile.am
@@ -3,12 +3,10 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.vglog
 CLEANFILES = *.log *.vglog
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-		  OSCAP_FULL_VALIDATION=1
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = test_probes_vg.sh
 
diff --git a/tests/probes/xinetd/Makefile.am b/tests/probes/xinetd/Makefile.am
index 97f2594..92a693e 100644
--- a/tests/probes/xinetd/Makefile.am
+++ b/tests/probes/xinetd/Makefile.am
@@ -20,10 +20,9 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh \
 DISTCLEANFILES = *.log *.out*
 CLEANFILES = *.log *.out*
 
-TESTS_ENVIRONMENT= LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-		   LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-		   OSCAP_FULL_VALIDATION=1 \
-		   OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes $(SHELL) -x
+TESTS_ENVIRONMENT= \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run $(SHELL) -x
 
 TESTS = test_xinetd_probe.sh
 check_PROGRAMS = test_probe_xinetd
diff --git a/tests/sce/Makefile.am b/tests/sce/Makefile.am
index 754c61f..c4f0b11 100644
--- a/tests/sce/Makefile.am
+++ b/tests/sce/Makefile.am
@@ -3,12 +3,9 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(top_builddir)/src/OVAL/probes \
-                  LD_PRELOAD=$(top_builddir)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(top_srcdir)/schemas \
+TESTS_ENVIRONMENT= \
 		builddir=$(top_builddir) \
-				  OSCAP_CPE_PATH=$(top_srcdir)/cpe
+		$(top_builddir)/run
 
 TESTS = test_sce.sh
 
diff --git a/tests/schemas/Makefile.am b/tests/schemas/Makefile.am
index 6f188dd..5c24722 100644
--- a/tests/schemas/Makefile.am
+++ b/tests/schemas/Makefile.am
@@ -3,14 +3,9 @@ EXTRA_DIST = $(top_srcdir)/tests/test_common.sh
 DISTCLEANFILES = *.log *.results oscap_debug.log.*
 CLEANFILES = *.log *.results oscap_debug.log.*
 
-# We use absolute paths for LD_* because relative paths would break tests
-# whenever cd/pushd is used in them.
-TESTS_ENVIRONMENT=OVAL_PROBE_DIR=$(shell cd $(top_builddir); pwd)/src/OVAL/probes \
-                  LD_PRELOAD=$(shell cd $(top_builddir); pwd)/src/.libs/libopenscap_testing.so \
-                  LD_LIBRARY_PATH=$(shell cd $(top_builddir); pwd)/src/.libs \
-                  OSCAP_SCHEMA_PATH=$(shell cd $(top_srcdir); pwd)/schemas \
-				  OSCAP_CPE_PATH=$(shell cd $(top_srcdir); pwd)/cpe \
-                  OSCAP_FULL_VALIDATION=1
+TESTS_ENVIRONMENT= \
+		OSCAP_FULL_VALIDATION=1 \
+		$(top_builddir)/run
 
 TESTS = all.sh
 
diff --git a/utils/oscap-local.sh b/utils/oscap-local.sh
index 999c64a..550a711 100755
--- a/utils/oscap-local.sh
+++ b/utils/oscap-local.sh
@@ -1,27 +1,8 @@
-#
-# Use this to run local oscap tool build
-
-# Usage example:
-# $ ./oscap-local.sh gdb --args .libs/oscap xccdf eval ...
-if [ $# -eq 0 ]; then
-	echo "Usage: \"$ ./oscap-local.sh .libs/oscap xccdf eval ...\"";
-fi
-
-# parent directory of the script, this is so that you can cd anywhere
-# and still be able to run oscap or various tests, etc...
-PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-PREFIX="$PARENT_DIR/.."
-
-# Preload testing library that accept various environment variables
-export LD_PRELOAD="$PREFIX/src/.libs/libopenscap_testing.so"
-export LD_LIBRARY_PATH="$PREFIX/src/.libs"
-
-# Set paths to probes, schemas, transformations and cpes
-export OVAL_PROBE_DIR="$PREFIX/src/OVAL/probes"
-export OSCAP_SCHEMA_PATH="$PREFIX/schemas"
-export OSCAP_XSLT_PATH="$PREFIX/xsl"
-export OSCAP_CPE_PATH="$PREFIX/cpe"
-
-# Execution part
-exec "$@"
-
+echo "Use the following command instead:"
+echo
+echo "  ../run" "$@"
+echo
+echo "where '../run' is the path to the script called 'run' in the"
+echo "top level build directory."
+
+exit 1
-- 
1.8.1.4




More information about the Open-scap-list mailing list