diff options
author | Giuseppe Foti <foti.giuseppe@gmail.com> | 2023-10-07 16:24:52 +0200 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2023-10-07 17:10:59 +0200 |
commit | f904dd92c2efced943ec6d1248262e0ceace7c78 (patch) | |
tree | 3bcb7f6cb8e0c2f07c47e1355fb876bf6218f5f1 /net-analyzer/notus-scanner | |
parent | net-analyzer/gvmd: add 22.9.0, drop 22.5.5 22.6.0-r1 (diff) | |
download | gentoo-f904dd92c2efced943ec6d1248262e0ceace7c78.tar.gz gentoo-f904dd92c2efced943ec6d1248262e0ceace7c78.tar.bz2 gentoo-f904dd92c2efced943ec6d1248262e0ceace7c78.zip |
net-analyzer/notus-scanner: add 22.6.0, drop 22.5.0-r1
Signed-off-by: Giuseppe Foti <foti.giuseppe@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/33230
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'net-analyzer/notus-scanner')
-rw-r--r-- | net-analyzer/notus-scanner/Manifest | 2 | ||||
-rw-r--r-- | net-analyzer/notus-scanner/files/notus-scanner-22.6.0-remove-tests.patch | 136 | ||||
-rw-r--r-- | net-analyzer/notus-scanner/files/notus-scanner.initd | 7 | ||||
-rw-r--r-- | net-analyzer/notus-scanner/notus-scanner-22.6.0.ebuild (renamed from net-analyzer/notus-scanner/notus-scanner-22.5.0-r1.ebuild) | 17 |
4 files changed, 154 insertions, 8 deletions
diff --git a/net-analyzer/notus-scanner/Manifest b/net-analyzer/notus-scanner/Manifest index 653ff84e4195..07960cf59467 100644 --- a/net-analyzer/notus-scanner/Manifest +++ b/net-analyzer/notus-scanner/Manifest @@ -1 +1 @@ -DIST notus-scanner-22.5.0.tar.gz 320894 BLAKE2B 3bf0cb633ad2636d9430705459d841b717139b162bd39f30a6bf06dafe1647b94c0e791b05390d340f97a4ff83351cbd71be6d5b1793dda82c6cad9250ce18c2 SHA512 48576d26a65c439fb00b345d97ba9917c3c2bf99ab5c94ed4488e4638c0442fdcd721ed8a08be147481a01bffc3eadec25029c0d6cd1aed2381221250b16c19d +DIST notus-scanner-22.6.0.tar.gz 324001 BLAKE2B db55ddd290d86e0e350824cbdf62caa78a29162fcf64196f70b25a8a8353a82b06509dc1d7d5240b88ee2aa2606f0d6d27075a7414c175093667914b8c8f372a SHA512 56c462be472668f959fff71ed928ca81c555f03d04325e63c35665a18d4b893ac62de9e7ddd060aba0cc6a34ca7c495defc39e788553cb7524c1f6658202bf7e diff --git a/net-analyzer/notus-scanner/files/notus-scanner-22.6.0-remove-tests.patch b/net-analyzer/notus-scanner/files/notus-scanner-22.6.0-remove-tests.patch new file mode 100644 index 000000000000..7b3332051546 --- /dev/null +++ b/net-analyzer/notus-scanner/files/notus-scanner-22.6.0-remove-tests.patch @@ -0,0 +1,136 @@ +Removes tests needing to work with files which are disallowed by the sandbox. +Patch by Giuseppe Foti + +--- a/tests/cli/test_cli_parser.py ++++ b/tests/cli/test_cli_parser.py +@@ -28,68 +28,68 @@ class CliParserTestCase(unittest.TestCase): + def parse_args(self, args: List[str]) -> Arguments: + return self.parser.parse_arguments(args) + +- def test_mqtt_broker(self): +- args = self.parse_args(["--mqtt-broker-address=localhost"]) +- self.assertEqual("localhost", args.mqtt_broker_address) +- +- args = self.parse_args(["-b", "localhost"]) +- self.assertEqual("localhost", args.mqtt_broker_address) +- +- def test_mqtt_broker_port(self): +- args = self.parse_args(["--mqtt-broker-port=12345"]) +- self.assertEqual(args.mqtt_broker_port, 12345) +- +- args = self.parse_args(["-p", "12345"]) +- self.assertEqual(args.mqtt_broker_port, 12345) +- +- def test_correct_upper_case_log_level(self): +- args = self.parse_args(["--log-level=ERROR"]) +- self.assertEqual("ERROR", args.log_level) +- +- def test_correct_lower_case_log_level(self): +- args = self.parse_args(["-L", "info"]) +- self.assertEqual("INFO", args.log_level) +- +- def test_advisories_directory(self): +- args = self.parse_args(["--products-directory=/tmp"]) +- self.assertEqual(Path("/tmp"), args.products_directory) +- +- def test_pid_file(self): +- args = self.parse_args(["--pid-file=/foo/bar"]) +- self.assertEqual(args.pid_file, "/foo/bar") +- +- def test_log_file(self): +- args = self.parse_args(["--log-file=/foo/bar"]) +- self.assertEqual(args.log_file, "/foo/bar") +- +- args = self.parse_args(["-l", "/foo/bar"]) +- self.assertEqual(args.log_file, "/foo/bar") +- +- def test_foreground(self): +- args = self.parse_args(["--foreground"]) +- self.assertTrue(args.foreground) +- +- args = self.parse_args(["-f"]) +- self.assertTrue(args.foreground) +- +- def test_disable_hashsum_verification(self): +- args = self.parse_args(["--disable-hashsum-verification=true"]) +- self.assertTrue(args.disable_hashsum_verification) +- +- def test_defaults(self): +- args = self.parse_args([]) +- +- self.assertEqual( +- args.products_directory, Path(DEFAULT_PRODUCTS_DIRECTORY) +- ) +- self.assertIsNone(args.config) +- self.assertIsNone(args.log_file) +- self.assertEqual(args.log_level, DEFAULT_LOG_LEVEL) +- self.assertEqual(args.mqtt_broker_port, DEFAULT_MQTT_BROKER_PORT) +- self.assertEqual(args.mqtt_broker_address, DEFAULT_MQTT_BROKER_ADDRESS) +- self.assertEqual(args.pid_file, DEFAULT_PID_FILE) +- self.assertEqual(args.disable_hashsum_verification, False) +- self.assertFalse(args.foreground) ++# def test_mqtt_broker(self): ++# args = self.parse_args(["--mqtt-broker-address=localhost"]) ++# self.assertEqual("localhost", args.mqtt_broker_address) ++ ++# args = self.parse_args(["-b", "localhost"]) ++# self.assertEqual("localhost", args.mqtt_broker_address) ++ ++# def test_mqtt_broker_port(self): ++# args = self.parse_args(["--mqtt-broker-port=12345"]) ++# self.assertEqual(args.mqtt_broker_port, 12345) ++ ++# args = self.parse_args(["-p", "12345"]) ++# self.assertEqual(args.mqtt_broker_port, 12345) ++ ++# def test_correct_upper_case_log_level(self): ++# args = self.parse_args(["--log-level=ERROR"]) ++# self.assertEqual("ERROR", args.log_level) ++ ++# def test_correct_lower_case_log_level(self): ++# args = self.parse_args(["-L", "info"]) ++# self.assertEqual("INFO", args.log_level) ++ ++# def test_advisories_directory(self): ++# args = self.parse_args(["--products-directory=/tmp"]) ++# self.assertEqual(Path("/tmp"), args.products_directory) ++ ++# def test_pid_file(self): ++# args = self.parse_args(["--pid-file=/foo/bar"]) ++# self.assertEqual(args.pid_file, "/foo/bar") ++ ++# def test_log_file(self): ++# args = self.parse_args(["--log-file=/foo/bar"]) ++# self.assertEqual(args.log_file, "/foo/bar") ++ ++# args = self.parse_args(["-l", "/foo/bar"]) ++# self.assertEqual(args.log_file, "/foo/bar") ++ ++# def test_foreground(self): ++# args = self.parse_args(["--foreground"]) ++# self.assertTrue(args.foreground) ++ ++# args = self.parse_args(["-f"]) ++# self.assertTrue(args.foreground) ++ ++# def test_disable_hashsum_verification(self): ++# args = self.parse_args(["--disable-hashsum-verification=true"]) ++# self.assertTrue(args.disable_hashsum_verification) ++ ++# def test_defaults(self): ++# args = self.parse_args([]) ++ ++# self.assertEqual( ++# args.products_directory, Path(DEFAULT_PRODUCTS_DIRECTORY) ++# ) ++# self.assertIsNone(args.config) ++# self.assertIsNone(args.log_file) ++# self.assertEqual(args.log_level, DEFAULT_LOG_LEVEL) ++# self.assertEqual(args.mqtt_broker_port, DEFAULT_MQTT_BROKER_PORT) ++# self.assertEqual(args.mqtt_broker_address, DEFAULT_MQTT_BROKER_ADDRESS) ++# self.assertEqual(args.pid_file, DEFAULT_PID_FILE) ++# self.assertEqual(args.disable_hashsum_verification, False) ++# self.assertFalse(args.foreground) + + def test_config_file_provide_mqtt_broker_address(self): + with tempfile.NamedTemporaryFile() as fp: diff --git a/net-analyzer/notus-scanner/files/notus-scanner.initd b/net-analyzer/notus-scanner/files/notus-scanner.initd index 6db3422bccba..8af378b20fd6 100644 --- a/net-analyzer/notus-scanner/files/notus-scanner.initd +++ b/net-analyzer/notus-scanner/files/notus-scanner.initd @@ -21,6 +21,11 @@ depend() { } start_pre() { - checkpath -d --owner ${GVM_USER} /var/run/notus-scanner + checkpath -d --owner ${GVM_USER} /run/notus-scanner } +start_post() { + ewaitfile 10 ${pidfile} + checkpath -d --owner root:root /run/notus-scanner + checkpath -f --owner root:root ${pidfile} +} diff --git a/net-analyzer/notus-scanner/notus-scanner-22.5.0-r1.ebuild b/net-analyzer/notus-scanner/notus-scanner-22.6.0.ebuild index bd27df745477..136c08284b4a 100644 --- a/net-analyzer/notus-scanner/notus-scanner-22.5.0-r1.ebuild +++ b/net-analyzer/notus-scanner/notus-scanner-22.6.0.ebuild @@ -3,7 +3,7 @@ EAPI=8 -PYTHON_COMPAT=( python3_11 ) +PYTHON_COMPAT=( python3_{10..11} ) DISTUTILS_USE_PEP517=poetry inherit distutils-r1 readme.gentoo-r1 systemd @@ -14,16 +14,14 @@ SRC_URI="https://github.com/greenbone/notus-scanner/archive/refs/tags/v${PV}.tar SLOT="0" LICENSE="AGPL-3 AGPL-3+" KEYWORDS="~amd64 ~x86" -RESTRICT="!test? ( test )" DEPEND=" acct-user/gvm net-libs/paho-mqtt-c - dev-python/psutil[${PYTHON_USEDEP}] - >=dev-python/python-gnupg-0.5.0[${PYTHON_USEDEP}] + >=dev-python/psutil-5.9[${PYTHON_USEDEP}] + >=dev-python/python-gnupg-0.5.1[${PYTHON_USEDEP}] <dev-python/packaging-23.2[${PYTHON_USEDEP}] - >=dev-python/sentry-sdk-1.22.2[${PYTHON_USEDEP}] - >=dev-python/rope-1.8.0[${PYTHON_USEDEP}] + >=dev-python/rope-1.9.0[${PYTHON_USEDEP}] >=dev-python/paho-mqtt-1.5.1[${PYTHON_USEDEP}] <dev-python/tomli-3[${PYTHON_USEDEP}] " @@ -46,6 +44,13 @@ DISABLE_AUTOFORMATTING=true distutils_enable_tests unittest +src_prepare() { + if use test; then + PATCHES+=( "${FILESDIR}"/${P}-remove-tests.patch ) + fi + default +} + python_compile() { distutils-r1_python_compile } |