DNS Module
+| Requests to local DNS server | +Requests to external DNS servers | +Total DNS requests | +Total DNS responses | +
|---|---|---|---|
| 0 | +0 | +0 | +0 | +
diff --git a/framework/python/src/common/testreport.py b/framework/python/src/common/testreport.py index c1d990fa7..c62f29f73 100644 --- a/framework/python/src/common/testreport.py +++ b/framework/python/src/common/testreport.py @@ -21,7 +21,7 @@ import base64 import os from test_orc.test_case import TestCase -from jinja2 import Template +from jinja2 import Environment, FileSystemLoader from collections import OrderedDict DATE_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' @@ -42,6 +42,8 @@ report_resource_dir = os.path.join(root_dir, RESOURCES_DIR) test_run_img_file = os.path.join(report_resource_dir, 'testrun.png') +qualification_icon = os.path.join(report_resource_dir, 'qualification-icon.png') +pilot_icon = os.path.join(report_resource_dir, 'pilot-icon.png') class TestReport(): @@ -153,6 +155,9 @@ def from_json(self, json_file): if 'test_pack' in json_file['device']: self._device['test_pack'] = json_file['device']['test_pack'] + if 'additional_info' in json_file['device']: + self._device['device_profile'] = json_file['device']['additional_info'] + self._status = json_file['status'] self._started = datetime.strptime(json_file['started'], DATE_TIME_FORMAT) self._finished = datetime.strptime(json_file['finished'], DATE_TIME_FORMAT) @@ -194,13 +199,8 @@ def to_pdf(self): def to_html(self): # Jinja template - with open(os.path.join(report_resource_dir, TEST_REPORT_TEMPLATE), - 'r', - encoding='UTF-8' - ) as template_file: - template = Template(template_file.read()) - - # Load styles + template_env = Environment(loader=FileSystemLoader(report_resource_dir)) + template = template_env.get_template(TEST_REPORT_TEMPLATE) with open(os.path.join(report_resource_dir, TEST_REPORT_STYLES), 'r', @@ -211,8 +211,15 @@ def to_html(self): # Load Testrun logo to base64 with open(test_run_img_file, 'rb') as f: logo = base64.b64encode(f.read()).decode('utf-8') + json_data=self.to_json() + # Icons + with open(qualification_icon, 'rb') as f: + icon_qualification = base64.b64encode(f.read()).decode('utf-8') + with open(pilot_icon, 'rb') as f: + icon_pilot = base64.b64encode(f.read()).decode('utf-8') + # Convert the timestamp strings to datetime objects start_time = datetime.strptime(json_data['started'], '%Y-%m-%d %H:%M:%S') end_time = datetime.strptime(json_data['finished'], '%Y-%m-%d %H:%M:%S') @@ -234,13 +241,18 @@ def to_html(self): module_reports = self._get_module_pages() pages_num = self._pages_num(json_data) - total_pages = pages_num + len(module_reports) - + total_pages = pages_num + len(module_reports) + 1 if len(steps_to_resolve) > 0: total_pages += 1 + if (len(optional_steps_to_resolve) > 0 + and json_data['device']['test_pack'] == 'Pilot Assessment' + ): + total_pages += 1 return template.render(styles=styles, logo=logo, + icon_qualification=icon_qualification, + icon_pilot=icon_pilot, version=self._version, json_data=json_data, device=json_data['device'], diff --git a/resources/report/device_qualification_report_example.html b/resources/report/device_qualification_report_example.html new file mode 100644 index 000000000..6765954c5 --- /dev/null +++ b/resources/report/device_qualification_report_example.html @@ -0,0 +1,1566 @@ + + + + +
+ + +
+
+
+ Device Qualification
+
+
+
+
+ Device Qualification
+
+
+
+
+ Device Qualification
+
+
+
+
+ Device Qualification
+
+
+
+
+ Device Qualification
+
+
| Requests to local DNS server | +Requests to external DNS servers | +Total DNS requests | +Total DNS responses | +
|---|---|---|---|
| 0 | +0 | +0 | +0 | +
+
+
+ Device Qualification
+
+
| TCP ports open | +UDP ports open | +Total ports open | +
|---|---|---|
| 1 | +0 | +1 | +
| Port | +State | +Service | +Version | +
|---|---|---|---|
| 22/tcp | +open | +ssh | +9.7 protocol 2.0 | +
+
+
+ Device Qualification
+
+
| Requests to local NTP server | +Requests to external NTP servers | +Total NTP requests | +Total NTP responses | +
|---|---|---|---|
| 0 | +1 | +1 | +1 | +
| Source | +Destination | +Type | +Version | +Count | +Sync Request Average | +
|---|---|---|---|---|---|
| 10.10.10.14 | +195.46.37.22 | +Client | +4 | +1 | +0.000 seconds | +
| 195.46.37.22 | +10.10.10.14 | +Server | +4 | +1 | +N/A | +
+
+
+ Device Qualification
+
+
+ {% if json_data['device']['test_pack'] == 'Device Qualification' %}
+
+ Device Qualification
+ {% else %}
+
+ Pilot Assessment
+ {% endif %}
+
+ {% if json_data['device']['test_pack'] == 'Device Qualification' %}
+
+ Device Qualification
+ {% else %}
+
+ Pilot Assessment
+ {% endif %}
+
-
- Pilot Assessment
-
-
- Pilot Assessment
-
-
- Pilot Assessment
-
-
- Pilot Assessment
-
-
- Pilot Assessment
-
| Requests to local DNS server | -Requests to external DNS servers | -Total DNS requests | -Total DNS responses | -
|---|---|---|---|
| 0 | -0 | -0 | -0 | -
-
- Pilot Assessment
-
| TCP ports open | -UDP ports open | -Total ports open | -
|---|---|---|
| 0 | -0 | -0 | -
-
- Pilot Assessment
-
| Requests to local NTP server | -Requests to external NTP servers | -Total NTP requests | -Total NTP responses | -
|---|---|---|---|
| 0 | -0 | -0 | -0 | -
-
- Pilot Assessment
-
-
- Pilot Assessment
-
Attention
-- The following recommendations are required solely for full device qualification. - They are optional for the pilot assessment. - But you may find it valuable to understand what will be required in the future - and our recommendations for your device. -
-
+
+
+ Pilot Assessment
+
+
+
+
+ Pilot Assessment
+
+
+
+
+ Pilot Assessment
+
+
+
+
+ Pilot Assessment
+
+
| Requests to local DNS server | +Requests to external DNS servers | +Total DNS requests | +Total DNS responses | +
|---|---|---|---|
| 0 | +0 | +0 | +0 | +
+
+
+ Pilot Assessment
+
+
| TCP ports open | +UDP ports open | +Total ports open | +
|---|---|---|
| 1 | +0 | +1 | +
| Port | +State | +Service | +Version | +
|---|---|---|---|
| 22/tcp | +open | +ssh | +9.7 protocol 2.0 | +
+
+
+ Pilot Assessment
+
+
| Requests to local NTP server | +Requests to external NTP servers | +Total NTP requests | +Total NTP responses | +
|---|---|---|---|
| 0 | +1 | +1 | +1 | +
| Source | +Destination | +Type | +Version | +Count | +Sync Request Average | +
|---|---|---|---|---|---|
| 10.10.10.15 | +195.46.37.22 | +Client | +4 | +1 | +0.000 seconds | +
| 195.46.37.22 | +10.10.10.15 | +Server | +4 | +1 | +N/A | +
+
+
+ Pilot Assessment
+
+
+
+
+ Pilot Assessment
+
+
Attention
++ The following recommendations are required solely for full device qualification. + They are optional for the pilot assessment. + But you may find it valuable to understand what will be required in the future + and our recommendations for your device. +
+
-
- Device Qualification
-
-
- Device Qualification
-
-
- Device Qualification
-
-
- Device Qualification
-
-
- Device Qualification
-
| Requests to local DNS server | -Requests to external DNS servers | -Total DNS requests | -Total DNS responses | -
|---|---|---|---|
| 0 | -0 | -0 | -0 | -
-
- Device Qualification
-
| TCP ports open | -UDP ports open | -Total ports open | -
|---|---|---|
| 0 | -0 | -0 | -
-
- Device Qualification
-
| Requests to local NTP server | -Requests to external NTP servers | -Total NTP requests | -Total NTP responses | -
|---|---|---|---|
| 0 | -0 | -0 | -0 | -
-
- Device Qualification
-
Attention
++ The following recommendations are required solely for full device qualification. + They are optional for the pilot assessment. + But you may find it valuable to understand what will be required in the future + and our recommendations for your device. +
+