summaryrefslogtreecommitdiffstats
path: root/app/test/scan
diff options
context:
space:
mode:
authorKoren Lev <korenlev@gmail.com>2017-12-18 19:16:16 +0200
committerKoren Lev <korenlev@gmail.com>2017-12-18 19:16:16 +0200
commit98c3ac7c859e34fe60d061b9ca591aba429e4118 (patch)
tree3ff2629def8938b12c0a0147e463e74e475c9032 /app/test/scan
parent4709d96cc240c0c4c5308d40361ca3c3da1152fd (diff)
release 1.2 + new tagging
Change-Id: I1e876451ec4a330f458dd57adadb15e39969b225 Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'app/test/scan')
-rw-r--r--app/test/scan/test_data/configurations.py1
-rw-r--r--app/test/scan/test_data/scanner.py13
-rw-r--r--app/test/scan/test_scan_metadata_parser.py2
-rw-r--r--app/test/scan/test_scanner.py8
4 files changed, 23 insertions, 1 deletions
diff --git a/app/test/scan/test_data/configurations.py b/app/test/scan/test_data/configurations.py
index 96dbc23..044ff0b 100644
--- a/app/test/scan/test_data/configurations.py
+++ b/app/test/scan/test_data/configurations.py
@@ -47,6 +47,7 @@ CONFIGURATIONS = {
"provision": "Deploy",
"env_type": "development",
"name": "Monitoring",
+ "install_monitoring_client": True,
"rabbitmq_port": "5672",
"rabbitmq_pass": "osdna",
"rabbitmq_user": "sensu",
diff --git a/app/test/scan/test_data/scanner.py b/app/test/scan/test_data/scanner.py
index 23838aa..500021d 100644
--- a/app/test/scan/test_data/scanner.py
+++ b/app/test/scan/test_data/scanner.py
@@ -17,6 +17,19 @@ METADATA = {
"scanners_package": "discover",
"scanners": {}
}
+LINK_FINDERS_METADATA = {
+ "finders_package": "discover.link_finders",
+ "base_finder": "FindLinks",
+ "link_finders": [
+ "FindLinksForInstanceVnics",
+ "FindLinksForOteps",
+ "FindLinksForVconnectors",
+ "FindLinksForVedges",
+ "FindLinksForVserviceVnics",
+ "FindLinksForPnics",
+ "FindImplicitLinks"
+ ]
+}
TYPE_TO_FETCH = {
"type": "host_pnic",
diff --git a/app/test/scan/test_scan_metadata_parser.py b/app/test/scan/test_scan_metadata_parser.py
index 91c11ef..5d91306 100644
--- a/app/test/scan/test_scan_metadata_parser.py
+++ b/app/test/scan/test_scan_metadata_parser.py
@@ -104,6 +104,8 @@ class TestScanMetadataParser(TestScan):
'input': METADATA_SCANNER_INCORRECT_FETCHER,
'msg': 'failed to find fetcher class f1 '
'in scanner ScanAggregate type #1'
+ ' (could not import module discover.fetchers.f1.f1: '
+ 'No module named \'discover.fetchers.f1\')'
},
{
'input': METADATA_SCANNER_WITH_INCORRECT_CHILD,
diff --git a/app/test/scan/test_scanner.py b/app/test/scan/test_scanner.py
index 4a7536e..e93a35b 100644
--- a/app/test/scan/test_scanner.py
+++ b/app/test/scan/test_scanner.py
@@ -10,6 +10,9 @@
from discover.scanner import Scanner
from test.scan.test_scan import TestScan
from unittest.mock import MagicMock, patch
+
+from discover.link_finders.find_links_metadata_parser \
+ import FindLinksMetadataParser
from discover.scan_metadata_parser import ScanMetadataParser
from test.scan.test_data.scanner import *
from monitoring.setup.monitoring_setup_manager import MonitoringSetupManager
@@ -19,7 +22,10 @@ class TestScanner(TestScan):
def setUp(self):
super().setUp()
- ScanMetadataParser.parse_metadata_file = MagicMock(return_value=METADATA)
+ ScanMetadataParser.parse_metadata_file = \
+ MagicMock(return_value=METADATA)
+ FindLinksMetadataParser.parse_metadata_file = \
+ MagicMock(return_value=LINK_FINDERS_METADATA)
self.scanner = Scanner()
self.scanner.set_env(self.env)
MonitoringSetupManager.create_setup = MagicMock()