Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added msg_242,msg_243 to baseline_log #436

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion os_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.3.0'
__codedate__ = '20240903'
__codedate__ = '20240912'
4 changes: 3 additions & 1 deletion os_tests/cfg/os-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ case_post:
# specify it when using the internal repos for dnf update, can pass more seperated by ","
dnf_repo_url:
# specify it when leapp upgrade via custom repo, can pass more seperated by ","
leapp_target_repo_url:
leapp_target_repo_url:
# add more information about test run
comment: ""
26 changes: 25 additions & 1 deletion os_tests/data/baseline_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -2253,5 +2253,29 @@
"cases": "",
"addedby": "[email protected]",
"addeddate": "20240912"
},
"msg_243": {
"content": ".*sysfs: cannot create duplicate filename.*/devices/cache.*",
"analyze": "known issue",
"branch": "rhel10",
"status": "active",
"link": "https://issues.redhat.com/browse/RHEL-55706",
"path": "journal",
"trigger": "",
"cases": "os_tests.tests.test_general_check.TestGeneralCheck.test_check_dmesg_calltrace",
"addedby": "[email protected]",
"addeddate": "20240909"
},
"msg_244": {
"content": ".*/sys/devices/system/cpu/cpu1/online: No such file or directory.*",
"analyze": "known issue",
"branch": "rhel9",
"status": "active",
"link": "https://issues.redhat.com/browse/RHEL-58031",
"path": "/sys/devices/system/cpu/cpu1/online",
"trigger": "",
"cases": "os_tests.tests.test_general_test.TestGeneralTest.test_cpu_hotplug_no_workload",
"addedby": "[email protected]",
"addeddate": "20240909"
}
}
}
26 changes: 14 additions & 12 deletions os_tests/libs/html_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
from jinja2 import Template, FileSystemLoader, Environment, PackageLoader, select_autoescape

