diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-21 11:12:11 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-21 11:12:11 +0000 |
commit | 5b68b3c83eeba9cd1f69f8bce1194794975b84d3 (patch) | |
tree | 4c15b5b55afc6d8a8fbe90de564321fb746812e5 /net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch | |
parent | 949b406c5d38689bd65345d9326fefd8e102d163 (diff) |
gentoo auto-resync : 21:11:2023 - 11:12:11
Diffstat (limited to 'net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch')
-rw-r--r-- | net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch b/net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch new file mode 100644 index 000000000000..e2d3192ed295 --- /dev/null +++ b/net-analyzer/notus-scanner/files/notus-scanner-22.6.2-remove-tests.patch @@ -0,0 +1,75 @@ +Remove tests that use files not allowed by Sandbox. +Patch by Giuseppe Foti + +--- a/tests/cli/test_cli_parser.py ++++ b/tests/cli/test_cli_parser.py +@@ -28,69 +28,6 @@ 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_config_file_provide_mqtt_broker_address(self): + with tempfile.NamedTemporaryFile() as fp: + fp.write(b"[notus-scanner]\nmqtt-broker-address='1.2.3.4'") |