From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Thu, 28 Sep 2023 08:44:56 +0200
Subject: cts: do not capture the build directory

---
 cts/cts-attrd.in           | 10 ----------
 cts/cts-cli.in             |  8 --------
 cts/cts-exec.in            | 10 ----------
 cts/cts-fencing.in         | 10 ----------
 cts/cts-regression.in      | 10 ----------
 cts/cts-scheduler.in       | 10 ----------
 cts/support/cts-support.in | 10 ----------
 7 files changed, 68 deletions(-)

diff --git a/cts/cts-attrd.in b/cts/cts-attrd.in
index 94eef77..c9d0495 100644
--- a/cts/cts-attrd.in
+++ b/cts/cts-attrd.in
@@ -16,16 +16,6 @@ import subprocess
 import sys
 import tempfile
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 from pacemaker._cts.corosync import Corosync
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
index e85a986..5e9b15c 100644
--- a/cts/cts-cli.in
+++ b/cts/cts-cli.in
@@ -30,14 +30,6 @@ import sys
 from tempfile import NamedTemporaryFile, TemporaryDirectory, mkstemp
 import types
 
-# These imports allow running from a source checkout after running `make`.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker._cts.errors import XmlValidationError
 from pacemaker._cts.validate import validate
 from pacemaker.buildoptions import BuildOptions
diff --git a/cts/cts-exec.in b/cts/cts-exec.in
index 698e9c8..ae76d17 100644
--- a/cts/cts-exec.in
+++ b/cts/cts-exec.in
@@ -22,16 +22,6 @@ import tempfile
 # Prefer the source tree if available
 TEST_DIR = sys.path[0]
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 from pacemaker._cts.corosync import Corosync
diff --git a/cts/cts-fencing.in b/cts/cts-fencing.in
index 30fb39f..a63b016 100644
--- a/cts/cts-fencing.in
+++ b/cts/cts-fencing.in
@@ -16,16 +16,6 @@ import sys
 import subprocess
 import tempfile
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 from pacemaker._cts.corosync import Corosync, localname
diff --git a/cts/cts-regression.in b/cts/cts-regression.in
index 3f1119d..a865184 100644
--- a/cts/cts-regression.in
+++ b/cts/cts-regression.in
@@ -19,16 +19,6 @@ import subprocess
 import sys
 import textwrap
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 
diff --git a/cts/cts-scheduler.in b/cts/cts-scheduler.in
index 86dba9e..04b406c 100644
--- a/cts/cts-scheduler.in
+++ b/cts/cts-scheduler.in
@@ -22,16 +22,6 @@ import subprocess
 import platform
 import tempfile
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 
diff --git a/cts/support/cts-support.in b/cts/support/cts-support.in
index 795a392..acc0b1e 100644
--- a/cts/support/cts-support.in
+++ b/cts/support/cts-support.in
@@ -20,16 +20,6 @@ import shutil
 import subprocess
 import sys
 
-# These imports allow running from a source checkout after running `make`.
-# Note that while this doesn't necessarily mean it will successfully run tests,
-# but being able to see --help output can be useful.
-if os.path.exists("@abs_top_srcdir@/python"):
-    sys.path.insert(0, "@abs_top_srcdir@/python")
-
-# pylint: disable=comparison-of-constants,comparison-with-itself,condition-evals-to-constant
-if os.path.exists("@abs_top_builddir@/python") and "@abs_top_builddir@" != "@abs_top_srcdir@":
-    sys.path.insert(0, "@abs_top_builddir@/python")
-
 from pacemaker.buildoptions import BuildOptions
 from pacemaker.exitstatus import ExitStatus
 
