commit:     a60bcdc8ce5eec6674d5e28afa2bd4899d137508
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 13 17:33:30 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Sep 13 17:34:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a60bcdc8

net-firewall/nftables: drop RESTRICT="test? ( userpriv )"

Instead, check for root and skip the relevant tests otherwise.

Closes: https://bugs.gentoo.org/869989
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-firewall/nftables/nftables-1.0.4-r2.ebuild | 8 ++++++--
 net-firewall/nftables/nftables-1.0.5.ebuild    | 8 ++++++--
 net-firewall/nftables/nftables-9999.ebuild     | 8 ++++++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/net-firewall/nftables/nftables-1.0.4-r2.ebuild 
b/net-firewall/nftables/nftables-1.0.4-r2.ebuild
index 0da0a19b311e..a1e256654082 100644
--- a/net-firewall/nftables/nftables-1.0.4-r2.ebuild
+++ b/net-firewall/nftables/nftables-1.0.4-r2.ebuild
@@ -29,7 +29,7 @@ fi
 LICENSE="GPL-2"
 SLOT="0/1"
 IUSE="debug doc +gmp json libedit +modern-kernel python +readline static-libs 
test xtables"
-RESTRICT="test? ( userpriv ) !test? ( test )"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=net-libs/libmnl-1.0.4:0=
@@ -123,7 +123,11 @@ src_compile() {
 src_test() {
        emake check
 
-       edo tests/shell/run-tests.sh -v
+       if [[ ${EUID} == 0 ]]; then
+               edo tests/shell/run-tests.sh -v
+       else
+               ewarn "Skipping shell tests (requires root)"
+       fi
 
        # Need to rig up Python eclass if using this, but it doesn't seem to 
work
        # for me anyway.

diff --git a/net-firewall/nftables/nftables-1.0.5.ebuild 
b/net-firewall/nftables/nftables-1.0.5.ebuild
index 24d357de9872..b6fdb61bd493 100644
--- a/net-firewall/nftables/nftables-1.0.5.ebuild
+++ b/net-firewall/nftables/nftables-1.0.5.ebuild
@@ -29,7 +29,7 @@ fi
 LICENSE="GPL-2"
 SLOT="0/1"
 IUSE="debug doc +gmp json libedit +modern-kernel python +readline static-libs 
test xtables"
-RESTRICT="test? ( userpriv ) !test? ( test )"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=net-libs/libmnl-1.0.4:0=
@@ -120,7 +120,11 @@ src_compile() {
 src_test() {
        emake check
 
-       edo tests/shell/run-tests.sh -v
+       if [[ ${EUID} == 0 ]]; then
+               edo tests/shell/run-tests.sh -v
+       else
+               ewarn "Skipping shell tests (requires root)"
+       fi
 
        # Need to rig up Python eclass if using this, but it doesn't seem to 
work
        # for me anyway.

diff --git a/net-firewall/nftables/nftables-9999.ebuild 
b/net-firewall/nftables/nftables-9999.ebuild
index 24d357de9872..b6fdb61bd493 100644
--- a/net-firewall/nftables/nftables-9999.ebuild
+++ b/net-firewall/nftables/nftables-9999.ebuild
@@ -29,7 +29,7 @@ fi
 LICENSE="GPL-2"
 SLOT="0/1"
 IUSE="debug doc +gmp json libedit +modern-kernel python +readline static-libs 
test xtables"
-RESTRICT="test? ( userpriv ) !test? ( test )"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=net-libs/libmnl-1.0.4:0=
@@ -120,7 +120,11 @@ src_compile() {
 src_test() {
        emake check
 
-       edo tests/shell/run-tests.sh -v
+       if [[ ${EUID} == 0 ]]; then
+               edo tests/shell/run-tests.sh -v
+       else
+               ewarn "Skipping shell tests (requires root)"
+       fi
 
        # Need to rig up Python eclass if using this, but it doesn't seem to 
work
        # for me anyway.

Reply via email to