class Result:
class ResultSummary:
'''
The class is for test result summary.
'''
Expand Down Expand Up @@ -119,6 +119,7 @@ def __init__(self, stream=None, descriptions=True, verbosity=1,
self.buffer = buffer
self.tb_locals = tb_locals
self.warnings = warnings
self.comment = ''
if resultclass is not None:
self.resultclass = resultclass

Expand All @@ -128,7 +129,7 @@ def _makeResult(self):
def run(self, test, logdir=None):
"Run the given test case or test suite."
result = self._makeResult()
test_result = Result()
test_result_summary = ResultSummary()
registerResult(result)
result.failfast = self.failfast
result.buffer = self.buffer
Expand All @@ -152,6 +153,7 @@ def run(self, test, logdir=None):
result.planned = len(all_case_name)
for ts in test:
logdir = ts.params['results_dir']
test_result_summary.comment = ts.params.get('comment')
if not os.path.exists(logdir):
os.makedirs(logdir,exist_ok=True)
results_dir = logdir + '/results'
Expand Down Expand Up @@ -184,11 +186,11 @@ def run(self, test, logdir=None):
for ts_finished, reason in mapped_result[status]:
if ts_finished == ts:
if status == 'FAIL':
test_result.case_fail += 1
test_result_summary.case_fail += 1
if status == 'ERROR':
test_result.case_error += 1
test_result_summary.case_error += 1
if status == 'SKIP':
test_result.case_skip += 1
test_result_summary.case_skip += 1
case_status = status
case_reason = reason
try:
Expand All @@ -209,19 +211,19 @@ def run(self, test, logdir=None):
case_reason = "{} IS_KNOWN:{} Please check auto analyze details in debug log".format(case_reason, not ret)
break
if not case_status:
test_result.case_pass += 1
test_result_summary.case_pass += 1
with open(debug_log, 'a+') as fh:
fh.write('{} - PASS'.format(ts.id()))
case_status = 'PASS'
case_reason = ''
test_result.table_rows.append([id, ts.id(), case_status, case_reason, ts.duration, debug_log, test_class_name])
test_result_summary.table_rows.append([id, ts.id(), case_status, case_reason, ts.duration, debug_log, test_class_name])
with open(sum_txt, 'a+') as fh:
fh.write('case: {} - {}\n'.format(ts.id(),case_status))
if case_reason:
fh.write('info: {}\n'.format(case_reason))
stopTime = time.perf_counter()
timeTaken = round(stopTime - startTime, 3)
test_result.run_time = timeTaken
test_result_summary.run_time = timeTaken
all_case_name.sort()
id = 0
for case in all_case_name:
Expand All @@ -231,18 +233,18 @@ def run(self, test, logdir=None):
debug_log = "../attachments/" + case + '.debug'
if hasattr(result, 'separator2'):
self.stream.writeln(result.separator2)
test_result.compute_totals()
test_result_summary.compute_totals()
node_info_file = "{}/attachments/node_info".format(logdir)
if os.path.exists(node_info_file):
with open(node_info_file) as fh:
test_result.node_info = fh.read()
test_result_summary.node_info = fh.read()
results_dir = logdir + '/results'
if not os.path.exists(results_dir):
os.mkdir(results_dir)
sum_html = os.path.join(results_dir, "sum.html")
generated_report(sum_html, "sum.html", test_result)
generated_report(sum_html, "sum.html", test_result_summary)
sum_junit = os.path.join(results_dir, "sum.xml")
generated_report(sum_junit, "sum.xml", test_result)
generated_report(sum_junit, "sum.xml", test_result_summary)
self.stream.writeln("{} generated".format(os.path.realpath(sum_txt)))
#result.printErrors()
if hasattr(result, 'separator2'):
Expand Down
9 changes: 6 additions & 3 deletions os_tests/templates/sum.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ <h2>OS-TESTS Test Report</h2>
<!-- Table -->
<table class="table table-bordered">
<tr>
<td>Summary</td><td>Total:<b>{{ result.total }}</b>, PASS:<b class="text-success">{{ result.case_pass }}</b>, FAIL:<b class="text-danger">{{ result.case_fail }}</b>, SKIP:<b class="text-warning">{{ result.case_skip }}</b>, ERROR:<b class="text-danger">{{ result.case_error }}</b> - success rate is <b>{{ '%0.2f' % result.pass_rate|float }}</b>% (excluded SKIP and CANCEL)</tr>
<td>Summary</td><td>Total:<b>{{ result.total }}</b>, PASS:<b class="text-success">{{ result.case_pass }}</b>, FAIL:<b class="text-danger">{{ result.case_fail }}</b>, SKIP:<b class="text-warning">{{ result.case_skip }}</b>, ERROR:<b class="text-danger">{{ result.case_error }}</b> - success rate is <b>{{ '%0.2f' % result.pass_rate|float }}</b>% (excluded SKIP and CANCEL) Runtime(sec):{{ '%0.2f' % result.run_time|float }}
</tr>
<tr>
<td>RunTime(s)</td><td>{{ '%0.2f' % result.run_time|float }}</td></tr>
<td>Node Info</td><td>{{ result.node_info|e }}</td>
</tr>
<tr>
<td>Node Info</td><td>{{ result.node_info|e }}</td></tr>
<td>Comment</td><td>{{ result.comment|e }}</td>
</tr>
</table>
<table id="result" class="table table-hover table-bordered">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion os_tests/tests/test_general_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ def test_virsh_pci_reattach(self):
'sudo virsh nodedev-reattach %s' % pci_dev_0,
msg='reattach pci device',
expect_ret=0)
utils_lib.check_log(self, "error,warn,fail,trace,Call Trace", log_cmd='sudo dmesg -T', cursor=self.dmesg_cursor)
utils_lib.check_log(self, "error,warn,fail,Call Trace", log_cmd='sudo dmesg -T', cursor=self.dmesg_cursor)

def test_sys_read_capability(self):
"""
Expand Down
1 change: 1 addition & 0 deletions os_tests/tests/test_network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ def test_tcp_checksum_offload(self):
cmd = "dd if=/dev/urandom of={} bs=1M count=500 status=progress".format(testfile_c)
utils_lib.run_cmd(self,cmd,timeout=300,msg='create a 500M file')
if i:
utils_lib.run_cmd(self,'sudo modprobe sch_netem', msg='manually load sch_netem due to RHEL-52279')
cmd = "sudo tc qdisc add dev eth0 root netem corrupt 1%"
utils_lib.run_cmd(self,cmd,expect_ret=0,msg='Test again with network corrupt 1%')
utils_lib.init_connection(self, timeout=self.ssh_timeout)
Expand Down
Loading