commit:     0375a7b2b589d7ffe2b73a3426d8c0abd4f4b38e
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 16 06:59:57 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Apr 16 07:04:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0375a7b2

net-analyzer/greenbone-feed-sync: drop config file patching in src_test

It turns out that, first, this is not necessary. At least I do not get
sandbox violations in src_test(). Second, it was broken anyways, as it
used $TARGET which is not defined in src_test() (only in python_test()).

Also drop the "${WORKDIR}/${P}" part used in the sed, simply exploit the
fact that we are in "${WORKDIR}/${P}" at this moment and use a relative
path.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 .../greenbone-feed-sync/greenbone-feed-sync-24.3.0.ebuild  | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0.ebuild 
b/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0.ebuild
index b4e72dcf6899..8bf819ca6397 100644
--- a/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0.ebuild
+++ b/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0.ebuild
@@ -36,15 +36,6 @@ RDEPEND="
 distutils_enable_tests unittest
 
 src_test() {
-       # Make a copy of the original config
-       cp "${WORKDIR}/${P}/greenbone/feed/sync/config.py" 
"${WORKDIR}/${P}/greenbone/feed/sync/config.py.orig" || die
-
-       # Patch the config.py to avoid sandbox violation.
-       sed -i \
-               -e 's:DEFAULT_CONFIG_FILE = 
"/etc/gvm/greenbone-feed-sync.toml":DEFAULT_CONFIG_FILE = 
"'"${WORKDIR}/${P}-${TARGET}"'/install/etc/gvm/greenbone-feed-sync.toml":' \
-               -e 's:DEFAULT_ENTERPRISE_KEY_PATH = 
"/etc/gvm/greenbone-enterprise-feed-key":DEFAULT_ENTERPRISE_KEY_PATH = 
"'"${WORKDIR}/${P}-${TARGET}"'/install/etc/gvm/greenbone-enterprise-feed-key":' 
\
-               "${WORKDIR}/${P}/greenbone/feed/sync/config.py" || die
-
        # Disable tests that require network access.
        sed -i \
                -e 's:test_do_not_run_as_root:_&:' \
@@ -54,12 +45,9 @@ src_test() {
                -e 's:test_sync_nvts_verbose:_&:' \
                -e 's:test_sync_nvts:_&:' \
                -e 's:test_sync_nvts_error:_&:' \
-                   "${WORKDIR}/${P}"/tests/test_main.py || die
+                       tests/test_main.py || die
 
        distutils-r1_src_test
-
-       # Restore config.py after test.
-       mv "${WORKDIR}/${P}/greenbone/feed/sync/config.py.orig" 
"${WORKDIR}/${P}/greenbone/feed/sync/config.py" || die
 }
 
 python_install() {

Reply via email to