diff --git a/tests/plugins/test_valid_oid.py b/tests/plugins/test_valid_oid.py index c5918f36..4504c323 100644 --- a/tests/plugins/test_valid_oid.py +++ b/tests/plugins/test_valid_oid.py @@ -672,84 +672,6 @@ def test_rocky(self): results[0].message, ) - def test_openeuler_ok(self): - path = Path("some/file.nasl") - content = ( - ' script_oid("1.3.6.1.4.1.25623.1.1.16.2022.123");\n' - ' script_family("openEuler Local Security Checks");\n' - ) - fake_context = self.create_file_plugin_context( - nasl_file=path, file_content=content - ) - plugin = CheckValidOID(fake_context) - - results = list(plugin.run()) - - self.assertEqual(len(results), 0) - - def test_openeuler_not_ok(self): - path = Path("some/file.nasl") - content = ( - ' script_oid("1.3.6.1.4.1.25623.1.1.16.2022.123");\n' - ' script_family("HCE Local Security Checks");\n' - ) - fake_context = self.create_file_plugin_context( - nasl_file=path, file_content=content - ) - plugin = CheckValidOID(fake_context) - - results = list(plugin.run()) - - self.assertEqual(len(results), 1) - - self.assertIsInstance(results[0], LinterError) - self.assertEqual( - ( - "script_oid() is using an OID that is reserved for " - "openEuler '1.3.6.1.4.1.25623.1.1.16.2022.123'" - ), - results[0].message, - ) - - def test_hce_ok(self): - path = Path("some/file.nasl") - content = ( - ' script_oid("1.3.6.1.4.1.25623.1.1.17.2022.123");\n' - ' script_family("HCE Local Security Checks");\n' - ) - fake_context = self.create_file_plugin_context( - nasl_file=path, file_content=content - ) - plugin = CheckValidOID(fake_context) - - results = list(plugin.run()) - - self.assertEqual(len(results), 0) - - def test_hce_not_ok(self): - path = Path("some/file.nasl") - content = ( - ' script_oid("1.3.6.1.4.1.25623.1.1.17.2022.123");\n' - ' script_family("openEuler Local Security Checks");\n' - ) - fake_context = self.create_file_plugin_context( - nasl_file=path, file_content=content - ) - plugin = CheckValidOID(fake_context) - - results = list(plugin.run()) - - self.assertEqual(len(results), 1) - - self.assertIsInstance(results[0], LinterError) - self.assertEqual( - ( - "script_oid() is using an OID that is reserved for " - "HCE '1.3.6.1.4.1.25623.1.1.17.2022.123'" - ), - results[0].message, - ) - def test_opensuse_ok(self): path = Path("some/file.nasl") content = ( diff --git a/troubadix/plugins/valid_oid.py b/troubadix/plugins/valid_oid.py index b5a3af8b..e3fe2ab2 100644 --- a/troubadix/plugins/valid_oid.py +++ b/troubadix/plugins/valid_oid.py @@ -324,24 +324,6 @@ def check_content( plugin=self.name, ) return - elif vendor_number == "16": - if family != f"openEuler {family_template}": - yield LinterError( - f"script_oid() {is_using_reserved} openEuler " - f"'{str(oid)}'", - file=nasl_file, - plugin=self.name, - ) - return - elif vendor_number == "17": - if family != f"HCE {family_template}": - yield LinterError( - f"script_oid() {is_using_reserved} HCE " - f"'{str(oid)}'", - file=nasl_file, - plugin=self.name, - ) - return elif vendor_number == "18": if family != f"openSUSE {family_template}": yield LinterError(