diff options
Diffstat (limited to 'poky/meta/lib/oeqa/utils')
-rw-r--r-- | poky/meta/lib/oeqa/utils/__init__.py | 3 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/buildproject.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/commands.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/decorators.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/dump.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/ftools.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/git.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/gitarchive.py | 9 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/httpserver.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/logparser.py | 65 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/metadata.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/network.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/package_manager.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/qemurunner.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/qemutinyrunner.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/sshcontrol.py | 5 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/subprocesstweak.py | 3 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/targetbuild.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/utils/testexport.py | 4 |
19 files changed, 118 insertions, 19 deletions
diff --git a/poky/meta/lib/oeqa/utils/__init__.py b/poky/meta/lib/oeqa/utils/__init__.py index d38a32301..70fbe7b55 100644 --- a/poky/meta/lib/oeqa/utils/__init__.py +++ b/poky/meta/lib/oeqa/utils/__init__.py @@ -1,3 +1,6 @@ +# +# SPDX-License-Identifier: MIT +# # Enable other layers to have modules in the same named directory from pkgutil import extend_path __path__ = extend_path(__path__, __name__) diff --git a/poky/meta/lib/oeqa/utils/buildproject.py b/poky/meta/lib/oeqa/utils/buildproject.py index 01a803ab6..e6d80cc8d 100644 --- a/poky/meta/lib/oeqa/utils/buildproject.py +++ b/poky/meta/lib/oeqa/utils/buildproject.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2013-2016 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # Provides a class for automating build tests for projects diff --git a/poky/meta/lib/oeqa/utils/commands.py b/poky/meta/lib/oeqa/utils/commands.py index 2e6a2289c..59ebfbe12 100644 --- a/poky/meta/lib/oeqa/utils/commands.py +++ b/poky/meta/lib/oeqa/utils/commands.py @@ -1,6 +1,8 @@ +# # Copyright (c) 2013-2014 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest diff --git a/poky/meta/lib/oeqa/utils/decorators.py b/poky/meta/lib/oeqa/utils/decorators.py index d87689692..aabf4110c 100644 --- a/poky/meta/lib/oeqa/utils/decorators.py +++ b/poky/meta/lib/oeqa/utils/decorators.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2013 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # Some custom decorators that can be used by unittests # Most useful is skipUnlessPassed which can be used for diff --git a/poky/meta/lib/oeqa/utils/dump.py b/poky/meta/lib/oeqa/utils/dump.py index 79c22b75c..d34e05e2b 100644 --- a/poky/meta/lib/oeqa/utils/dump.py +++ b/poky/meta/lib/oeqa/utils/dump.py @@ -1,3 +1,7 @@ +# +# SPDX-License-Identifier: MIT +# + import os import sys import errno diff --git a/poky/meta/lib/oeqa/utils/ftools.py b/poky/meta/lib/oeqa/utils/ftools.py index a7233d4ca..3093419cc 100644 --- a/poky/meta/lib/oeqa/utils/ftools.py +++ b/poky/meta/lib/oeqa/utils/ftools.py @@ -1,3 +1,7 @@ +# +# SPDX-License-Identifier: MIT +# + import os import re import errno diff --git a/poky/meta/lib/oeqa/utils/git.py b/poky/meta/lib/oeqa/utils/git.py index 757e3f0cb..ea35a766e 100644 --- a/poky/meta/lib/oeqa/utils/git.py +++ b/poky/meta/lib/oeqa/utils/git.py @@ -1,7 +1,7 @@ # # Copyright (C) 2016 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT # """Git repository interactions""" import os diff --git a/poky/meta/lib/oeqa/utils/gitarchive.py b/poky/meta/lib/oeqa/utils/gitarchive.py index 9520b2e12..6e8040eb5 100644 --- a/poky/meta/lib/oeqa/utils/gitarchive.py +++ b/poky/meta/lib/oeqa/utils/gitarchive.py @@ -4,14 +4,7 @@ # Copyright (c) 2017, Intel Corporation. # Copyright (c) 2019, Linux Foundation # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. +# SPDX-License-Identifier: GPL-2.0-only # import os diff --git a/poky/meta/lib/oeqa/utils/httpserver.py b/poky/meta/lib/oeqa/utils/httpserver.py index a48d4994f..aa435590f 100644 --- a/poky/meta/lib/oeqa/utils/httpserver.py +++ b/poky/meta/lib/oeqa/utils/httpserver.py @@ -1,3 +1,7 @@ +# +# SPDX-License-Identifier: MIT +# + import http.server import multiprocessing import os diff --git a/poky/meta/lib/oeqa/utils/logparser.py b/poky/meta/lib/oeqa/utils/logparser.py index 32fde14a7..cc6d18d94 100644 --- a/poky/meta/lib/oeqa/utils/logparser.py +++ b/poky/meta/lib/oeqa/utils/logparser.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +# +# SPDX-License-Identifier: MIT +# import sys import os @@ -86,3 +89,65 @@ class PtestParser(object): status = self.results[section][test_name] f.write(status + ": " + test_name + "\n") + +# ltp log parsing +class LtpParser(object): + def __init__(self): + self.results = {} + self.section = {'duration': "", 'log': ""} + + def parse(self, logfile): + test_regex = {} + test_regex['PASSED'] = re.compile(r"PASS") + test_regex['FAILED'] = re.compile(r"FAIL") + test_regex['SKIPPED'] = re.compile(r"SKIP") + + with open(logfile, errors='replace') as f: + for line in f: + for t in test_regex: + result = test_regex[t].search(line) + if result: + self.results[line.split()[0].strip()] = t + + for test in self.results: + result = self.results[test] + self.section['log'] = self.section['log'] + ("%s: %s\n" % (result.strip()[:-2], test.strip())) + + return self.results, self.section + + +# ltp Compliance log parsing +class LtpComplianceParser(object): + def __init__(self): + self.results = {} + self.section = {'duration': "", 'log': ""} + + def parse(self, logfile): + test_regex = {} + test_regex['PASSED'] = re.compile(r"^PASS") + test_regex['FAILED'] = re.compile(r"^FAIL") + test_regex['SKIPPED'] = re.compile(r"(?:UNTESTED)|(?:UNSUPPORTED)") + + section_regex = {} + section_regex['test'] = re.compile(r"^Testing") + + with open(logfile, errors='replace') as f: + for line in f: + result = section_regex['test'].search(line) + if result: + self.name = "" + self.name = line.split()[1].strip() + self.results[self.name] = "PASSED" + failed = 0 + + failed_result = test_regex['FAILED'].search(line) + if failed_result: + failed = line.split()[1].strip() + if int(failed) > 0: + self.results[self.name] = "FAILED" + + for test in self.results: + result = self.results[test] + self.section['log'] = self.section['log'] + ("%s: %s\n" % (result.strip()[:-2], test.strip())) + + return self.results, self.section diff --git a/poky/meta/lib/oeqa/utils/metadata.py b/poky/meta/lib/oeqa/utils/metadata.py index e0808ae0a..8013aa684 100644 --- a/poky/meta/lib/oeqa/utils/metadata.py +++ b/poky/meta/lib/oeqa/utils/metadata.py @@ -1,6 +1,6 @@ # Copyright (C) 2016 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT # # Functions to get metadata from the testing host used # for analytics of test results. diff --git a/poky/meta/lib/oeqa/utils/network.py b/poky/meta/lib/oeqa/utils/network.py index 2768f6c5d..59cbbc4f1 100644 --- a/poky/meta/lib/oeqa/utils/network.py +++ b/poky/meta/lib/oeqa/utils/network.py @@ -1,3 +1,7 @@ +# +# SPDX-License-Identifier: MIT +# + import socket def get_free_port(): diff --git a/poky/meta/lib/oeqa/utils/package_manager.py b/poky/meta/lib/oeqa/utils/package_manager.py index 1495f8732..2d358f717 100644 --- a/poky/meta/lib/oeqa/utils/package_manager.py +++ b/poky/meta/lib/oeqa/utils/package_manager.py @@ -1,3 +1,7 @@ +# +# SPDX-License-Identifier: MIT +# + import os import json import shutil diff --git a/poky/meta/lib/oeqa/utils/qemurunner.py b/poky/meta/lib/oeqa/utils/qemurunner.py index 1abb2c1b6..fd386ef5a 100644 --- a/poky/meta/lib/oeqa/utils/qemurunner.py +++ b/poky/meta/lib/oeqa/utils/qemurunner.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2013 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # This module provides a class for starting qemu images using runqemu. # It's used by testimage.bbclass. diff --git a/poky/meta/lib/oeqa/utils/qemutinyrunner.py b/poky/meta/lib/oeqa/utils/qemutinyrunner.py index 5aa99d068..364005bd2 100644 --- a/poky/meta/lib/oeqa/utils/qemutinyrunner.py +++ b/poky/meta/lib/oeqa/utils/qemutinyrunner.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2015 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # This module provides a class for starting qemu images of poky tiny. # It's used by testimage.bbclass. diff --git a/poky/meta/lib/oeqa/utils/sshcontrol.py b/poky/meta/lib/oeqa/utils/sshcontrol.py index d292893c0..49a07264c 100644 --- a/poky/meta/lib/oeqa/utils/sshcontrol.py +++ b/poky/meta/lib/oeqa/utils/sshcontrol.py @@ -1,7 +1,8 @@ -# -*- coding: utf-8 -*- +# # Copyright (C) 2013 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # Provides a class for setting up ssh connections, # running commands and copying files to/from a target. diff --git a/poky/meta/lib/oeqa/utils/subprocesstweak.py b/poky/meta/lib/oeqa/utils/subprocesstweak.py index 1f7d11b55..b47975a4b 100644 --- a/poky/meta/lib/oeqa/utils/subprocesstweak.py +++ b/poky/meta/lib/oeqa/utils/subprocesstweak.py @@ -1,3 +1,6 @@ +# +# SPDX-License-Identifier: MIT +# import subprocess class OETestCalledProcessError(subprocess.CalledProcessError): diff --git a/poky/meta/lib/oeqa/utils/targetbuild.py b/poky/meta/lib/oeqa/utils/targetbuild.py index b8db7b2ac..1055810ca 100644 --- a/poky/meta/lib/oeqa/utils/targetbuild.py +++ b/poky/meta/lib/oeqa/utils/targetbuild.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2013 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # Provides a class for automating build tests for projects diff --git a/poky/meta/lib/oeqa/utils/testexport.py b/poky/meta/lib/oeqa/utils/testexport.py index be2a2110f..e89d130a9 100644 --- a/poky/meta/lib/oeqa/utils/testexport.py +++ b/poky/meta/lib/oeqa/utils/testexport.py @@ -1,6 +1,8 @@ +# # Copyright (C) 2015 Intel Corporation # -# Released under the MIT license (see COPYING.MIT) +# SPDX-License-Identifier: MIT +# # Provides functions to help with exporting binaries obtained from built targets |