diff --git a/muranopkgcheck/tests/test_manifest_validator.py b/muranopkgcheck/tests/test_manifest_validator.py index 0a22256..7760c39 100644 --- a/muranopkgcheck/tests/test_manifest_validator.py +++ b/muranopkgcheck/tests/test_manifest_validator.py @@ -59,6 +59,11 @@ class ManifestValidatorTests(helpers.BaseValidatorTestClass): self.g = self.mv._valid_require([1, 2, 3]) self.assertIn('Require is not a dict type', next(self.g).message) + def test_wrong_require_fqn(self): + self.g = self.mv._valid_require({'io.murano!': '1.3.2'}) + self.assertIn('Require key is not valid FQN "io.murano!"', + next(self.g).message) + def test_not_existing_file(self): data = {'org.openstack.Flow': 'FlowClassifier.yaml', 'org.openstack.Instance': 'Instance.yaml'} diff --git a/muranopkgcheck/validators/manifest.py b/muranopkgcheck/validators/manifest.py index e8d3c53..d2318c6 100644 --- a/muranopkgcheck/validators/manifest.py +++ b/muranopkgcheck/validators/manifest.py @@ -60,6 +60,11 @@ class ManifestValidator(base.YamlValidator): def _valid_require(self, value): if not isinstance(value, dict): yield error.report.E005('Require is not a dict type', value) + return + for fqn, ver in six.iteritems(value): + if not self._check_fqn_name(fqn): + yield error.report.E005('Require key is not valid FQN "{0}"' + .format(fqn), fqn) def _valid_type(self, value): if value not in ('Application', 'Library'):