Safe PEP8
PATCH 7/8 PEP8 double aggressive E301 ~ E306
In reply to Armin KusterFrom: persianpros <[email protected]>
--- meta-selftest/lib/devtool/bbpath.py | 7 ++++ meta-selftest/lib/devtool/test.py | 2 ++ .../lib/oeqa/runtime/cases/dnf_runtime.py | 1 + .../lib/oeqa/runtime/cases/selftest.py | 1 + meta-selftest/lib/oeqa/runtime/cases/virgl.py | 1 + meta-selftest/lib/recipetool/bbpath.py | 7 ++++ meta/files/ext-sdk-prepare.py | 5 +++ meta/lib/bblayers/create.py | 3 ++ meta/lib/buildstats.py | 2 +- meta/lib/oe/buildhistory_analysis.py | 7 ++++ meta/lib/oe/cachedpath.py | 1 + meta/lib/oe/classextend.py | 4 +++ meta/lib/oe/classutils.py | 3 ++ meta/lib/oe/copy_buildsystem.py | 7 ++++ meta/lib/oe/cve_check.py | 2 ++ meta/lib/oe/data.py | 2 ++ meta/lib/oe/distro_check.py | 20 ++++++++++- meta/lib/oe/elf.py | 1 + meta/lib/oe/gpg_sign.py | 5 ++- meta/lib/oe/license.py | 19 ++++++++++ meta/lib/oe/lsb.py | 5 +++ meta/lib/oe/maketype.py | 7 ++++ meta/lib/oe/manifest.py | 5 ++- meta/lib/oe/package.py | 10 ++++++ meta/lib/oe/package_manager/__init__.py | 10 +++++- meta/lib/oe/package_manager/deb/__init__.py | 6 ++-- meta/lib/oe/package_manager/deb/manifest.py | 1 + meta/lib/oe/package_manager/deb/rootfs.py | 3 +- meta/lib/oe/package_manager/deb/sdk.py | 2 +- meta/lib/oe/package_manager/ipk/__init__.py | 5 +-- meta/lib/oe/package_manager/ipk/manifest.py | 2 ++ meta/lib/oe/package_manager/ipk/rootfs.py | 6 ++++ meta/lib/oe/package_manager/ipk/sdk.py | 1 + meta/lib/oe/package_manager/rpm/__init__.py | 5 +-- meta/lib/oe/package_manager/rpm/manifest.py | 2 ++ meta/lib/oe/package_manager/rpm/rootfs.py | 3 +- meta/lib/oe/package_manager/rpm/sdk.py | 1 + meta/lib/oe/packagedata.py | 12 +++++++ meta/lib/oe/packagegroup.py | 6 ++++ meta/lib/oe/patch.py | 13 +++++-- meta/lib/oe/path.py | 17 +++++++++ meta/lib/oe/prservice.py | 5 +++ meta/lib/oe/qa.py | 4 +++ meta/lib/oe/recipeutils.py | 10 +++++- meta/lib/oe/reproducible.py | 6 ++++ meta/lib/oe/rootfs.py | 7 ++-- meta/lib/oe/sdk.py | 4 +++ meta/lib/oe/sstatesig.py | 18 ++++++++++ meta/lib/oe/terminal.py | 21 +++++++++++ meta/lib/oe/types.py | 13 +++++++ meta/lib/oe/useradd.py | 5 +++ meta/lib/oe/utils.py | 35 +++++++++++++++++++ meta/lib/oeqa/buildperf/base.py | 2 -- meta/lib/oeqa/buildperf/test_basic.py | 1 + meta/lib/oeqa/controllers/masterimage.py | 1 + meta/lib/oeqa/controllers/testtargetloader.py | 2 ++ meta/lib/oeqa/core/case.py | 3 ++ .../lib/oeqa/core/cases/example/test_basic.py | 2 ++ meta/lib/oeqa/core/context.py | 4 +++ meta/lib/oeqa/core/decorator/__init__.py | 5 +++ meta/lib/oeqa/core/decorator/data.py | 16 +++++++++ meta/lib/oeqa/core/decorator/depends.py | 5 +++ meta/lib/oeqa/core/decorator/oetimeout.py | 2 ++ meta/lib/oeqa/core/exception.py | 7 ++++ meta/lib/oeqa/core/loader.py | 4 ++- meta/lib/oeqa/core/runner.py | 7 ++++ meta/lib/oeqa/core/target/__init__.py | 1 + meta/lib/oeqa/core/target/qemu.py | 1 + meta/lib/oeqa/core/target/ssh.py | 4 +-- meta/lib/oeqa/core/tests/cases/data.py | 1 + meta/lib/oeqa/core/tests/cases/depends.py | 1 + .../core/tests/cases/loader/valid/another.py | 1 + meta/lib/oeqa/core/tests/cases/oetag.py | 2 ++ meta/lib/oeqa/core/tests/cases/timeout.py | 2 +- meta/lib/oeqa/core/tests/common.py | 2 ++ meta/lib/oeqa/core/tests/test_data.py | 2 ++ meta/lib/oeqa/core/tests/test_decorators.py | 4 +++ meta/lib/oeqa/core/tests/test_loader.py | 2 ++ meta/lib/oeqa/core/tests/test_runner.py | 2 ++ meta/lib/oeqa/core/utils/concurrencytest.py | 18 ++++++++++ meta/lib/oeqa/core/utils/misc.py | 7 ++++ meta/lib/oeqa/core/utils/path.py | 2 ++ meta/lib/oeqa/core/utils/test.py | 11 ++++++ meta/lib/oeqa/oetest.py | 16 +++++++++ meta/lib/oeqa/runexported.py | 5 +++ meta/lib/oeqa/runtime/case.py | 1 + meta/lib/oeqa/runtime/cases/_qemutiny.py | 1 + meta/lib/oeqa/runtime/cases/apt.py | 2 ++ meta/lib/oeqa/runtime/cases/boot.py | 1 + meta/lib/oeqa/runtime/cases/buildcpio.py | 1 + .../lib/oeqa/runtime/cases/buildgalculator.py | 1 + meta/lib/oeqa/runtime/cases/buildlzip.py | 1 + meta/lib/oeqa/runtime/cases/connman.py | 1 + meta/lib/oeqa/runtime/cases/date.py | 1 + meta/lib/oeqa/runtime/cases/df.py | 1 + meta/lib/oeqa/runtime/cases/dnf.py | 3 ++ .../oeqa/runtime/cases/ethernet_ip_connman.py | 1 + meta/lib/oeqa/runtime/cases/gcc.py | 1 + meta/lib/oeqa/runtime/cases/gi.py | 1 + meta/lib/oeqa/runtime/cases/gstreamer.py | 1 + meta/lib/oeqa/runtime/cases/kernelmodule.py | 1 + meta/lib/oeqa/runtime/cases/ksample.py | 3 ++ meta/lib/oeqa/runtime/cases/ldd.py | 1 + meta/lib/oeqa/runtime/cases/logrotate.py | 1 + meta/lib/oeqa/runtime/cases/ltp.py | 3 +- meta/lib/oeqa/runtime/cases/ltp_compliance.py | 3 +- meta/lib/oeqa/runtime/cases/ltp_stress.py | 4 +-- meta/lib/oeqa/runtime/cases/multilib.py | 1 + meta/lib/oeqa/runtime/cases/oe_syslog.py | 5 ++- meta/lib/oeqa/runtime/cases/opkg.py | 2 ++ meta/lib/oeqa/runtime/cases/pam.py | 1 + meta/lib/oeqa/runtime/cases/parselogs.py | 1 + meta/lib/oeqa/runtime/cases/perl.py | 1 + meta/lib/oeqa/runtime/cases/ping.py | 1 + meta/lib/oeqa/runtime/cases/ptest.py | 1 + meta/lib/oeqa/runtime/cases/python.py | 1 + meta/lib/oeqa/runtime/cases/rpm.py | 1 + meta/lib/oeqa/runtime/cases/rtc.py | 1 + meta/lib/oeqa/runtime/cases/runlevel.py | 1 + meta/lib/oeqa/runtime/cases/scons.py | 1 + meta/lib/oeqa/runtime/cases/scp.py | 1 + meta/lib/oeqa/runtime/cases/skeletoninit.py | 1 + meta/lib/oeqa/runtime/cases/ssh.py | 1 + meta/lib/oeqa/runtime/cases/stap.py | 1 + meta/lib/oeqa/runtime/cases/storage.py | 2 +- meta/lib/oeqa/runtime/cases/suspend.py | 1 + meta/lib/oeqa/runtime/cases/systemd.py | 3 ++ meta/lib/oeqa/runtime/cases/terminal.py | 1 + meta/lib/oeqa/runtime/cases/usb_hid.py | 1 + meta/lib/oeqa/runtime/cases/weston.py | 1 + meta/lib/oeqa/runtime/cases/x32lib.py | 1 + meta/lib/oeqa/runtime/cases/xorg.py | 1 + meta/lib/oeqa/runtime/context.py | 3 ++ meta/lib/oeqa/runtime/decorator/package.py | 2 ++ meta/lib/oeqa/runtime/loader.py | 1 + .../oeqa/runtime/utils/targetbuildproject.py | 1 + meta/lib/oeqa/sdk/case.py | 1 + meta/lib/oeqa/sdk/cases/assimp.py | 1 + meta/lib/oeqa/sdk/cases/buildcpio.py | 2 ++ meta/lib/oeqa/sdk/cases/buildepoxy.py | 2 ++ meta/lib/oeqa/sdk/cases/buildgalculator.py | 2 ++ meta/lib/oeqa/sdk/cases/buildlzip.py | 2 ++ meta/lib/oeqa/sdk/cases/gcc.py | 1 + meta/lib/oeqa/sdk/cases/perl.py | 1 + meta/lib/oeqa/sdk/cases/python.py | 2 ++ meta/lib/oeqa/sdk/context.py | 3 ++ meta/lib/oeqa/sdk/testsdk.py | 2 ++ meta/lib/oeqa/sdk/utils/sdkbuildproject.py | 1 + meta/lib/oeqa/sdkext/case.py | 1 + meta/lib/oeqa/sdkext/cases/devtool.py | 2 ++ meta/lib/oeqa/sdkext/context.py | 3 ++ meta/lib/oeqa/sdkext/testsdk.py | 1 + meta/lib/oeqa/selftest/case.py | 2 ++ meta/lib/oeqa/selftest/cases/archiver.py | 3 +- meta/lib/oeqa/selftest/cases/bblayers.py | 1 + meta/lib/oeqa/selftest/cases/bbtests.py | 2 +- meta/lib/oeqa/selftest/cases/binutils.py | 2 ++ meta/lib/oeqa/selftest/cases/buildoptions.py | 6 ++++ .../lib/oeqa/selftest/cases/containerimage.py | 2 ++ meta/lib/oeqa/selftest/cases/cve_check.py | 1 + meta/lib/oeqa/selftest/cases/devtool.py | 15 ++++++-- meta/lib/oeqa/selftest/cases/distrodata.py | 1 + meta/lib/oeqa/selftest/cases/eSDK.py | 1 + .../oeqa/selftest/cases/efibootpartition.py | 1 + meta/lib/oeqa/selftest/cases/fetch.py | 1 + meta/lib/oeqa/selftest/cases/fitimage.py | 5 +-- meta/lib/oeqa/selftest/cases/gcc.py | 16 +++++++++ meta/lib/oeqa/selftest/cases/glibc.py | 4 +++ meta/lib/oeqa/selftest/cases/image_typedep.py | 1 + meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 +- .../oeqa/selftest/cases/incompatible_lic.py | 3 ++ .../oeqa/selftest/cases/kerneldevelopment.py | 1 + meta/lib/oeqa/selftest/cases/layerappend.py | 1 + meta/lib/oeqa/selftest/cases/liboe.py | 1 + meta/lib/oeqa/selftest/cases/lic_checksum.py | 1 + meta/lib/oeqa/selftest/cases/manifest.py | 4 ++- meta/lib/oeqa/selftest/cases/meta_ide.py | 1 + meta/lib/oeqa/selftest/cases/multiconfig.py | 1 + .../oeqa/selftest/cases/oelib/buildhistory.py | 2 ++ meta/lib/oeqa/selftest/cases/oelib/elf.py | 1 + meta/lib/oeqa/selftest/cases/oelib/license.py | 5 +++ meta/lib/oeqa/selftest/cases/oelib/path.py | 1 + meta/lib/oeqa/selftest/cases/oelib/types.py | 2 ++ meta/lib/oeqa/selftest/cases/oelib/utils.py | 2 ++ meta/lib/oeqa/selftest/cases/oescripts.py | 8 +++-- meta/lib/oeqa/selftest/cases/package.py | 3 ++ meta/lib/oeqa/selftest/cases/pkgdata.py | 1 + meta/lib/oeqa/selftest/cases/prservice.py | 1 + meta/lib/oeqa/selftest/cases/pseudo.py | 1 + meta/lib/oeqa/selftest/cases/recipetool.py | 3 +- meta/lib/oeqa/selftest/cases/recipeutils.py | 3 -- meta/lib/oeqa/selftest/cases/reproducible.py | 8 +++++ .../oeqa/selftest/cases/resulttooltests.py | 1 + meta/lib/oeqa/selftest/cases/runcmd.py | 2 ++ meta/lib/oeqa/selftest/cases/runqemu.py | 3 +- meta/lib/oeqa/selftest/cases/runtime_test.py | 7 ++-- meta/lib/oeqa/selftest/cases/selftest.py | 3 ++ meta/lib/oeqa/selftest/cases/signing.py | 2 -- meta/lib/oeqa/selftest/cases/sstatetests.py | 10 +++--- meta/lib/oeqa/selftest/cases/sysroot.py | 1 + meta/lib/oeqa/selftest/cases/tinfoil.py | 1 + meta/lib/oeqa/selftest/cases/wic.py | 7 ++-- meta/lib/oeqa/selftest/context.py | 5 +++ meta/lib/oeqa/targetcontrol.py | 2 +- meta/lib/oeqa/utils/__init__.py | 5 +++ meta/lib/oeqa/utils/buildproject.py | 1 + meta/lib/oeqa/utils/commands.py | 8 ++++- meta/lib/oeqa/utils/decorators.py | 19 ++++++++++ meta/lib/oeqa/utils/dump.py | 4 +++ meta/lib/oeqa/utils/ftools.py | 4 +++ meta/lib/oeqa/utils/git.py | 2 ++ meta/lib/oeqa/utils/gitarchive.py | 7 ++++ meta/lib/oeqa/utils/httpserver.py | 4 ++- meta/lib/oeqa/utils/logparser.py | 2 ++ meta/lib/oeqa/utils/metadata.py | 5 +++ meta/lib/oeqa/utils/network.py | 1 + meta/lib/oeqa/utils/nfs.py | 1 + meta/lib/oeqa/utils/package_manager.py | 11 ++++++ meta/lib/oeqa/utils/qemurunner.py | 5 +-- meta/lib/oeqa/utils/qemutinyrunner.py | 3 +- meta/lib/oeqa/utils/sshcontrol.py | 4 +-- meta/lib/oeqa/utils/subprocesstweak.py | 2 ++ meta/lib/oeqa/utils/targetbuild.py | 2 ++ meta/lib/oeqa/utils/testexport.py | 3 ++ meta/lib/rootfspostcommands.py | 3 ++ .../systemd/systemd-systemctl/systemctl | 2 ++ .../meson/meson/meson-setup.py | 3 ++ .../python/python3/create_manifest3.py | 11 +++--- .../python/python3/get_module_deps3.py | 2 +- meta/recipes-rt/rt-tests/files/rt_bmark.py | 16 +++++++++ scripts/bitbake-whatchanged | 7 ++++ scripts/buildhistory-collect-srcrevs | 3 ++ scripts/buildhistory-diff | 3 ++ scripts/buildstats-diff | 2 ++ scripts/combo-layer | 28 ++++++++++++++- scripts/contrib/bbvars.py | 5 +++ scripts/contrib/devtool-stress.py | 2 ++ scripts/contrib/graph-tool | 1 + scripts/contrib/image-manifest | 11 ++++++ scripts/contrib/list-packageconfig-flags.py | 8 +++++ scripts/contrib/oe-build-perf-report-email.py | 1 + scripts/contrib/patchreview.py | 5 +-- scripts/contrib/verify-homepage.py | 3 ++ scripts/cp-noerror | 2 ++ scripts/crosstap | 5 +++ scripts/devtool | 5 ++- scripts/gen-lockedsig-cache | 8 +++++ scripts/install-buildtools | 2 ++ scripts/lib/argparse_oe.py | 5 +++ scripts/lib/build_perf/__init__.py | 1 + scripts/lib/build_perf/report.py | 1 + scripts/lib/buildstats.py | 3 +- scripts/lib/checklayer/__init__.py | 14 ++++++++ scripts/lib/checklayer/case.py | 1 + scripts/lib/checklayer/cases/bsp.py | 4 ++- scripts/lib/checklayer/cases/common.py | 1 + scripts/lib/checklayer/cases/distro.py | 1 + scripts/lib/checklayer/context.py | 1 + scripts/lib/devtool/__init__.py | 17 +++++++++ scripts/lib/devtool/build.py | 3 ++ scripts/lib/devtool/build_image.py | 4 +++ scripts/lib/devtool/deploy.py | 3 +- scripts/lib/devtool/export.py | 3 +- scripts/lib/devtool/import.py | 2 ++ scripts/lib/devtool/menuconfig.py | 2 ++ scripts/lib/devtool/package.py | 2 ++ scripts/lib/devtool/runqemu.py | 2 ++ scripts/lib/devtool/sdk.py | 9 +++++ scripts/lib/devtool/search.py | 3 +- scripts/lib/devtool/standard.py | 23 ++++++++++++ scripts/lib/devtool/upgrade.py | 21 +++++++++++ scripts/lib/devtool/utilcmds.py | 1 + scripts/lib/recipetool/append.py | 7 ++++ scripts/lib/recipetool/create.py | 21 +++++++++++ scripts/lib/recipetool/create_buildsys.py | 7 +++- scripts/lib/recipetool/create_kernel.py | 3 ++ scripts/lib/recipetool/create_kmod.py | 2 ++ scripts/lib/recipetool/create_npm.py | 3 ++ scripts/lib/recipetool/setvar.py | 2 ++ scripts/lib/resulttool/log.py | 4 +++ scripts/lib/resulttool/manualexecution.py | 4 +++ scripts/lib/resulttool/merge.py | 2 ++ scripts/lib/resulttool/regression.py | 6 ++++ scripts/lib/resulttool/report.py | 3 +- scripts/lib/resulttool/resultutils.py | 16 +++++++++ scripts/lib/resulttool/store.py | 1 + scripts/lib/scriptpath.py | 2 ++ scripts/lib/scriptutils.py | 9 +++++ scripts/lib/wic/__init__.py | 1 + scripts/lib/wic/engine.py | 8 +++++ scripts/lib/wic/filemap.py | 9 +++++ scripts/lib/wic/help.py | 1 + scripts/lib/wic/ksparser.py | 10 +++++- scripts/lib/wic/misc.py | 9 +++++ scripts/lib/wic/partition.py | 1 + scripts/lib/wic/pluginbase.py | 4 +++ scripts/lib/wic/plugins/imager/direct.py | 3 ++ .../wic/plugins/source/bootimg-biosplusefi.py | 1 + scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +- .../wic/plugins/source/bootimg-partition.py | 3 +- .../lib/wic/plugins/source/bootimg-pcbios.py | 1 + scripts/lib/wic/plugins/source/empty.py | 1 + .../wic/plugins/source/isoimage-isohybrid.py | 1 + scripts/lib/wic/plugins/source/rawcopy.py | 1 + scripts/lib/wic/plugins/source/rootfs.py | 1 + scripts/oe-build-perf-report | 8 ++--- scripts/oe-build-perf-test | 1 + scripts/oe-depends-dot | 2 ++ scripts/oe-git-archive | 3 ++ scripts/oe-pkgdata-browser | 10 ++++++ scripts/oe-pkgdata-util | 16 +++++++-- scripts/oe-publish-sdk | 3 ++ scripts/oe-selftest | 3 +- scripts/oe-test | 2 ++ scripts/oe-trim-schemas | 3 ++ scripts/oepydevshell-internal.py | 4 +++ .../pybootchartgui/pybootchartgui/batch.py | 1 + scripts/pybootchartgui/pybootchartgui/draw.py | 27 ++++++++++++++ scripts/pybootchartgui/pybootchartgui/gui.py | 3 ++ .../pybootchartgui/pybootchartgui/main.py.in | 6 ++++ .../pybootchartgui/pybootchartgui/parsing.py | 28 ++++++++++++--- .../pybootchartgui/process_tree.py | 1 + .../pybootchartgui/pybootchartgui/samples.py | 10 ++++++ .../pybootchartgui/tests/parser_test.py | 4 +++ .../pybootchartgui/tests/process_tree_test.py | 2 ++ scripts/pythondeps | 1 + scripts/recipetool | 2 ++ scripts/relocate_sdk.py | 5 +++ scripts/resulttool | 2 ++ scripts/runqemu | 10 +++++- scripts/send-error-report | 7 ++-- scripts/sysroot-relativelinks.py | 2 ++ scripts/task-time | 7 ++++ scripts/test-remote-image | 10 ++++-- scripts/tiny/dirsize.py | 1 + scripts/tiny/ksize.py | 1 + scripts/tiny/ksum.py | 10 ++++++ scripts/verify-bashisms | 6 +++- scripts/wic | 16 +++++++++ scripts/yocto-check-layer | 4 +++ 340 files changed, 1367 insertions(+), 121 deletions(-)
meta-selftest/lib/devtool/bbpath.py +7 -0
@@ -3,27 +3,34 @@ import argparse already_loaded = False kept_context = None + def plugin_name(filename): return os.path.splitext(os.path.basename(filename))[0] + def plugin_init(plugins): global already_loaded already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) + def print_name(args, config, basepath, workspace): print(__file__) + def print_bbdir(args, config, basepath, workspace): print(__file__.replace('/lib/devtool/bbpath.py', '')) + def print_registered(args, config, basepath, workspace): global kept_context print(kept_context.loaded) + def multiloaded(args, config, basepath, workspace): global already_loaded print("yes" if already_loaded else "no") + def register_commands(subparsers, context): global kept_context kept_context = context
meta-selftest/lib/devtool/test.py +2 -0
@@ -1,9 +1,11 @@ import argparse + def selftest_reverse(args, config, basepath, workspace): """Reverse the value passed to verify the plugin is executing.""" print(args.value[::-1]) + def register_commands(subparsers, context): parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py +1 -0
@@ -3,6 +3,7 @@ from oeqa.runtime.cases.dnf import DnfTest from oeqa.utils.httpserver import HTTPService from oeqa.core.decorator.data import skipIfDataVar + class DnfSelftest(DnfTest): @classmethod
meta-selftest/lib/oeqa/runtime/cases/selftest.py +1 -0
@@ -1,6 +1,7 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends + class Selftest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh'])
meta-selftest/lib/oeqa/runtime/cases/virgl.py +1 -0
@@ -3,6 +3,7 @@ from oeqa.core.decorator.depends import OETestDepends import subprocess import oe.lsb + class VirglTest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh'])
meta-selftest/lib/recipetool/bbpath.py +7 -0
@@ -3,28 +3,35 @@ import argparse already_loaded = False register_count = 0 + def plugin_name(filename): return os.path.splitext(os.path.basename(filename))[0] + def plugin_init(plugins): global already_loaded already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) + def print_name(opts): print(__file__) + def print_bbdir(opts): print(__file__.replace('/lib/recipetool/bbpath.py', '')) + def print_registered(opts): #global kept_context #print(kept_context.loaded) print("1") + def multiloaded(opts): global already_loaded print("yes" if already_loaded else "no") + def register_commands(subparsers): global register_count register_count += 1
meta/files/ext-sdk-prepare.py +5 -0
@@ -7,9 +7,11 @@ import os import subprocess import signal + def reenable_sigint(): signal.signal(signal.SIGINT, signal.SIG_DFL) + def run_command_interruptible(cmd): """ Run a command with output displayed on the console, but ensure any Ctrl+C is
@@ -22,6 +24,7 @@ def run_command_interruptible(cmd): signal.signal(signal.SIGINT, signal.SIG_DFL) return ret + def get_last_consolelog(): '''Return the most recent console log file''' logdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tmp', 'log', 'cooker')
@@ -35,6 +38,7 @@ def get_last_consolelog(): return os.path.join(logdir, logfiles[-1]) return None + def main(): if len(sys.argv) < 2: print('Please specify output log file')
@@ -81,6 +85,7 @@ def main(): print('ERROR: SDK preparation failed: error log written to %s' % logfile) return ret + if __name__ == "__main__": try: ret = main()
meta/lib/bblayers/create.py +3 -0
@@ -13,15 +13,18 @@ from bblayers.common import LayerPlugin logger = logging.getLogger('bitbake-layers') + def plugin_init(plugins): return CreatePlugin() + def read_template(template, template_dir='templates'): lines = str() with open(os.path.join(os.path.dirname(__file__), template_dir, template)) as fd: lines = ''.join(fd.readlines()) return lines + class CreatePlugin(LayerPlugin): def do_create_layer(self, args): """Create a basic layer"""
meta/lib/buildstats.py +1 -1
@@ -9,6 +9,7 @@ import time import re import bb.event + class SystemStats: def __init__(self, d): bn = d.getVar('BUILDNAME')
@@ -103,7 +104,6 @@ class SystemStats: self.diskstats_data = diskdata return reduced - def _reduce_nop(self, time, data): return (time, data)
meta/lib/oe/buildhistory_analysis.py +7 -0
@@ -41,6 +41,7 @@ colours = { 'colour_remove': '', } + def init_colours(use_colours): global colours if use_colours:
@@ -56,6 +57,7 @@ def init_colours(use_colours): 'colour_remove': '', } + class ChangeRecord: def __init__(self, path, fieldname, oldvalue, newvalue, monitored): self.path = path
@@ -206,6 +208,7 @@ class ChangeRecord: return '%s%s' % (prefix, out) if out else '' + class FileChange: changetype_add = 'A' changetype_remove = 'R'
@@ -257,6 +260,7 @@ class FileChange: else: return '%s changed (unknown)' % self.path + def blob_to_dict(blob): alines = [line for line in blob.data_stream.read().decode('utf-8').splitlines()] adict = {}
@@ -283,8 +287,10 @@ def file_list_to_dict(lines): adict[path] = splitv[0:3] return adict + numeric_removal = str.maketrans('0123456789', 'XXXXXXXXXX') + def compare_file_lists(alines, blines, compare_ownership=True): adict = file_list_to_dict(alines) bdict = file_list_to_dict(blines)
@@ -523,6 +529,7 @@ def compare_siglists(a_blob, b_blob, taskdiff=False): blines = b_blob.data_stream.read().decode('utf-8').splitlines() keys = [] pnmap = {} + def readsigs(lines): sigs = {} for line in lines:
meta/lib/oe/cachedpath.py +1 -0
@@ -10,6 +10,7 @@ import os import errno import stat as statmod + class CachedPath(object): def __init__(self): self.statcache = {}
meta/lib/oe/classextend.py +4 -0
@@ -4,15 +4,18 @@ import collections + def get_packages(d): pkgs = d.getVar("PACKAGES_NONML") extcls = d.getVar("EXTENDERCLASS") return extcls.rename_packages_internal(pkgs) + def get_depends(varprefix, d): extcls = d.getVar("EXTENDERCLASS") return extcls.map_depends_variable(varprefix + "_NONML") + class ClassExtender(object): def __init__(self, extname, d): self.extname = extname
@@ -144,6 +147,7 @@ class ClassExtender(object): for subs in variables: self.d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1])) + class NativesdkClassExtender(ClassExtender): def map_depends(self, dep): if dep.startswith(self.extname):
meta/lib/oe/classutils.py +3 -0
@@ -2,12 +2,14 @@ # SPDX-License-Identifier: GPL-2.0-only # + class ClassRegistryMeta(type): """Give each ClassRegistry their own registry""" def __init__(cls, name, bases, attrs): cls.registry = {} type.__init__(cls, name, bases, attrs) + class ClassRegistry(type, metaclass=ClassRegistryMeta): """Maintain a registry of classes, indexed by name.
@@ -22,6 +24,7 @@ Subclasses of ClassRegistry may define an 'implemented' property to exert control over whether the class will be added to the registry (e.g. to keep abstract base classes out of the registry).""" priority = 0 + def __init__(cls, name, bases, attrs): super(ClassRegistry, cls).__init__(name, bases, attrs) try:
meta/lib/oe/copy_buildsystem.py +7 -0
@@ -13,6 +13,7 @@ import stat import shutil + def _smart_copy(src, dest): import subprocess # smart_copy will choose the correct function depending on whether the
@@ -27,6 +28,7 @@ def _smart_copy(src, dest): shutil.copyfile(src, dest) shutil.copymode(src, dest) + class BuildSystem(object): def __init__(self, context, d): self.d = d
@@ -171,12 +173,14 @@ class BuildSystem(object): return copied_corebase, layers_copied + def generate_locked_sigs(sigfile, d): bb.utils.mkdirhier(os.path.dirname(sigfile)) depd = d.getVar('BB_TASKDEPDATA', False) tasks = ['%s:%s' % (v[2], v[1]) for v in depd.values()] bb.parse.siggen.dump_lockedsigs(sigfile, tasks) + def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, onlynative, pruned_output): with open(lockedsigs, 'r') as infile: bb.utils.mkdirhier(os.path.dirname(pruned_output))
@@ -199,6 +203,7 @@ def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, onlynative, p invalue = True f.write(line) + def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output=None): merged = {} arch_order = []
@@ -254,6 +259,7 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu if merged_output: write_sigs_file(merged_output, arch_order, merged) + def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring="", filterfile=None): import shutil bb.note('Generating sstate-cache...')
@@ -275,6 +281,7 @@ def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cac bb.utils.mkdirhier(os.path.dirname(dest)) shutil.move(src, dest) + def check_sstate_task_list(d, targets, filteroutfile, cmdprefix='', cwd=None, logfile=None): import subprocess
meta/lib/oe/cve_check.py +2 -0
@@ -7,6 +7,7 @@ _Version = collections.namedtuple( "_Version", ["release", "patch_l", "pre_l", "pre_v"] ) + @functools.total_ordering class Version():
@@ -50,6 +51,7 @@ class Version(): return NotImplemented return self._key > other._key + def _cmpkey(release, patch_l, pre_l, pre_v): # remove leading 0 _release = tuple(
meta/lib/oe/data.py +2 -0
@@ -5,6 +5,7 @@ import json import oe.maketype + def typed_value(key, d): """Construct a value for the specified metadata variable, using its flags to determine the type and parameters for construction."""
@@ -21,6 +22,7 @@ def typed_value(key, d): except (TypeError, ValueError) as exc: bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) + def export2json(d, json_file, expand=True, searchString="", replaceString=""): data2export = {} keys2export = []
meta/lib/oe/distro_check.py +19 -1
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only # + def create_socket(url, d): import urllib from bb.utils import export_proxies
@@ -9,6 +10,7 @@ def create_socket(url, d): export_proxies(d) return urllib.request.urlopen(url) + def get_links_from_url(url, d): "Return all the href links found on the web location"
@@ -20,6 +22,7 @@ def get_links_from_url(url, d): hyperlinks.append(line['href'].strip('/')) return hyperlinks + def find_latest_numeric_release(url, d): "Find the latest listed numeric release on the given url" max = 0
@@ -35,10 +38,12 @@ def find_latest_numeric_release(url, d): maxstr = link return maxstr + def is_src_rpm(name): "Check if the link is pointing to a src.rpm file" return name.endswith(".src.rpm") + def package_name_from_srpm(srpm): "Strip out the package name from the src.rpm filename"
@@ -47,6 +52,7 @@ def package_name_from_srpm(srpm): (name, version, release) = srpm.replace(".src.rpm", "").rsplit("-", 2) return name + def get_source_package_list_from_url(url, section, d): "Return a sectioned list of package names from a URL list"
@@ -60,6 +66,7 @@ def get_source_package_list_from_url(url, section, d): new_pkgs.add(pkgs + ":" + section) return new_pkgs + def get_source_package_list_from_url_by_letter(url, section, d): import string from urllib.error import HTTPError
@@ -73,6 +80,7 @@ def get_source_package_list_from_url_by_letter(url, section, d): raise return packages + def get_latest_released_fedora_source_package_list(d): "Returns list of all the name os packages in the latest fedora distro" latest = find_latest_numeric_release("http://archive.fedoraproject.org/pub/fedora/linux/releases/", d)
@@ -80,6 +88,7 @@ def get_latest_released_fedora_source_package_list(d): package_names |= get_source_package_list_from_url_by_letter("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates", d) return latest, package_names + def get_latest_released_opensuse_source_package_list(d): "Returns list of all the name os packages in the latest opensuse distro" latest = find_latest_numeric_release("http://download.opensuse.org/source/distribution/leap", d)
@@ -88,11 +97,13 @@ def get_latest_released_opensuse_source_package_list(d): package_names |= get_source_package_list_from_url("http://download.opensuse.org/update/leap/%s/oss/src/" % latest, "updates", d) return latest, package_names + def get_latest_released_clear_source_package_list(d): latest = find_latest_numeric_release("https://download.clearlinux.org/releases/", d) package_names = get_source_package_list_from_url("https://download.clearlinux.org/releases/%s/clear/source/SRPMS/" % latest, "main", d) return latest, package_names + def find_latest_debian_release(url, d): "Find the latest listed debian release on the given url"
@@ -105,6 +116,7 @@ def find_latest_debian_release(url, d): except: return "_NotFound_" + def get_debian_style_source_package_list(url, section, d): "Return the list of package-names stored in the debian style Sources.gz file" import gzip
@@ -116,6 +128,7 @@ def get_debian_style_source_package_list(url, section, d): package_names.add(pkg + ":" + section) return package_names + def get_latest_released_debian_source_package_list(d): "Returns list of all the name of packages in the latest debian distro" latest = find_latest_debian_release("http://ftp.debian.org/debian/dists/", d)
@@ -125,6 +138,7 @@ def get_latest_released_debian_source_package_list(d): package_names |= get_debian_style_source_package_list(url, "updates", d) return latest, package_names + def find_latest_ubuntu_release(url, d): """ Find the latest listed Ubuntu release on the given ubuntu/dists/ URL.
@@ -139,6 +153,7 @@ def find_latest_ubuntu_release(url, d): return distro return "_NotFound_" + def get_latest_released_ubuntu_source_package_list(d): "Returns list of all the name os packages in the latest ubuntu distro" latest = find_latest_ubuntu_release("http://archive.ubuntu.com/ubuntu/dists/", d)
@@ -148,6 +163,7 @@ def get_latest_released_ubuntu_source_package_list(d): package_names |= get_debian_style_source_package_list(url, "updates", d) return latest, package_names + def create_distro_packages_list(distro_check_dir, d): import shutil
@@ -177,6 +193,7 @@ def create_distro_packages_list(distro_check_dir, d): for pkg in sorted(package_list): f.write(pkg + "\n") + def update_distro_data(distro_check_dir, datetime, d): """ If distro packages list data is old then rebuild it.
@@ -190,7 +207,6 @@ def update_distro_data(distro_check_dir, datetime, d): except OSError: raise Exception('Unable to create directory %s' % (distro_check_dir)) - datetime_file = os.path.join(distro_check_dir, "build_datetime") saved_datetime = "_invalid_" import fcntl
@@ -214,6 +230,7 @@ def update_distro_data(distro_check_dir, datetime, d): fcntl.lockf(f, fcntl.LOCK_UN) f.close() + def compare_in_distro_packages_list(distro_check_dir, d): if not os.path.isdir(distro_check_dir): raise Exception("compare_in_distro_packages_list: invalid distro_check_dir passed")
@@ -278,6 +295,7 @@ def compare_in_distro_packages_list(distro_check_dir, d): bb.note("Matching: %s" % matching_distros) return matching_distros + def create_log_file(d, logname): logpath = d.getVar('LOG_DIR') bb.utils.mkdirhier(logpath)
meta/lib/oe/elf.py +1 -0
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only # + def machine_dict(d): # TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit? machdata = {
meta/lib/oe/gpg_sign.py +2 -3
@@ -9,8 +9,10 @@ import bb import subprocess import shlex + class LocalSigner(object): """Class for handling local (on the build host) signing""" + def __init__(self, d): self.gpg_bin = d.getVar('GPG_BIN') or \ bb.utils.which(os.getenv('PATH'), 'gpg')
@@ -25,7 +27,6 @@ class LocalSigner(object): self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign") self.gpg_version = self.get_gpg_version() - def export_pubkey(self, output_file, keyid, armor=True): """Export GPG public key to a file""" cmd = self.gpg_cmd + ["--no-permission-warning", "--batch", "--yes", "--export", "-o", output_file]
@@ -98,7 +99,6 @@ class LocalSigner(object): bb.error("OS error (%s): %s" % (e.errno, e.strerror)) raise Exception("Failed to sign '%s" % input_file) - def get_gpg_version(self): """Return the gpg version as a tuple of ints""" try:
@@ -108,7 +108,6 @@ class LocalSigner(object): except subprocess.CalledProcessError as e: bb.fatal("Could not get gpg version: %s" % e) - def verify(self, sig_file): """Verify signature""" cmd = self.gpg_cmd + ["--verify", "--no-permission-warning"]
meta/lib/oe/license.py +19 -0
@@ -7,6 +7,7 @@ import ast import re from fnmatch import fnmatchcase as fnmatch + def license_ok(license, dont_want_licenses): """ Return False if License exist in dont_want_licenses else True """ for dwl in dont_want_licenses:
@@ -14,9 +15,11 @@ def license_ok(license, dont_want_licenses): return False return True + class LicenseError(Exception): pass + class LicenseSyntaxError(LicenseError): def __init__(self, licensestr, exc): self.licensestr = licensestr
@@ -26,6 +29,7 @@ class LicenseSyntaxError(LicenseError): def __str__(self): return "error in '%s': %s" % (self.licensestr, self.exc) + class InvalidLicense(LicenseError): def __init__(self, license): self.license = license
@@ -34,12 +38,15 @@ class InvalidLicense(LicenseError): def __str__(self): return "invalid characters in license '%s'" % self.license + license_operator_chars = '&|() ' license_operator = re.compile(r'([' + license_operator_chars + '])') license_pattern = re.compile(r'[a-zA-Z0-9.+_\-]+$') + class LicenseVisitor(ast.NodeVisitor): """Get elements based on OpenEmbedded license strings""" + def get_elements(self, licensestr): new_elements = [] elements = list([x for x in license_operator.split(licensestr) if x.strip()])
@@ -56,16 +63,20 @@ class LicenseVisitor(ast.NodeVisitor): """Syntax tree visitor which can accept elements previously generated with OpenEmbedded license string""" + def visit_elements(self, elements): self.visit(ast.parse(' '.join(elements))) """Syntax tree visitor which can accept OpenEmbedded license strings""" + def visit_string(self, licensestr): self.visit_elements(self.get_elements(licensestr)) + class FlattenVisitor(LicenseVisitor): """Flatten a license tree (parsed from a string) by selecting one of each set of OR options, in the way the user specifies""" + def __init__(self, choose_licenses): self.choose_licenses = choose_licenses self.licenses = []
@@ -87,6 +98,7 @@ class FlattenVisitor(LicenseVisitor): else: self.generic_visit(node) + def flattened_licenses(licensestr, choose_licenses): """Given a license string and choose_licenses function, return a flat list of licenses""" flatten = FlattenVisitor(choose_licenses)
@@ -96,6 +108,7 @@ def flattened_licenses(licensestr, choose_licenses): raise LicenseSyntaxError(licensestr, exc) return flatten.licenses + def is_included(licensestr, whitelist=None, blacklist=None): """Given a license string and whitelist and blacklist, determine if the license string matches the whitelist and does not match the blacklist.
@@ -142,9 +155,11 @@ def is_included(licensestr, whitelist=None, blacklist=None): else: return True, included + class ManifestVisitor(LicenseVisitor): """Walk license tree (parsed from a string) removing the incompatible licenses specified""" + def __init__(self, dont_want_licenses, canonical_license, d): self._dont_want_licenses = dont_want_licenses self._canonical_license = canonical_license
@@ -198,6 +213,7 @@ class ManifestVisitor(LicenseVisitor): self.generic_visit(node) + def manifest_licenses(licensestr, dont_want_licenses, canonical_license, d): """Given a license string and dont_want_licenses list, return license string filtered and a list of licenses"""
@@ -219,14 +235,17 @@ def manifest_licenses(licensestr, dont_want_licenses, canonical_license, d): return (manifest.licensestr, manifest.licenses) + class ListVisitor(LicenseVisitor): """Record all different licenses found in the license string""" + def __init__(self): self.licenses = set() def visit_Str(self, node): self.licenses.add(node.s) + def list_licenses(licensestr): """Simply get a list of all licenses mentioned in a license string. Binary operators are not applied or taken into account in any way"""
meta/lib/oe/lsb.py +5 -0
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only # + def get_os_release(): """Get all key-value pairs from /etc/os-release as a dict""" from collections import OrderedDict
@@ -17,6 +18,7 @@ def get_os_release(): data[key.strip()] = val.strip('"') return data + def release_dict_osr(): """ Populate a dict with pertinent values from /etc/os-release """ data = {}
@@ -28,6 +30,7 @@ def release_dict_osr(): return data + def release_dict_lsb(): """ Return the output of lsb_release -ir as a dictionary """ from subprocess import PIPE
@@ -57,6 +60,7 @@ def release_dict_lsb(): return data + def release_dict_file(): """ Try to gather release information manually when other methods fail """ data = {}
@@ -89,6 +93,7 @@ def release_dict_file(): return {} return data + def distro_identifier(adjust_hook=None): """Return a distro identifier string based upon lsb_release -ri, with optional adjustment via a hook"""
meta/lib/oe/maketype.py +7 -0
@@ -19,9 +19,11 @@ except ImportError: available_types = {} + class MissingFlag(TypeError): """A particular flag is required to construct the type, but has not been provided.""" + def __init__(self, flag, type): self.flag = flag self.type = type
@@ -30,6 +32,7 @@ class MissingFlag(TypeError): def __str__(self): return "Type '%s' requires flag '%s'" % (self.type, self.flag) + def factory(var_type): """Return the factory for a specified type.""" if var_type is None:
@@ -41,6 +44,7 @@ def factory(var_type): raise TypeError("Invalid type '%s':\n Valid types: %s" % (var_type, ', '.join(available_types))) + def create(value, var_type, **flags): """Create an object of the specified type, given the specified flags and string value."""
@@ -55,6 +59,7 @@ def create(value, var_type, **flags): return obj(value, **objflags) + def get_callable_args(obj): """Grab all but the first argument of the specified callable, returning the list, as well as a list of which of the arguments have default
@@ -76,6 +81,7 @@ def get_callable_args(obj): optional |= set(flaglist[-len(defaults):]) return flaglist, optional + def factory_setup(name, obj): """Prepare a factory for use.""" args, optional = get_callable_args(obj)
@@ -89,6 +95,7 @@ def factory_setup(name, obj): if not hasattr(obj, 'name'): obj.name = name + def register(name, factory): """Register a type, given its name and a factory callable.
meta/lib/oe/manifest.py +4 -1
@@ -7,6 +7,7 @@ import os import re import bb + class Manifest(object, metaclass=ABCMeta): """ This is an abstract class. Do not instantiate this directly.
@@ -84,6 +85,7 @@ class Manifest(object, metaclass=ABCMeta): This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk). This will be used for testing until the class is implemented properly! """ + def _create_dummy_initial(self): image_rootfs = self.d.getVar('IMAGE_ROOTFS') pkg_list = dict()
@@ -144,6 +146,7 @@ class Manifest(object, metaclass=ABCMeta): The following function parses an initial manifest and returns a dictionary object with the must install, attempt only, multilib and language packages. """ + def parse_initial_manifest(self): pkgs = dict()
@@ -175,6 +178,7 @@ class Manifest(object, metaclass=ABCMeta): This following function parses a full manifest and return a list object with packages. ''' + def parse_full_manifest(self): installed_pkgs = list() if not os.path.exists(self.full_manifest):
@@ -188,7 +192,6 @@ class Manifest(object, metaclass=ABCMeta): return installed_pkgs - def create_manifest(d, final_manifest=False, manifest_dir=None, manifest_type=Manifest.MANIFEST_TYPE_IMAGE): import importlib
meta/lib/oe/package.py +10 -0
@@ -6,6 +6,7 @@ import stat import mmap import subprocess + def runstrip(arg): # Function to strip a single file, called from split_and_strip_files below # A working 'file' (one which works on the target architecture)
@@ -51,11 +52,15 @@ def runstrip(arg): os.chmod(file, origmode) # Detect .ko module by searching for "vermagic=" string + + def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 # Detect if .ko module is signed + + def is_kernel_module_signed(path): with open(path, "rb") as f: f.seek(-28, 2)
@@ -69,6 +74,8 @@ def is_kernel_module_signed(path): # 4 - executable # 8 - shared library # 16 - kernel module + + def is_elf(path): exec_type = 0 result = subprocess.check_output(["file", "-b", path], stderr=subprocess.STDOUT).decode("utf-8")
@@ -86,6 +93,7 @@ def is_elf(path): exec_type |= 16 return (path, exec_type) + def is_static_lib(path): if path.endswith('.a') and not os.path.islink(path): with open(path, 'rb') as fh:
@@ -96,6 +104,7 @@ def is_static_lib(path): return start == magic return False + def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, d, qa_already_stripped=False): """ Strip executable code (like executables, shared libraries) _in_place_
@@ -189,6 +198,7 @@ def file_translate(file): ft = ft.replace("_", "@underscore@") return ft + def filedeprunner(arg): import re import subprocess
meta/lib/oe/package_manager/__init__.py +9 -1
@@ -19,6 +19,8 @@ import hashlib import fnmatch # this can be used by all PM backends to create the index files in parallel + + def create_index(arg): index_cmd = arg
@@ -27,6 +29,7 @@ def create_index(arg): if result: bb.note(result) + def opkg_query(cmd_output): """ This method parse the output from the package managerand return
@@ -88,12 +91,14 @@ def opkg_query(cmd_output): return output + def failed_postinsts_abort(pkgs, log_path): bb.fatal("""Postinstall scriptlets of %s have failed. If the intention is to defer them to first boot, then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported. Details of the failure are in %s.""" % (pkgs, log_path)) + def generate_locale_archive(d, rootfs, target_arch, localedir): # Pretty sure we don't need this for locale archive generation but # keeping it to be safe...
@@ -140,6 +145,7 @@ def generate_locale_archive(d, rootfs, target_arch, localedir): cmd += ["--add-to-archive", path] subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT) + class Indexer(object, metaclass=ABCMeta): def __init__(self, d, deploy_dir): self.d = d
@@ -149,6 +155,7 @@ class Indexer(object, metaclass=ABCMeta): def write_index(self): pass + class PkgsList(object, metaclass=ABCMeta): def __init__(self, d, rootfs_dir): self.d = d
@@ -158,6 +165,7 @@ class PkgsList(object, metaclass=ABCMeta): def list_pkgs(self): pass + class PackageManager(object, metaclass=ABCMeta): """ This is an abstract class. Do not instantiate this directly.
@@ -212,7 +220,6 @@ class PackageManager(object, metaclass=ABCMeta): # call the backend dependent handler self._handle_intercept_failure(registered_pkgs) - def run_intercepts(self, populate_sdk=None): intercepts_dir = self.intercepts_dir
@@ -451,6 +458,7 @@ class PackageManager(object, metaclass=ABCMeta): return res return _append(uris, base_paths) + def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies): """ Go through our do_package_write_X dependencies and hardlink the packages we depend
meta/lib/oe/package_manager/deb/__init__.py +4 -2
@@ -6,6 +6,7 @@ import re import subprocess from oe.package_manager import * + class DpkgIndexer(Indexer): def _create_configs(self): bb.utils.mkdirhier(self.apt_conf_dir)
@@ -79,6 +80,7 @@ class DpkgIndexer(Indexer): if self.d.getVar('PACKAGE_FEED_SIGN') == '1': raise NotImplementedError('Package feed signing not implementd for dpkg') + class PMPkgsList(PkgsList): def list_pkgs(self):
@@ -96,6 +98,7 @@ class PMPkgsList(PkgsList): return opkg_query(cmd_output) + class OpkgDpkgPM(PackageManager): def __init__(self, d, target_rootfs): """
@@ -163,6 +166,7 @@ class OpkgDpkgPM(PackageManager): def _handle_intercept_failure(self, registered_pkgs): self.mark_packages("unpacked", registered_pkgs.split()) + class DpkgPM(OpkgDpkgPM): def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None, deb_repo_workdir="oe-rootfs-repo", filterbydependencies=True): super(DpkgPM, self).__init__(d, target_rootfs)
@@ -308,7 +312,6 @@ class DpkgPM(OpkgDpkgPM): bb.utils.rename(os.path.join(root, file), os.path.join(root, new_file)) - def remove(self, pkgs, with_dependencies=True): if not pkgs: return
@@ -348,7 +351,6 @@ class DpkgPM(OpkgDpkgPM): if feed_uris == "": return - sources_conf = os.path.join("%s/etc/apt/sources.list" % self.target_rootfs) if not os.path.exists(os.path.dirname(sources_conf)):
meta/lib/oe/package_manager/deb/manifest.py +1 -0
@@ -4,6 +4,7 @@ from oe.manifest import Manifest + class PkgManifest(Manifest): def create_initial(self): with open(self.initial_manifest, "w+") as manifest:
meta/lib/oe/package_manager/deb/rootfs.py +2 -1
@@ -10,6 +10,7 @@ from oe.utils import execute_pre_post_process from oe.package_manager.deb.manifest import PkgManifest from oe.package_manager.deb import DpkgPM + class DpkgOpkgRootfs(Rootfs): def __init__(self, d, progress_reporter=None, logcatcher=None): super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
@@ -120,6 +121,7 @@ class DpkgOpkgRootfs(Rootfs): num += 1 + class PkgRootfs(DpkgOpkgRootfs): def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None): super(PkgRootfs, self).__init__(d, progress_reporter, logcatcher)
@@ -136,7 +138,6 @@ class PkgRootfs(DpkgOpkgRootfs): d.getVar('PACKAGE_ARCHS'), d.getVar('DPKG_ARCH')) - def _create(self): pkgs_to_install = self.manifest.parse_initial_manifest() deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS')
meta/lib/oe/package_manager/deb/sdk.py +1 -1
@@ -10,6 +10,7 @@ from oe.manifest import Manifest from oe.package_manager.deb import DpkgPM from oe.package_manager.deb.manifest import PkgManifest + class PkgSdk(Sdk): def __init__(self, d, manifest_dir=None): super(PkgSdk, self).__init__(d, manifest_dir)
@@ -17,7 +18,6 @@ class PkgSdk(Sdk): self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt") self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt-sdk") - self.target_manifest = PkgManifest(d, self.manifest_dir, Manifest.MANIFEST_TYPE_SDK_TARGET) self.host_manifest = PkgManifest(d, self.manifest_dir,
meta/lib/oe/package_manager/ipk/__init__.py +3 -2
@@ -7,6 +7,7 @@ import shutil import subprocess from oe.package_manager import * + class OpkgIndexer(Indexer): def write_index(self): arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
@@ -59,6 +60,7 @@ class OpkgIndexer(Indexer): self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), armor=is_ascii_sig) + class PMPkgsList(PkgsList): def __init__(self, d, rootfs_dir): super(PMPkgsList, self).__init__(d, rootfs_dir)
@@ -87,7 +89,6 @@ class PMPkgsList(PkgsList): return opkg_query(cmd_output) - class OpkgDpkgPM(PackageManager): def __init__(self, d, target_rootfs): """
@@ -155,6 +156,7 @@ class OpkgDpkgPM(PackageManager): def _handle_intercept_failure(self, registered_pkgs): self.mark_packages("unpacked", registered_pkgs.split()) + class OpkgPM(OpkgDpkgPM): def __init__(self, d, target_rootfs, config_file, archs, task_name='target', ipk_repo_workdir="oe-rootfs-repo", filterbydependencies=True, prepare_index=True): super(OpkgPM, self).__init__(d, target_rootfs)
@@ -265,7 +267,6 @@ class OpkgPM(OpkgDpkgPM): cfg_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists')) cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status')) - def _create_config(self): with open(self.config_file, "w+") as config_file: priority = 1
meta/lib/oe/package_manager/ipk/manifest.py +2 -0
@@ -4,10 +4,12 @@ from oe.manifest import Manifest + class PkgManifest(Manifest): """ Returns a dictionary object with mip and mlp packages. """ + def _split_multilib(self, pkg_list): pkgs = dict()
meta/lib/oe/package_manager/ipk/rootfs.py +6 -0
@@ -11,6 +11,7 @@ from oe.utils import execute_pre_post_process from oe.package_manager.ipk.manifest import PkgManifest from oe.package_manager.ipk import OpkgPM + class DpkgOpkgRootfs(Rootfs): def __init__(self, d, progress_reporter=None, logcatcher=None): super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
@@ -121,6 +122,7 @@ class DpkgOpkgRootfs(Rootfs): num += 1 + class PkgRootfs(DpkgOpkgRootfs): def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None): super(PkgRootfs, self).__init__(d, progress_reporter, logcatcher)
@@ -173,6 +175,7 @@ class PkgRootfs(DpkgOpkgRootfs): creation and the file has been changed, so we need to prelink the other one and compare them. ''' + def _file_equal(self, key, f1, f2): # Both of them are not prelinked
@@ -198,6 +201,7 @@ class PkgRootfs(DpkgOpkgRootfs): See commit: "image.bbclass: Added variables for multilib support." by Lianhao Lu. """ + def _multilib_sanity_test(self, dirs): allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP")
@@ -259,6 +263,7 @@ class PkgRootfs(DpkgOpkgRootfs): unneeded pkgs by comparing the old full manifest in previous existing image and the new full manifest in the current image. ''' + def _remove_extra_packages(self, pkgs_initial_install): if self.inc_opkg_image_gen == "1": # Parse full manifest in previous existing image creation session
@@ -286,6 +291,7 @@ class PkgRootfs(DpkgOpkgRootfs): The conditions include any of 'PACKAGE_EXCLUDE, NO_RECOMMENDATIONS and BAD_RECOMMENDATIONS' has been changed. ''' + def _remove_old_rootfs(self): if self.inc_opkg_image_gen != "1": return True
meta/lib/oe/package_manager/ipk/sdk.py +1 -0
@@ -10,6 +10,7 @@ from oe.package_manager.ipk.manifest import PkgManifest from oe.manifest import Manifest from oe.package_manager.ipk import OpkgPM + class PkgSdk(Sdk): def __init__(self, d, manifest_dir=None): super(PkgSdk, self).__init__(d, manifest_dir)
meta/lib/oe/package_manager/rpm/__init__.py +3 -2
@@ -6,6 +6,7 @@ import shutil import subprocess from oe.package_manager import * + class RpmIndexer(Indexer): def write_index(self): self.do_write_index(self.deploy_dir)
@@ -30,6 +31,7 @@ class RpmIndexer(Indexer): self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), armor=is_ascii_sig) + class RpmSubdirIndexer(RpmIndexer): def write_index(self): bb.note("Generating package index for %s" % (self.deploy_dir))
@@ -50,6 +52,7 @@ class PMPkgsList(PkgsList): def list_pkgs(self): return RpmPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR'), needfeed=False).list_installed() + class RpmPM(PackageManager): def __init__(self, d,
@@ -102,7 +105,6 @@ class RpmPM(PackageManager): open(oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"), 'w').write("") - def _configure_rpm(self): # We need to configure rpm to use our primary package architecture as the installation architecture, # and to make it compatible with other package architectures that we use.
@@ -180,7 +182,6 @@ class RpmPM(PackageManager): os.environ['INTERCEPT_DIR'] = self.intercepts_dir os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE') - def install(self, pkgs, attempt_only=False): if len(pkgs) == 0: return
meta/lib/oe/package_manager/rpm/manifest.py +2 -0
@@ -4,10 +4,12 @@ from oe.manifest import Manifest + class PkgManifest(Manifest): """ Returns a dictionary object with mip and mlp packages. """ + def _split_multilib(self, pkg_list): pkgs = dict()
meta/lib/oe/package_manager/rpm/rootfs.py +2 -1
@@ -8,6 +8,7 @@ from oe.utils import execute_pre_post_process from oe.package_manager.rpm.manifest import PkgManifest from oe.package_manager.rpm import RpmPM + class PkgRootfs(Rootfs): def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None): super(PkgRootfs, self).__init__(d, progress_reporter, logcatcher)
@@ -36,6 +37,7 @@ class PkgRootfs(Rootfs): unneeded pkgs by comparing the new install solution manifest and the old installed manifest. ''' + def _create_incremental(self, pkgs_initial_install): if self.inc_rpm_image_gen == "1":
@@ -118,7 +120,6 @@ class PkgRootfs(Rootfs): if self.progress_reporter: self.progress_reporter.next_stage() - @staticmethod def _depends_list(): return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 'RPM_PREPROCESS_COMMANDS',
meta/lib/oe/package_manager/rpm/sdk.py +1 -0
@@ -9,6 +9,7 @@ from oe.manifest import Manifest from oe.package_manager.rpm.manifest import PkgManifest from oe.package_manager.rpm import RpmPM + class PkgSdk(Sdk): def __init__(self, d, manifest_dir=None, rpm_workdir="oe-sdk-repo"): super(PkgSdk, self).__init__(d, manifest_dir)
meta/lib/oe/packagedata.py +12 -0
@@ -5,9 +5,11 @@ import codecs import os + def packaged(pkg, d): return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK) + def read_pkgdatafile(fn): pkgdata = {}
@@ -27,19 +29,24 @@ def read_pkgdatafile(fn): return pkgdata + def get_subpkgedata_fn(pkg, d): return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg) + def has_subpkgdata(pkg, d): return os.access(get_subpkgedata_fn(pkg, d), os.R_OK) + def read_subpkgdata(pkg, d): return read_pkgdatafile(get_subpkgedata_fn(pkg, d)) + def has_pkgdata(pn, d): fn = d.expand('${PKGDATA_DIR}/%s' % pn) return os.access(fn, os.R_OK) + def read_pkgdata(pn, d): fn = d.expand('${PKGDATA_DIR}/%s' % pn) return read_pkgdatafile(fn)
@@ -47,6 +54,8 @@ def read_pkgdata(pn, d): # # Collapse FOO_pkg variables into FOO # + + def read_subpkgdata_dict(pkg, d): ret = {} subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
@@ -57,6 +66,7 @@ def read_subpkgdata_dict(pkg, d): ret[newvar] = subd[var] return ret + def _pkgmap(d): """Return a dictionary mapping package to recipe name."""
@@ -81,6 +91,7 @@ def _pkgmap(d): return pkgmap + def pkgmap(d): """Return a dictionary mapping package to recipe name. Cache the mapping in the metadata"""
@@ -92,6 +103,7 @@ def pkgmap(d): return pkgmap_data + def recipename(pkg, d): """Return the recipe name for the given binary package name."""
meta/lib/oe/packagegroup.py +6 -0
@@ -4,27 +4,33 @@ import itertools + def is_optional(feature, d): return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional")) + def packages(features, d): for feature in features: packages = d.getVar("FEATURE_PACKAGES_%s" % feature) for pkg in (packages or "").split(): yield pkg + def required_packages(features, d): req = [feature for feature in features if not is_optional(feature, d)] return packages(req, d) + def optional_packages(features, d): opt = [feature for feature in features if is_optional(feature, d)] return packages(opt, d) + def active_packages(features, d): return itertools.chain(required_packages(features, d), optional_packages(features, d)) + def active_recipes(features, d): import oe.packagedata
meta/lib/oe/patch.py +10 -3
@@ -5,6 +5,7 @@ import oe.path import oe.types + class NotFoundError(bb.BBHandledException): def __init__(self, path): self.path = path
@@ -12,6 +13,7 @@ class NotFoundError(bb.BBHandledException): def __str__(self): return "Error: %s not found." % self.path + class CmdError(bb.BBHandledException): def __init__(self, command, exitstatus, output): self.command = command
@@ -56,6 +58,7 @@ def runcmd(args, dir=None): if dir: os.chdir(olddir) + class PatchError(Exception): def __init__(self, msg): self.msg = msg
@@ -63,6 +66,7 @@ class PatchError(Exception): def __str__(self): return "Patch Error: %s" % self.msg + class PatchSet(object): defaults = { "strippath": 1
@@ -290,6 +294,7 @@ class PatchTree(PatchSet): """""" self.Pop(all=True) + class GitApplyTree(PatchTree): patch_line_prefix = '%% original patch' ignore_commit_prefix = '%% ignore'
@@ -569,7 +574,6 @@ class QuiltTree(PatchSet): def _quiltpatchpath(self, file): return os.path.join(self.dir, "patches", os.path.basename(file)) - def __init__(self, dir, d): PatchSet.__init__(self, dir, d) self.initialized = False
@@ -632,7 +636,6 @@ class QuiltTree(PatchSet): self.patches.insert(self._current or 0, patch) - def Push(self, force=False, all=False, run=True): # quilt push [-f]
@@ -690,6 +693,7 @@ class QuiltTree(PatchSet): args.append(os.path.basename(self.patches[kwargs["patch"]]["quiltfile"])) self._runcmd(args) + class Resolver(object): def __init__(self, patchset, terminal): raise NotImplementedError()
@@ -703,6 +707,7 @@ class Resolver(object): def Finalize(self): raise NotImplementedError() + class NOOPResolver(Resolver): def __init__(self, patchset, terminal): self.patchset = patchset
@@ -721,6 +726,8 @@ class NOOPResolver(Resolver): # Patch resolver which relies on the user doing all the work involved in the # resolution, with the exception of refreshing the remote copy of the patch # files (the urls). + + class UserResolver(Resolver): def __init__(self, patchset, terminal): self.patchset = patchset
@@ -803,6 +810,7 @@ def patch_path(url, fetch, workdir, expand=True): return local + def src_patches(d, all=False, expand=True): workdir = d.getVar('WORKDIR') fetch = bb.fetch2.Fetch([], d)
@@ -866,7 +874,6 @@ def should_apply(parm, d): if "mindate" in parm and parm["mindate"] > srcdate: return False, 'is predated' - if "minrev" in parm: srcrev = d.getVar('SRCREV') if srcrev and srcrev < parm["minrev"]:
meta/lib/oe/path.py +17 -0
@@ -8,10 +8,12 @@ import shutil import subprocess import os.path + def join(*paths): """Like os.path.join but doesn't treat absolute RHS specially""" return os.path.normpath("/".join(paths)) + def relative(src, dest): """ Return a relative path from src to dest.
@@ -27,6 +29,7 @@ def relative(src, dest): return os.path.relpath(dest, src) + def make_relative_symlink(path): """ Convert an absolute symlink to a relative one """ if not os.path.islink(path):
@@ -54,6 +57,7 @@ def make_relative_symlink(path): os.remove(path) os.symlink(base, path) + def replace_absolute_symlinks(basedir, d): """ Walk basedir looking for absolute symlinks and replacing them with relative ones.
@@ -75,6 +79,7 @@ def replace_absolute_symlinks(basedir, d): os.remove(path) os.symlink(base, path) + def format_display(path, metadata): """ Prepare a path for display to the user. """ rel = relative(metadata.getVar("TOPDIR"), path)
@@ -83,6 +88,7 @@ def format_display(path, metadata): else: return rel + def copytree(src, dst): # We could use something like shutil.copytree here but it turns out to # to be slow. It takes twice as long copying to an empty directory.
@@ -93,6 +99,7 @@ def copytree(src, dst): cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst) subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) + def copyhardlinktree(src, dst): """Make a tree of hard links when possible, otherwise copy.""" bb.utils.mkdirhier(dst)
@@ -133,6 +140,7 @@ def copyhardlinktree(src, dst): else: copytree(src, dst) + def copyhardlink(src, dst): """Make a hard link when possible, otherwise copy."""
@@ -141,6 +149,7 @@ def copyhardlink(src, dst): except OSError: shutil.copy(src, dst) + def remove(path, recurse=True): """ Equivalent to rm -f or rm -rf
@@ -159,6 +168,7 @@ def remove(path, recurse=True): elif exc.errno != errno.ENOENT: raise + def symlink(source, destination, force=False): """Create a symbolic link""" try:
@@ -169,6 +179,7 @@ def symlink(source, destination, force=False): if e.errno != errno.EEXIST or os.readlink(destination) != source: raise + def find(dir, **walkoptions): """ Given a directory, recurses into that directory, returning all files as absolute paths. """
@@ -182,6 +193,7 @@ def find(dir, **walkoptions): def __is_path_below(file, root): return (file + os.path.sep).startswith(root) + def __realpath_rel(start, rel_path, root, loop_cnt, assume_dir): """Calculates real path of symlink 'start' + 'rel_path' below 'root'; no part of 'start' below 'root' must contain symlinks. """
@@ -206,6 +218,7 @@ def __realpath_rel(start, rel_path, root, loop_cnt, assume_dir): return start + def __realpath(file, root, loop_cnt, assume_dir): while os.path.islink(file) and len(file) >= len(root): if loop_cnt == 0:
@@ -229,6 +242,7 @@ def __realpath(file, root, loop_cnt, assume_dir): return (file, is_dir) + def realpath(file, root, use_physdir=True, loop_cnt=100, assume_dir=False): """ Returns the canonical path of 'file' with assuming a toplevel 'root' directory. When 'use_physdir' is set, all
@@ -265,6 +279,7 @@ def realpath(file, root, use_physdir=True, loop_cnt=100, assume_dir=False): return file + def is_path_parent(possible_parent, *paths): """ Return True if a path is the parent of another, False otherwise.
@@ -287,6 +302,7 @@ def is_path_parent(possible_parent, *paths): return False return True + def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=False): """Search a search path for pathname, supporting wildcards.
@@ -320,6 +336,7 @@ def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=F return files + def canonicalize(paths, sep=','): """Given a string with paths (separated by commas by default), expand each path using os.path.realpath() and return the resulting paths as a
meta/lib/oe/prservice.py +5 -0
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only # + def prserv_make_conn(d, check=False): import prserv.serv host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
@@ -17,6 +18,7 @@ def prserv_make_conn(d, check=False): return conn + def prserv_dump_db(d): if not d.getVar('PRSERV_HOST'): bb.error("Not using network based PR service")
@@ -36,6 +38,7 @@ def prserv_dump_db(d): opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL')) return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col) + def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None): if not d.getVar('PRSERV_HOST'): bb.error("Not using network based PR service")
@@ -72,6 +75,7 @@ def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksu imported.append((version, pkgarch, checksum, value)) return imported + def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False): import bb.utils #initilize the output file
@@ -115,6 +119,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False): f.write("PRAUTO_%s_%s = \"%s\"\n" % (str(datainfo[idx[i]]['version']), str(datainfo[idx[i]]['pkgarch']), str(datainfo[idx[i]]['value']))) bb.utils.unlockfile(lf) + def prserv_check_avail(d): host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f]) try:
meta/lib/oe/qa.py +4 -0
@@ -6,9 +6,11 @@ import os import struct import mmap + class NotELFFileError(Exception): pass + class ELFFile: EI_NIDENT = 16
@@ -151,6 +153,7 @@ class ELFFile: bb.note("%s %s %s failed: %s" % (objdump, cmd, self.name, e)) return "" + def elf_machine_to_string(machine): """ Return the name of a given ELF e_machine field or the hex value as a string
@@ -173,6 +176,7 @@ def elf_machine_to_string(machine): except: return "Unknown (%s)" % repr(machine) + if __name__ == "__main__": import sys
meta/lib/oe/recipeutils.py +9 -1
@@ -232,6 +232,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True): lines.extend(addlines) existingnames = [] + def patch_recipe_varfunc(varname, origvalue, op, newlines): if modifying: # Insert anything that should come before this variable
@@ -334,11 +335,13 @@ def localise_file_vars(fn, varfiles, varlist): return filevars + def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None): """Modify a list of variable values in the specified recipe. Handles inc files if used by the recipe. """ overrides = d.getVar('OVERRIDES').split(':') + def override_applicable(hevent): op = hevent['op'] if '[' in op:
@@ -389,7 +392,6 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None return None - def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=False): """Copy (local) recipe files, including both files included via include/require, and files referred to in the SRC_URI variable."""
@@ -400,6 +402,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=F uri_values = [] localpaths = [] + def fetch_urls(rdata): # Collect the local paths from SRC_URI srcuri = rdata.getVar('SRC_URI') or ""
@@ -612,6 +615,7 @@ def get_bbfile_path(d, destdir, extrapathhint=None): return pathoption return None + def get_bbappend_path(d, destlayerdir, wildcardver=False): """Determine how a bbappend for a recipe should be named and located within another layer"""
@@ -942,6 +946,7 @@ def replace_dir_vars(path, d): path = path.replace(dirpath, '${%s}' % dirvars[dirpath]) return path + def get_recipe_pv_without_srcpv(pv, uri_type): """ Get PV without SRCPV common in SCM's for now only
@@ -969,6 +974,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type): return (pv, pfx, sfx) + def get_recipe_upstream_version(rd): """ Get upstream version of recipe using bb.fetch2 methods with support for
@@ -1048,6 +1054,7 @@ def get_recipe_upstream_version(rd): return ru + def _get_recipe_upgrade_status(data): uv = get_recipe_upstream_version(data)
@@ -1073,6 +1080,7 @@ def _get_recipe_upgrade_status(data): return (pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason) + def get_recipe_upgrade_status(recipes=None): pkgs_list = [] data_copy_list = []
meta/lib/oe/reproducible.py +6 -0
@@ -5,6 +5,7 @@ import os import subprocess import bb + def get_source_date_epoch_from_known_files(d, sourcedir): source_date_epoch = None newest_file = None
@@ -21,6 +22,7 @@ def get_source_date_epoch_from_known_files(d, sourcedir): bb.debug(1, "SOURCE_DATE_EPOCH taken from: %s" % newest_file) return source_date_epoch + def find_git_folder(d, sourcedir): # First guess: WORKDIR/git # This is the default git fetcher unpack path
@@ -46,6 +48,7 @@ def find_git_folder(d, sourcedir): bb.warn("Failed to find a git repository in WORKDIR: %s" % workdir) return None + def get_source_date_epoch_from_git(d, sourcedir): if not "git://" in d.getVar('SRC_URI') and not "gitsm://" in d.getVar('SRC_URI'): return None
@@ -65,6 +68,7 @@ def get_source_date_epoch_from_git(d, sourcedir): p = subprocess.run(['git', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'], check=True, stdout=subprocess.PIPE) return int(p.stdout.decode('utf-8')) + def get_source_date_epoch_from_youngest_file(d, sourcedir): if sourcedir == d.getVar('WORKDIR'): # These sources are almost certainly not from a tarball
@@ -90,6 +94,7 @@ def get_source_date_epoch_from_youngest_file(d, sourcedir): bb.debug(1, "Newest file found: %s" % newest_file) return source_date_epoch + def fixed_source_date_epoch(d): bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH") source_date_epoch = d.getVar('SOURCE_DATE_EPOCH_FALLBACK')
@@ -98,6 +103,7 @@ def fixed_source_date_epoch(d): return int(source_date_epoch) return 0 + def get_source_date_epoch(d, sourcedir): return ( get_source_date_epoch_from_git(d, sourcedir) or
meta/lib/oe/rootfs.py +5 -2
@@ -11,6 +11,7 @@ import os import subprocess import re + class Rootfs(object, metaclass=ABCMeta): """ This is an abstract class. Do not instantiate this directly.
@@ -94,7 +95,6 @@ class Rootfs(object, metaclass=ABCMeta): self.d.getVar('PACKAGE_FEED_BASE_PATHS') or "", self.d.getVar('PACKAGE_FEED_ARCHS')) - """ The _cleanup() method should be used to clean-up stuff that we don't really want to end up on target. For example, in the case of RPM, the DB locks.
@@ -248,7 +248,6 @@ class Rootfs(object, metaclass=ABCMeta): if self.progress_reporter: self.progress_reporter.next_stage() - def _uninstall_unneeded(self): # Remove the run-postinsts package if no delayed postinsts are found delayed_postinsts = self._get_delayed_postinsts()
@@ -337,6 +336,7 @@ class Rootfs(object, metaclass=ABCMeta): If neither are specified then the default name of files/device_table-minimal.txt is searched for in the BBPATH (same as the old version.) """ + def _create_devfs(self): devtable_list = [] devtable = self.d.getVar('IMAGE_DEVICE_TABLE')
@@ -359,11 +359,13 @@ def get_class_for_type(imgtype): mod = importlib.import_module('oe.package_manager.' + imgtype + '.rootfs') return mod.PkgRootfs + def variable_depends(d, manifest_dir=None): img_type = d.getVar('IMAGE_PKGTYPE') cls = get_class_for_type(img_type) return cls._depends_list() + def create_rootfs(d, manifest_dir=None, progress_reporter=None, logcatcher=None): env_bkp = os.environ.copy()
@@ -385,6 +387,7 @@ def image_list_installed_packages(d, rootfs_dir=None): cls = importlib.import_module('oe.package_manager.' + img_type) return cls.PMPkgsList(d, rootfs_dir).list_pkgs() + if __name__ == "__main__": """ We should be able to run this as a standalone script, from outside bitbake
meta/lib/oe/sdk.py +4 -0
@@ -9,6 +9,7 @@ from oe.package_manager import * import os import traceback + class Sdk(object, metaclass=ABCMeta): def __init__(self, d, manifest_dir): self.d = d
@@ -120,6 +121,7 @@ def sdk_list_installed_packages(d, target, rootfs_dir=None): cls = importlib.import_module('oe.package_manager.' + img_type) return cls.PMPkgsList(d, rootfs_dir).list_pkgs() + def populate_sdk(d, manifest_dir=None): env_bkp = os.environ.copy()
@@ -131,6 +133,7 @@ def populate_sdk(d, manifest_dir=None): os.environ.clear() os.environ.update(env_bkp) + def get_extra_sdkinfo(sstate_dir): """ This function is going to be used for generating the target and host manifest files packages of eSDK.
@@ -150,5 +153,6 @@ def get_extra_sdkinfo(sstate_dir): extra_info['filesizes'][fn] = fsize return extra_info + if __name__ == "__main__": pass
meta/lib/oe/sstatesig.py +18 -0
@@ -5,23 +5,30 @@ import bb.siggen import bb.runqueue import oe + def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches): # Return True if we should keep the dependency, False to drop it def isNative(x): return x.endswith("-native") + def isCross(x): return "-cross-" in x + def isNativeSDK(x): return x.startswith("nativesdk-") + def isKernel(mc, fn): inherits = " ".join(dataCaches[mc].inherits[fn]) return inherits.find("/module-base.bbclass") != -1 or inherits.find("/linux-kernel-base.bbclass") != -1 + def isPackageGroup(mc, fn): inherits = " ".join(dataCaches[mc].inherits[fn]) return "/packagegroup.bbclass" in inherits + def isAllArch(mc, fn): inherits = " ".join(dataCaches[mc].inherits[fn]) return "/allarch.bbclass" in inherits + def isImage(mc, fn): return "/image.bbclass" in " ".join(dataCaches[mc].inherits[fn])
@@ -71,6 +78,7 @@ def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches): # Default to keep dependencies return True + def sstate_lockedsigs(d): sigs = {} types = (d.getVar("SIGGEN_LOCKEDSIGS_TYPES") or "").split()
@@ -84,15 +92,19 @@ def sstate_lockedsigs(d): sigs[pn][task] = [h, siggen_lockedsigs_var] return sigs + class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic): name = "OEBasic" + def init_rundepcheck(self, data): self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split() self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split() pass + def rundep_check(self, fn, recipename, task, dep, depname, dataCaches=None): return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCaches) + class SignatureGeneratorOEBasicHashMixIn(object): supports_multiconfig_datacaches = True
@@ -301,9 +313,11 @@ class SignatureGeneratorOEBasicHashMixIn(object): if error_msgs: bb.fatal("\n".join(error_msgs)) + class SignatureGeneratorOEBasicHash(SignatureGeneratorOEBasicHashMixIn, bb.siggen.SignatureGeneratorBasicHash): name = "OEBasicHash" + class SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.siggen.SignatureGeneratorUniHashMixIn, bb.siggen.SignatureGeneratorBasicHash): name = "OEEquivHash"
@@ -316,6 +330,7 @@ class SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.sigge if not self.method: bb.fatal("OEEquivHash requires SSTATE_HASHEQUIV_METHOD to be set") + # Insert these classes into siggen's namespace so it can see and select them bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash
@@ -415,6 +430,7 @@ def find_siginfo(pn, taskname, taskhashlist, d): else: return filedates + bb.siggen.find_siginfo = find_siginfo
@@ -429,6 +445,7 @@ def sstate_get_manifest_filename(task, d): d2.setVar("SSTATE_MANMACH", extrainf) return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2) + def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache): d2 = d variant = ''
@@ -467,6 +484,7 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache): bb.fatal("Manifest %s not found in %s (variant '%s')?" % (manifest, d2.expand(" ".join(pkgarchs)), variant)) return None, d2 + def OEOuthashBasic(path, sigfile, task, d): """ Basic output hash function
meta/lib/oe/terminal.py +21 -0
@@ -13,6 +13,7 @@ logger = logging.getLogger('BitBake.OE.Terminal') class UnsupportedTerminal(Exception): pass + class NoSupportedTerminals(Exception): def __init__(self, terms): self.terms = terms
@@ -48,12 +49,14 @@ class Terminal(Popen, metaclass=Registry): else: return [element.format(**fmt) for element in self.command] + class XTerminal(Terminal): def __init__(self, sh_cmd, title=None, env=None, d=None): Terminal.__init__(self, sh_cmd, title, env, d) if not os.environ.get('DISPLAY'): raise UnsupportedTerminal(self.name) + class Gnome(XTerminal): command = 'gnome-terminal -t "{title}" -- {command}' priority = 2
@@ -68,18 +71,22 @@ class Gnome(XTerminal): XTerminal.__init__(self, sh_cmd, title, env, d) + class Mate(XTerminal): command = 'mate-terminal --disable-factory -t "{title}" -x {command}' priority = 2 + class Xfce(XTerminal): command = 'xfce4-terminal -T "{title}" -e "{command}"' priority = 2 + class Terminology(XTerminal): command = 'terminology -T="{title}" -e {command}' priority = 2 + class Konsole(XTerminal): command = 'konsole --separate --workdir . -p tabtitle="{title}" -e {command}' priority = 2
@@ -95,14 +102,17 @@ class Konsole(XTerminal): self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}' XTerminal.__init__(self, sh_cmd, title, env, d) + class XTerm(XTerminal): command = 'xterm -T "{title}" -e {command}' priority = 1 + class Rxvt(XTerminal): command = 'rxvt -T "{title}" -e {command}' priority = 1 + class Screen(Terminal): command = 'screen -D -m -t "{title}" -S devshell {command}'
@@ -118,6 +128,7 @@ class Screen(Terminal): else: logger.warning(msg) + class TmuxRunning(Terminal): """Open a new pane in the current running tmux window""" name = 'tmux-running'
@@ -136,6 +147,7 @@ class TmuxRunning(Terminal): Terminal.__init__(self, sh_cmd, title, env, d) + class TmuxNewWindow(Terminal): """Open a new window in the current running tmux session""" name = 'tmux-new-window'
@@ -151,6 +163,7 @@ class TmuxNewWindow(Terminal): Terminal.__init__(self, sh_cmd, title, env, d) + class Tmux(Terminal): """Start a new tmux session and window""" command = 'tmux new -c "{cwd}" -d -s devshell -n devshell "{command}"'
@@ -179,6 +192,7 @@ class Tmux(Terminal): else: logger.warning(msg) + class Custom(Terminal): command = 'false' # This is a placeholder priority = 3
@@ -198,6 +212,7 @@ class Custom(Terminal): def prioritized(): return Registry.prioritized() + def get_cmd_list(): terms = Registry.prioritized() cmds = []
@@ -206,6 +221,7 @@ def get_cmd_list(): cmds.append(term.command) return cmds + def spawn_preferred(sh_cmd, title=None, env=None, d=None): """Spawn the first supported terminal, by priority""" for terminal in prioritized():
@@ -220,6 +236,7 @@ def spawn_preferred(sh_cmd, title=None, env=None, d=None): else: raise NoSupportedTerminals(get_cmd_list()) + def spawn(name, sh_cmd, title=None, env=None, d=None): """Spawn the specified terminal, by name""" logger.debug('Attempting to spawn terminal "%s"', name)
@@ -259,12 +276,14 @@ def spawn(name, sh_cmd, title=None, env=None, d=None): except OSError: return + def check_tmux_version(desired): vernum = check_terminal_version("tmux") if vernum and LooseVersion(vernum) < desired: return False return vernum + def check_tmux_pane_size(tmux): import subprocess as sub # On older tmux versions (<1.9), return false. The reason
@@ -286,6 +305,7 @@ def check_tmux_pane_size(tmux): return size / 2 >= 19 + def check_terminal_version(terminalName): import subprocess as sub try:
@@ -317,6 +337,7 @@ def check_terminal_version(terminalName): vernum = ver.split()[-1][5:] return vernum + def distro_name(): try: p = Popen(['lsb_release', '-i'])
meta/lib/oe/types.py +13 -0
@@ -31,6 +31,7 @@ class OEList(list): def __str__(self): return self.separator.join(self) + def choice(value, choices): """OpenEmbedded 'choice' type
@@ -47,8 +48,10 @@ def choice(value, choices): (value, choices)) return value + class NoMatch(object): """Stub python regex pattern object which never matches anything""" + def findall(self, string, flags=0): return None
@@ -70,8 +73,10 @@ class NoMatch(object): def subn(pattern, repl, string, count=0): return None + NoMatch = NoMatch() + def regex(value, regexflags=None): """OpenEmbedded 'regex' type
@@ -103,6 +108,7 @@ def regex(value, regexflags=None): raise ValueError("Invalid regex value '%s': %s" % (value, exc.args[0])) + def boolean(value): """OpenEmbedded 'boolean' type
@@ -125,6 +131,7 @@ def boolean(value): return False raise ValueError("Invalid boolean value '%s'" % value) + def integer(value, numberbase=10): """OpenEmbedded 'integer' type
@@ -133,7 +140,10 @@ def integer(value, numberbase=10): return int(value, int(numberbase)) + _float = float + + def float(value, fromhex='false'): """OpenEmbedded floating point type
@@ -146,6 +156,7 @@ def float(value, fromhex='false'): else: return _float(value) + def path(value, relativeto='', normalize='true', mustexist='false'): value = os.path.join(relativeto, value)
@@ -162,6 +173,7 @@ def path(value, relativeto='', normalize='true', mustexist='false'): return value + def is_x86(arch): """ Check whether arch is x86 or x86_64
@@ -171,6 +183,7 @@ def is_x86(arch): else: return False + def qemu_use_kvm(kvm, target_arch): """ Enable kvm if target_arch == build_arch or both of them are x86 archs.
meta/lib/oe/useradd.py +5 -0
@@ -4,6 +4,7 @@ import argparse import re + class myArgumentParser(argparse.ArgumentParser): def _print_message(self, message, file=None): bb.warn("%s - %s: %s" % (d.getVar('PN'), pkg, message))
@@ -16,16 +17,19 @@ class myArgumentParser(argparse.ArgumentParser): def error(self, message): bb.fatal(message) + def split_commands(params): params = re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip()) # Remove any empty items return [x for x in params if x] + def split_args(params): params = re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip()) # Remove any empty items return [x for x in params if x] + def build_useradd_parser(): # The following comes from --help on useradd from shadow parser = myArgumentParser(prog='useradd')
@@ -55,6 +59,7 @@ def build_useradd_parser(): return parser + def build_groupadd_parser(): # The following comes from --help on groupadd from shadow parser = myArgumentParser(prog='groupadd')
meta/lib/oe/utils.py +35 -0
@@ -6,6 +6,7 @@ import subprocess import multiprocessing import traceback + def read_file(filename): try: f = open(filename, "r")
@@ -17,18 +18,21 @@ def read_file(filename): return data return None + def ifelse(condition, iftrue=True, iffalse=False): if condition: return iftrue else: return iffalse + def conditional(variable, checkvalue, truevalue, falsevalue, d): if d.getVar(variable) == checkvalue: return truevalue else: return falsevalue + def vartrue(var, iftrue, iffalse, d): import oe.types if oe.types.boolean(d.getVar(var)):
@@ -36,12 +40,14 @@ def vartrue(var, iftrue, iffalse, d): else: return iffalse + def less_or_equal(variable, checkvalue, truevalue, falsevalue, d): if float(d.getVar(variable)) <= float(checkvalue): return truevalue else: return falsevalue + def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): result = bb.utils.vercmp_string(d.getVar(variable), checkvalue) if result <= 0:
@@ -49,6 +55,7 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): else: return falsevalue + def both_contain(variable1, variable2, checkvalue, d): val1 = d.getVar(variable1) val2 = d.getVar(variable2)
@@ -63,6 +70,7 @@ def both_contain(variable1, variable2, checkvalue, d): else: return "" + def set_intersect(variable1, variable2, d): """ Expand both variables, interpret them as lists of strings, and return the
@@ -78,6 +86,7 @@ def set_intersect(variable1, variable2, d): val2 = set(d.getVar(variable2).split()) return " ".join(val1 & val2) + def prune_suffix(var, suffixes, d): # See if var ends with any of the suffixes listed and # remove it if found
@@ -91,22 +100,27 @@ def prune_suffix(var, suffixes, d): return var + def str_filter(f, str, d): from re import match return " ".join([x for x in str.split() if match(f, x, 0)]) + def str_filter_out(f, str, d): from re import match return " ".join([x for x in str.split() if not match(f, x, 0)]) + def build_depends_string(depends, task): """Append a taskname to a string of dependencies as used by the [depends] flag""" return " ".join(dep + ":" + task for dep in depends.split()) + def inherits(d, *classes): """Return True if the metadata inherits any of the specified classes""" return any(bb.data.inherits_class(cls, d) for cls in classes) + def features_backfill(var, d): # This construct allows the addition of new features to variable specified # as var
@@ -128,6 +142,7 @@ def features_backfill(var, d): if addfeatures: d.appendVar(var, " " + " ".join(addfeatures)) + def all_distro_features(d, features, truevalue="1", falsevalue=""): """ Returns truevalue if *all* given features are set in DISTRO_FEATURES,
@@ -148,6 +163,7 @@ def all_distro_features(d, features, truevalue="1", falsevalue=""): """ return bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, d) + def any_distro_features(d, features, truevalue="1", falsevalue=""): """ Returns truevalue if at least *one* of the given features is set in DISTRO_FEATURES,
@@ -169,6 +185,7 @@ def any_distro_features(d, features, truevalue="1", falsevalue=""): """ return bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d) + def parallel_make(d, makeinst=False): """ Return the integer value for the number of parallel threads to use when
@@ -195,6 +212,7 @@ def parallel_make(d, makeinst=False): return '' + def parallel_make_argument(d, fmt, limit=None, makeinst=False): """ Helper utility to construct a parallel make argument from the number of
@@ -215,6 +233,7 @@ def parallel_make_argument(d, fmt, limit=None, makeinst=False): return fmt % v return '' + def packages_filter_out_system(d): """ Return a list of packages from PACKAGES with the "system" packages such as
@@ -230,6 +249,7 @@ def packages_filter_out_system(d): pkgs.append(pkg) return pkgs + def getstatusoutput(cmd): return subprocess.getstatusoutput(cmd)
@@ -248,10 +268,12 @@ def trim_version(version, num_parts=2): trimmed = ".".join(parts[:num_parts]) return trimmed + def cpu_count(at_least=1): cpus = len(os.sched_getaffinity(0)) return max(cpus, at_least) + def execute_pre_post_process(d, cmds): if cmds is None: return
@@ -265,6 +287,8 @@ def execute_pre_post_process(d, cmds): # For each item in items, call the function 'target' with item as the first # argument, extraargs as the other arguments and handle any exceptions in the # parent thread + + def multiprocess_launch(target, items, d, extraargs=None): class ProcessLaunch(multiprocessing.Process):
@@ -340,10 +364,12 @@ def multiprocess_launch(target, items, d, extraargs=None): bb.fatal("Fatal errors occurred in subprocesses:\n%s" % msg) return results + def squashspaces(string): import re return re.sub(r"\s+", " ", string).strip() + def format_pkg_list(pkg_dict, ret_format=None): output = []
@@ -452,11 +478,14 @@ def get_multilib_datastore(variant, d): # so implement a version here # + from queue import Queue from threading import Thread + class ThreadedWorker(Thread): """Thread executing tasks from a given tasks queue""" + def __init__(self, tasks, worker_init, worker_end): Thread.__init__(self) self.tasks = tasks
@@ -486,8 +515,10 @@ class ThreadedWorker(Thread): finally: self.tasks.task_done() + class ThreadedPool: """Pool of threads consuming tasks from a queue""" + def __init__(self, num_workers, num_tasks, worker_init=None, worker_end=None): self.tasks = Queue(num_tasks)
@@ -511,6 +542,7 @@ class ThreadedPool: for worker in self.workers: worker.join() + def write_ld_so_conf(d): # Some utils like prelink may not have the correct target library paths # so write an ld.so.conf to help them
@@ -522,6 +554,7 @@ def write_ld_so_conf(d): f.write(d.getVar("base_libdir") + '\n') f.write(d.getVar("libdir") + '\n') + class ImageQAFailed(Exception): def __init__(self, description, name=None, logfile=None): self.description = description
@@ -535,10 +568,12 @@ class ImageQAFailed(Exception): return msg + def sh_quote(string): import shlex return shlex.quote(string) + def directory_size(root, blocksize=4096): """ Calculate the size of the directory, taking into account hard links,
meta/lib/oeqa/buildperf/base.py +0 -2
@@ -142,7 +142,6 @@ class BuildPerfTestResult(unittest.TextTestResult): [('SKIPPED', t, m) for t, m in self.skipped] return sorted(compound, key=lambda info: info[1].start_time) - def write_buildstats_json(self): """Write buildstats file""" buildstats = OrderedDict()
@@ -152,7 +151,6 @@ class BuildPerfTestResult(unittest.TextTestResult): with open(os.path.join(self.out_dir, 'buildstats.json'), 'w') as fobj: json.dump(buildstats, fobj, cls=ResultsJsonEncoder) - def write_results_json(self): """Write test results into a json-formatted file""" results = OrderedDict([('tester_host', self.hostname),
meta/lib/oeqa/buildperf/test_basic.py +1 -0
@@ -10,6 +10,7 @@ import oe.path from oeqa.buildperf import BuildPerfTestCase from oeqa.utils.commands import get_bb_var, get_bb_vars + class Test1P1(BuildPerfTestCase): build_target = 'core-image-sato'
meta/lib/oeqa/controllers/masterimage.py +1 -0
@@ -24,6 +24,7 @@ from oeqa.utils import CommandError from abc import ABCMeta, abstractmethod + class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta): supported_image_fstypes = ['tar.gz', 'tar.bz2']
meta/lib/oeqa/controllers/testtargetloader.py +2 -0
@@ -7,6 +7,8 @@ import bb import os # This class is responsible for loading a test target controller + + class TestTargetLoader: # Search oeqa.controllers module directory for and return a controller
meta/lib/oeqa/core/case.py +3 -0
@@ -10,6 +10,7 @@ import unittest from oeqa.core.exception import OEQAMissingVariable + def _validate_td_vars(td, td_vars, type_msg): if td_vars: for v in td_vars:
@@ -17,6 +18,7 @@ def _validate_td_vars(td, td_vars, type_msg): raise OEQAMissingVariable("Test %s need %s variable but" " isn't into td" % (type_msg, v)) + class OETestCase(unittest.TestCase): # TestContext and Logger instance set by OETestLoader. tc = None
@@ -57,6 +59,7 @@ class OETestCase(unittest.TestCase): d.tearDownDecorator() self.tearDownMethod() + class OEPTestResultTestCase: """ Mix-in class to provide functions to make interacting with extraresults for
meta/lib/oeqa/core/cases/example/test_basic.py +2 -0
@@ -6,6 +6,7 @@ from oeqa.core.case import OETestCase from oeqa.core.decorator.depends import OETestDepends + class OETestExample(OETestCase): def test_example(self): self.logger.info('IMAGE: %s' % self.td.get('IMAGE'))
@@ -13,6 +14,7 @@ class OETestExample(OETestCase): self.logger.info('ARCH: %s' % self.td.get('ARCH')) self.assertEqual('x86', self.td.get('ARCH')) + class OETestExampleDepend(OETestCase): @OETestDepends(['OETestExample.test_example']) def test_example_depends(self):
meta/lib/oeqa/core/context.py +4 -0
@@ -15,6 +15,7 @@ from oeqa.core.loader import OETestLoader from oeqa.core.runner import OETestRunner from oeqa.core.exception import OEQAMissingManifest, OEQATestNotFound + class OETestContext(object): loaderClass = OETestLoader runnerClass = OETestRunner
@@ -49,6 +50,7 @@ class OETestContext(object): def skipTests(self, skips): if not skips: return + def skipfuncgen(skipmsg): def func(): raise unittest.SkipTest(skipmsg)
@@ -97,6 +99,7 @@ class OETestContext(object): self.runner = self.runnerClass(self, verbosity=2) return self.runner.list_tests(self.suites, display_type) + class OETestContextExecutor(object): _context_class = OETestContext _script_executor = 'oe-test'
@@ -243,4 +246,5 @@ class OETestContextExecutor(object): return rc + _executor_class = OETestContextExecutor
meta/lib/oeqa/core/decorator/__init__.py +5 -0
@@ -10,10 +10,12 @@ from oeqa.core.utils.misc import strToList decoratorClasses = set() + def registerDecorator(cls): decoratorClasses.add(cls) return cls + class OETestDecorator(object, metaclass=ABCMeta): case = None # Reference of OETestCase decorated attrs = None # Attributes to be loaded by decorator implementation
@@ -56,6 +58,7 @@ class OETestDecorator(object, metaclass=ABCMeta): def tearDownDecorator(self): pass + class OETestDiscover(OETestDecorator): # OETestLoader call it after discover test cases
@@ -64,10 +67,12 @@ class OETestDiscover(OETestDecorator): def discover(registry): return registry['cases'] + def OETestTag(*tags): expandedtags = [] for tag in tags: expandedtags += strToList(tag) + def decorator(item): if hasattr(item, "__oeqa_testtags"): # do not append, create a new list (to handle classes with inheritance)
meta/lib/oeqa/core/decorator/data.py +16 -0
@@ -8,6 +8,7 @@ from oeqa.core.exception import OEQAMissingVariable from . import OETestDecorator, registerDecorator + def has_feature(td, feature): """ Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
@@ -18,6 +19,7 @@ def has_feature(td, feature): return True return False + def has_machine(td, machine): """ Checks for MACHINE.
@@ -27,6 +29,7 @@ def has_machine(td, machine): return True return False + def is_qemu(td, qemu): """ Checks if MACHINE is qemu.
@@ -38,6 +41,7 @@ def is_qemu(td, qemu): return True return False + @registerDecorator class skipIfDataVar(OETestDecorator): """
@@ -57,6 +61,7 @@ class skipIfDataVar(OETestDecorator): if self.case.td.get(self.var) == self.value: self.case.skipTest(self.msg) + @registerDecorator class skipIfNotDataVar(OETestDecorator): """
@@ -76,6 +81,7 @@ class skipIfNotDataVar(OETestDecorator): if not self.case.td.get(self.var) == self.value: self.case.skipTest(self.msg) + @registerDecorator class skipIfInDataVar(OETestDecorator): """
@@ -83,6 +89,7 @@ class skipIfInDataVar(OETestDecorator): """ attrs = ('var', 'value', 'msg') + def setUpDecorator(self): msg = ('Checking if %r value contains %r to skip ' 'the test' % (self.var, self.value))
@@ -90,6 +97,7 @@ class skipIfInDataVar(OETestDecorator): if self.value in (self.case.td.get(self.var)): self.case.skipTest(self.msg) + @registerDecorator class skipIfNotInDataVar(OETestDecorator): """
@@ -97,6 +105,7 @@ class skipIfNotInDataVar(OETestDecorator): """ attrs = ('var', 'value', 'msg') + def setUpDecorator(self): msg = ('Checking if %r value contains %r to run ' 'the test' % (self.var, self.value))
@@ -104,6 +113,7 @@ class skipIfNotInDataVar(OETestDecorator): if not self.value in (self.case.td.get(self.var) or ""): self.case.skipTest(self.msg) + @registerDecorator class OETestDataDepends(OETestDecorator): attrs = ('td_depends',)
@@ -116,6 +126,7 @@ class OETestDataDepends(OETestDecorator): raise OEQAMissingVariable("Test case need %s variable but" " isn't into td" % v) + @registerDecorator class skipIfNotFeature(OETestDecorator): """
@@ -134,6 +145,7 @@ class skipIfNotFeature(OETestDecorator): if not has_feature(self.case.td, self.value): self.case.skipTest(self.msg) + @registerDecorator class skipIfFeature(OETestDecorator): """
@@ -152,6 +164,7 @@ class skipIfFeature(OETestDecorator): if has_feature(self.case.td, self.value): self.case.skipTest(self.msg) + @registerDecorator class skipIfNotMachine(OETestDecorator): """
@@ -169,6 +182,7 @@ class skipIfNotMachine(OETestDecorator): if not has_machine(self.case.td, self.value): self.case.skipTest(self.msg) + @registerDecorator class skipIfMachine(OETestDecorator): """
@@ -186,6 +200,7 @@ class skipIfMachine(OETestDecorator): if has_machine(self.case.td, self.value): self.case.skipTest(self.msg) + @registerDecorator class skipIfNotQemu(OETestDecorator): """
@@ -203,6 +218,7 @@ class skipIfNotQemu(OETestDecorator): if not is_qemu(self.case.td, self.value): self.case.skipTest(self.msg) + @registerDecorator class skipIfQemu(OETestDecorator): """
meta/lib/oeqa/core/decorator/depends.py +5 -0
@@ -10,6 +10,7 @@ from oeqa.core.exception import OEQADependency from . import OETestDiscover, registerDecorator + def _add_depends(registry, case, depends): module_name = case.__module__ class_name = case.__class__.__name__
@@ -31,6 +32,7 @@ def _add_depends(registry, case, depends): if not depend_id in registry[case_id]: registry[case_id].append(depend_id) + def _validate_test_case_depends(cases, depends): for case in depends: if not case in cases:
@@ -40,6 +42,7 @@ def _validate_test_case_depends(cases, depends): raise OEQADependency("TestCase %s depends on %s and isn't available" ", cases available %s." % (case, dep, str(cases.keys()))) + def _order_test_case_by_depends(cases, depends): def _dep_resolve(graph, node, resolved, seen): seen.append(node)
@@ -65,6 +68,7 @@ def _order_test_case_by_depends(cases, depends): return [cases[case_id] for case_id in cases_ordered] + def _skipTestDependency(case, depends): for dep in depends: found = False
@@ -76,6 +80,7 @@ def _skipTestDependency(case, depends): raise SkipTest("Test case %s depends on %s but it didn't pass/run." % (case.id(), dep)) + @registerDecorator class OETestDepends(OETestDiscover): attrs = ('depends',)
meta/lib/oeqa/core/decorator/oetimeout.py +2 -0
@@ -8,12 +8,14 @@ import signal from . import OETestDecorator, registerDecorator from oeqa.core.exception import OEQATimeoutError + @registerDecorator class OETimeout(OETestDecorator): attrs = ('oetimeout',) def setUpDecorator(self): timeout = self.oetimeout + def _timeoutHandler(signum, frame): raise OEQATimeoutError("Timed out after %s " "seconds of execution" % timeout)
meta/lib/oeqa/core/exception.py +7 -0
@@ -4,23 +4,30 @@ # SPDX-License-Identifier: MIT # + class OEQAException(Exception): pass + class OEQATimeoutError(OEQAException): pass + class OEQAMissingVariable(OEQAException): pass + class OEQADependency(OEQAException): pass + class OEQAMissingManifest(OEQAException): pass + class OEQAPreRun(OEQAException): pass + class OEQATestNotFound(OEQAException): pass
meta/lib/oeqa/core/loader.py +3 -1
@@ -31,12 +31,14 @@ _failed_test_args = inspect.getfullargspec(unittest.loader._make_failed_test).ar exec("""def _make_failed_test(%s): raise exception""" % ', '.join(_failed_test_args)) unittest.loader._make_failed_test = _make_failed_test + def _find_duplicated_modules(suite, directory): for module in getSuiteModules(suite): path = findFile('%s.py' % module, directory) if path: raise ImportError("Duplicated %s module found in %s" % (module, path)) + def _built_modules_dict(modules): modules_dict = {}
@@ -61,6 +63,7 @@ def _built_modules_dict(modules): return modules_dict + class OETestLoader(unittest.TestLoader): caseClass = OETestCase
@@ -313,7 +316,6 @@ class OETestLoader(unittest.TestLoader): return (load_module, load_underscore) - # XXX After Python 3.5, remove backward compatibility hacks for # use_load_tests deprecation via *args and **kws. See issue 16662. if sys.version_info >= (3, 5):
meta/lib/oeqa/core/runner.py +7 -0
@@ -15,6 +15,7 @@ import sys from unittest import TextTestResult as _TestResult from unittest import TextTestRunner as _TestRunner + class OEStreamLogger(object): def __init__(self, logger): self.logger = logger
@@ -35,6 +36,7 @@ class OEStreamLogger(object): for handler in self.logger.handlers: handler.flush() + class OETestResult(_TestResult): def __init__(self, tc, *args, **kwargs): super(OETestResult, self).__init__(*args, **kwargs)
@@ -229,10 +231,12 @@ class OETestResult(_TestResult): # Override as we unexpected successes aren't failures for us return (len(self.failures) == len(self.errors) == 0) + class OEListTestsResult(object): def wasSuccessful(self): return True + class OETestRunner(_TestRunner): streamLoggerClass = OEStreamLogger
@@ -279,6 +283,7 @@ class OETestRunner(_TestRunner): self._walked_cases = 0 curr = {} + def _list_classes(logger, case): if not 'module' in curr or curr['module'] != case.__module__: curr['module'] = case.__module__
@@ -298,6 +303,7 @@ class OETestRunner(_TestRunner): self._walked_cases = 0 listed = [] + def _list_modules(logger, case): if not case.__module__ in listed: if case.__module__.startswith('_'):
@@ -319,6 +325,7 @@ class OETestRunner(_TestRunner): return OEListTestsResult() + class OETestResultJSONHelper(object): testresult_filename = 'testresults.json'
meta/lib/oeqa/core/target/__init__.py +1 -0
@@ -6,6 +6,7 @@ from abc import abstractmethod + class OETarget(object): def __init__(self, logger, *args, **kwargs):
meta/lib/oeqa/core/target/qemu.py +1 -0
@@ -19,6 +19,7 @@ from oeqa.utils.dump import TargetDumper supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic'] + class OEQemuTarget(OESSHTarget): def __init__(self, logger, server_ip, timeout=300, user='root', port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False,
meta/lib/oeqa/core/target/ssh.py +2 -2
@@ -13,6 +13,7 @@ import codecs from . import OETarget + class OESSHTarget(OETarget): def __init__(self, logger, ip, server_ip, timeout=300, user='root', port=None, server_port=0, **kwargs):
@@ -169,7 +170,6 @@ class OESSHTarget(OETarget): self.run(cmd) - def deleteDir(self, remotePath): """ Deletes target's remotePath directory.
@@ -178,7 +178,6 @@ class OESSHTarget(OETarget): cmd = "rmdir %s" % remotePath self.run(cmd) - def deleteDirStructure(self, localPath, remotePath): """ Delete recursively localPath structure directory in target's remotePath.
@@ -217,6 +216,7 @@ class OESSHTarget(OETarget): remoteDir = os.path.join(remotePath, tmpDir.lstrip("/")) self.deleteDir(remoteDir) + def SSHCall(command, logger, timeout=None, **opts): def run():
meta/lib/oeqa/core/tests/cases/data.py +1 -0
@@ -8,6 +8,7 @@ from oeqa.core.case import OETestCase from oeqa.core.decorator import OETestTag from oeqa.core.decorator.data import OETestDataDepends + class DataTest(OETestCase): data_vars = ['IMAGE', 'ARCH']
meta/lib/oeqa/core/tests/cases/depends.py +1 -0
@@ -7,6 +7,7 @@ from oeqa.core.case import OETestCase from oeqa.core.decorator.depends import OETestDepends + class DependsTest(OETestCase): def testDependsFirst(self):
meta/lib/oeqa/core/tests/cases/loader/valid/another.py +1 -0
@@ -6,6 +6,7 @@ from oeqa.core.case import OETestCase + class AnotherTest(OETestCase): def testAnother(self):
meta/lib/oeqa/core/tests/cases/oetag.py +2 -0
@@ -7,6 +7,7 @@ from oeqa.core.case import OETestCase from oeqa.core.decorator import OETestTag + class TagTest(OETestCase): @OETestTag('goodTag') def testTagGood(self):
@@ -23,6 +24,7 @@ class TagTest(OETestCase): def testTagNone(self): self.assertTrue(True, msg='How is this possible?') + @OETestTag('classTag') class TagClassTest(OETestCase): @OETestTag('otherTag')
meta/lib/oeqa/core/tests/cases/timeout.py +1 -1
@@ -10,6 +10,7 @@ from oeqa.core.case import OETestCase from oeqa.core.decorator.oetimeout import OETimeout from oeqa.core.decorator.depends import OETestDepends + class TimeoutTest(OETestCase): @OETimeout(1)
@@ -21,7 +22,6 @@ class TimeoutTest(OETestCase): sleep(2) self.assertTrue(True, msg='How is this possible?') - def testTimeoutSkip(self): self.skipTest("This test needs to be skipped, so that testTimeoutDepends()'s OETestDepends kicks in")
meta/lib/oeqa/core/tests/common.py +2 -0
@@ -18,12 +18,14 @@ formatter = logging.Formatter('OEQATest: %(message)s') consoleHandler.setFormatter(formatter) logger.addHandler(consoleHandler) + def setup_sys_path(): directory = os.path.dirname(os.path.abspath(__file__)) oeqa_lib = os.path.realpath(os.path.join(directory, '../../../')) if not oeqa_lib in sys.path: sys.path.insert(0, oeqa_lib) + class TestBase(unittest.TestCase): def setUp(self): self.logger = logger
meta/lib/oeqa/core/tests/test_data.py +2 -0
@@ -15,6 +15,7 @@ setup_sys_path() from oeqa.core.exception import OEQAMissingVariable from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames + class TestData(TestBase): modules = ['data']
@@ -51,5 +52,6 @@ class TestData(TestBase): tc = self._testLoader(d=d, modules=self.modules) self.assertEqual(True, tc.runTests().wasSuccessful()) + if __name__ == '__main__': unittest.main()
meta/lib/oeqa/core/tests/test_decorators.py +4 -0
@@ -14,6 +14,7 @@ setup_sys_path() from oeqa.core.exception import OEQADependency from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames, getSuiteCasesIDs + class TestTagDecorator(TestBase): def _runTest(self, modules, filterfn, expect): tc = self._testLoader(modules=modules, tags_filter=filterfn)
@@ -67,6 +68,7 @@ class TestTagDecorator(TestBase): 'oetag.TagClassTest.testTagNone', }) + class TestDependsDecorator(TestBase): modules = ['depends']
@@ -112,6 +114,7 @@ class TestDependsDecorator(TestBase): msg = 'Expected OEQADependency exception having a circular dependency' self.assertTrue(result, msg=msg) + class TestTimeoutDecorator(TestBase): modules = ['timeout']
@@ -139,5 +142,6 @@ class TestTimeoutDecorator(TestBase): tc = self._testLoader(modules=self.modules, tests=tests) self.assertTrue(tc.runTests().wasSuccessful(), msg=msg) + if __name__ == '__main__': unittest.main()
meta/lib/oeqa/core/tests/test_loader.py +2 -0
@@ -14,6 +14,7 @@ setup_sys_path() from oeqa.core.exception import OEQADependency from oeqa.core.utils.test import getSuiteModules, getSuiteCasesIDs + class TestLoader(TestBase): @unittest.skip("invalid directory is missing oetag.py") def test_fail_duplicated_module(self):
@@ -59,5 +60,6 @@ class TestLoader(TestBase): msg = 'Expected modules from two different paths' self.assertEqual(modules, expected_modules, msg=msg) + if __name__ == '__main__': unittest.main()
meta/lib/oeqa/core/tests/test_runner.py +2 -0
@@ -14,6 +14,7 @@ setup_sys_path() from oeqa.core.runner import OEStreamLogger + class TestRunner(TestBase): def test_stream_logger(self): fp = tempfile.TemporaryFile(mode='w+')
@@ -36,5 +37,6 @@ class TestRunner(TestBase): fp.close() + if __name__ == '__main__': unittest.main()
meta/lib/oeqa/core/utils/concurrencytest.py +18 -0
@@ -46,6 +46,8 @@ _all__ = [ # Patch the version from testtools to allow access to _test_start and allow # computation of timing information and threading progress # + + class BBThreadsafeForwardingResult(ThreadsafeForwardingResult): def __init__(self, target, semaphore, threadnum, totalinprocess, totaltests, output, finalresult):
@@ -79,6 +81,7 @@ class BBThreadsafeForwardingResult(ThreadsafeForwardingResult): self.finalresult._stdout_buffer = io.StringIO() super(BBThreadsafeForwardingResult, self)._add_result_with_semaphore(method, test, *args, **kwargs) + class ProxyTestResult: # a very basic TestResult proxy, in order to modify add* calls def __init__(self, target):
@@ -111,6 +114,7 @@ class ProxyTestResult: def __getattr__(self, attr): return getattr(self.result, attr) + class ExtraResultsDecoderTestResult(ProxyTestResult): def _addResult(self, method, test, *args, exception=False, **kwargs): if "details" in kwargs and "extraresults" in kwargs["details"]:
@@ -125,6 +129,7 @@ class ExtraResultsDecoderTestResult(ProxyTestResult): kwargs["details"]["extraresults"] = extraresults return method(test, *args, **kwargs) + class ExtraResultsEncoderTestResult(ProxyTestResult): def _addResult(self, method, test, *args, exception=False, **kwargs): if hasattr(test, "extraresults"):
@@ -147,6 +152,8 @@ class ExtraResultsEncoderTestResult(ProxyTestResult): # outside of a running test case. This can happen if classSetUp() fails # for a class of tests. This unfortunately has horrible internal knowledge. # + + def outSideTestaddError(self, offset, line): """An 'error:' directive has been read.""" test_name = line[offset:-1].decode('utf8')
@@ -156,12 +163,15 @@ def outSideTestaddError(self, offset, line): self.parser._reading_error_details.set_simple() self.parser.subunitLineReceived(line) + subunit._OutSideTest.addError = outSideTestaddError # Like outSideTestaddError above, we need an equivalent for skips # happening at the setUpClass() level, otherwise we will see "UNKNOWN" # as a result for concurrent tests # + + def outSideTestaddSkip(self, offset, line): """A 'skip:' directive has been read.""" test_name = line[offset:-1].decode('utf8')
@@ -171,6 +181,7 @@ def outSideTestaddSkip(self, offset, line): self.parser._reading_skip_details.set_simple() self.parser.subunitLineReceived(line) + subunit._OutSideTest.addSkip = outSideTestaddSkip #
@@ -178,15 +189,20 @@ subunit._OutSideTest.addSkip = outSideTestaddSkip # is available and accepts writes. This allows unittest with buffer=True # to interact ok with subunit which wants to access sys.stdout.buffer. # + + class dummybuf(object): def __init__(self, parent): self.p = parent + def write(self, data): self.p.write(data.decode("utf-8")) # # Taken from testtools.ConncurrencyTestSuite but modified for OE use # + + class ConcurrentTestSuite(unittest.TestSuite): def __init__(self, suite, processes, setupfunc, removefunc):
@@ -236,6 +252,7 @@ class ConcurrentTestSuite(unittest.TestSuite): finally: queue.put(testserver) + def fork_for_tests(concurrency_num, suite): testservers = [] if 'BUILDDIR' in os.environ:
@@ -311,6 +328,7 @@ def fork_for_tests(concurrency_num, suite): testservers.append((testserver, numtests, output)) return testservers, totaltests + def partition_tests(suite, count): # Keep tests from the same class together but allow tests from modules # to go to different processes to aid parallelisation.
meta/lib/oeqa/core/utils/misc.py +7 -0
@@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # + def toList(obj, obj_type, obj_name="Object"): if isinstance(obj, obj_type): return [obj]
@@ -12,6 +13,7 @@ def toList(obj, obj_type, obj_name="Object"): else: raise TypeError("%s must be %s or list" % (obj_name, obj_type)) + def toSet(obj, obj_type, obj_name="Object"): if isinstance(obj, obj_type): return {obj}
@@ -22,15 +24,19 @@ def toSet(obj, obj_type, obj_name="Object"): else: raise TypeError("%s must be %s or set" % (obj_name, obj_type)) + def strToList(obj, obj_name="Object"): return toList(obj, str, obj_name) + def strToSet(obj, obj_name="Object"): return toSet(obj, str, obj_name) + def intToList(obj, obj_name="Object"): return toList(obj, int, obj_name) + def dataStoteToDict(d, variables): data = {}
@@ -39,6 +45,7 @@ def dataStoteToDict(d, variables): return data + def updateTestData(d, td, variables): """ Updates variables with values of data store to test data.
meta/lib/oeqa/core/utils/path.py +2 -0
@@ -7,6 +7,7 @@ import os import sys + def findFile(file_name, directory): """ Search for a file in directory and returns its complete path.
@@ -16,6 +17,7 @@ def findFile(file_name, directory): return os.path.join(r, file_name) return None + def remove_safe(path): if os.path.exists(path): os.remove(path)
meta/lib/oeqa/core/utils/test.py +11 -0
@@ -8,6 +8,7 @@ import os import inspect import unittest + def getSuiteCases(suite): """ Returns individual test from a test suite.
@@ -22,6 +23,7 @@ def getSuiteCases(suite): return tests + def getSuiteModules(suite): """ Returns modules in a test suite.
@@ -31,6 +33,7 @@ def getSuiteModules(suite): modules.add(getCaseModule(test)) return modules + def getSuiteCasesInfo(suite, func): """ Returns test case info from suite. Info is fetched from func.
@@ -40,48 +43,56 @@ def getSuiteCasesInfo(suite, func): tests.append(func(test)) return tests + def getSuiteCasesNames(suite): """ Returns test case names from suite. """ return getSuiteCasesInfo(suite, getCaseMethod) + def getSuiteCasesIDs(suite): """ Returns test case ids from suite. """ return getSuiteCasesInfo(suite, getCaseID) + def getSuiteCasesFiles(suite): """ Returns test case files paths from suite. """ return getSuiteCasesInfo(suite, getCaseFile) + def getCaseModule(test_case): """ Returns test case module name. """ return test_case.__module__ + def getCaseClass(test_case): """ Returns test case class name. """ return test_case.__class__.__name__ + def getCaseID(test_case): """ Returns test case complete id. """ return test_case.id() + def getCaseFile(test_case): """ Returns test case file path. """ return inspect.getsourcefile(test_case.__class__) + def getCaseMethod(test_case): """ Returns test case method name.
meta/lib/oeqa/oetest.py +16 -0
@@ -34,6 +34,7 @@ from oeqa.utils.decorators import LogResults, gettag, getResults logger = logging.getLogger("BitBake") + def getVar(obj):
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/_qemutiny.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/buildcpio.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/buildgalculator.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/buildlzip.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/gstreamer.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/kernelmodule.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/logrotate.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/ltp_compliance.py +2 -1
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/ltp_stress.py +2 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/multilib.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/oe_syslog.py +2 -3
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/parselogs.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/runlevel.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/skeletoninit.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/cases/terminal.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/decorator/package.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/runtime/utils/targetbuildproject.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/sdk/cases/buildgalculator.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/sdk/utils/sdkbuildproject.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/archiver.py +1 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/bblayers.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/bbtests.py +1 -1
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/binutils.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/buildoptions.py +6 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/containerimage.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/cve_check.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/devtool.py +13 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/distrodata.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/efibootpartition.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/fitimage.py +1 -4
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/image_typedep.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/imagefeatures.py +1 -1
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/incompatible_lic.py +3 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/kerneldevelopment.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/layerappend.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/lic_checksum.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/manifest.py +3 -1
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/meta_ide.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/multiconfig.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/elf.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/license.py +5 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/path.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/types.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oelib/utils.py +2 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/oescripts.py +6 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/package.py +3 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/pkgdata.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/prservice.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/recipetool.py +1 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/recipeutils.py +0 -3
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/reproducible.py +8 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/resulttooltests.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/runqemu.py +1 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/runtime_test.py +3 -4
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/selftest.py +3 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/signing.py +0 -2
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/sstatetests.py +4 -6
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/sysroot.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/selftest/cases/tinfoil.py +1 -0
Lines of this file are not shown. View the raw message.
meta/lib/oeqa/utils/package_manager.py +11 -0
Lines of this file are not shown. View the raw message.
meta/recipes-core/systemd/systemd-systemctl/systemctl +2 -0
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/meson/meson/meson-setup.py +3 -0
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/python/python3/create_manifest3.py +4 -7
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/python/python3/get_module_deps3.py +1 -1
Lines of this file are not shown. View the raw message.
meta/recipes-rt/rt-tests/files/rt_bmark.py +16 -0
Lines of this file are not shown. View the raw message.
scripts/contrib/list-packageconfig-flags.py +8 -0
Lines of this file are not shown. View the raw message.
scripts/contrib/oe-build-perf-report-email.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/recipetool/create_buildsys.py +6 -1
Lines of this file are not shown. View the raw message.
scripts/lib/recipetool/create_kernel.py +3 -0
Lines of this file are not shown. View the raw message.
scripts/lib/resulttool/manualexecution.py +4 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/imager/direct.py +3 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/bootimg-biosplusefi.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/bootimg-efi.py +1 -1
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/bootimg-partition.py +1 -2
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/bootimg-pcbios.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/empty.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/rawcopy.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/lib/wic/plugins/source/rootfs.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/batch.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/draw.py +27 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/gui.py +3 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/main.py.in +6 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/parsing.py +24 -4
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/process_tree.py +1 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/samples.py +10 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +4 -0
Lines of this file are not shown. View the raw message.
scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py +2 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.17.1
Part of the diff is not shown here. View the raw message.
PATCH 8/8 PEP8 double aggressive W291 ~ W293 and W391
In reply to Armin KusterFrom: persianpros <[email protected]>
--- contrib/git-hooks/sendemail-validate.sample | 1 - meta/lib/bblayers/create.py | 1 - meta/lib/oe/cachedpath.py | 4 ++-- meta/lib/oe/elf.py | 8 ++++---- meta/lib/oe/license.py | 2 +- meta/lib/oe/package.py | 2 +- meta/lib/oe/patch.py | 3 +-- meta/lib/oe/path.py | 4 ++-- meta/lib/oe/recipeutils.py | 2 +- meta/lib/oe/reproducible.py | 1 - meta/lib/oe/sdk.py | 2 +- meta/lib/oe/sstatesig.py | 2 -- meta/lib/oe/utils.py | 2 +- meta/lib/oeqa/controllers/testtargetloader.py | 8 ++++---- meta/lib/oeqa/core/case.py | 1 - meta/lib/oeqa/core/decorator/__init__.py | 1 - meta/lib/oeqa/core/decorator/data.py | 1 - meta/lib/oeqa/core/loader.py | 2 +- meta/lib/oeqa/core/target/qemu.py | 2 +- meta/lib/oeqa/core/tests/cases/oetag.py | 1 - meta/lib/oeqa/core/utils/concurrencytest.py | 1 - meta/lib/oeqa/core/utils/path.py | 1 - meta/lib/oeqa/runtime/cases/buildlzip.py | 1 - .../oeqa/runtime/cases/ethernet_ip_connman.py | 20 +++++++++---------- meta/lib/oeqa/runtime/cases/logrotate.py | 10 ++++------ meta/lib/oeqa/runtime/cases/ltp.py | 6 +++--- meta/lib/oeqa/runtime/cases/ltp_compliance.py | 6 +++--- meta/lib/oeqa/runtime/cases/ltp_stress.py | 4 ++-- meta/lib/oeqa/runtime/cases/opkg.py | 4 ++-- meta/lib/oeqa/runtime/cases/rpm.py | 2 -- meta/lib/oeqa/runtime/cases/rtc.py | 5 ++--- meta/lib/oeqa/runtime/cases/runlevel.py | 6 +++--- meta/lib/oeqa/runtime/cases/storage.py | 6 +++--- meta/lib/oeqa/runtime/cases/suspend.py | 14 ++++++------- meta/lib/oeqa/runtime/cases/terminal.py | 4 ++-- meta/lib/oeqa/runtime/cases/usb_hid.py | 10 +++++----- meta/lib/oeqa/sdk/cases/gcc.py | 2 +- meta/lib/oeqa/sdk/context.py | 2 +- meta/lib/oeqa/sdk/testsdk.py | 2 -- meta/lib/oeqa/sdkext/testsdk.py | 1 - meta/lib/oeqa/selftest/cases/binutils.py | 1 - meta/lib/oeqa/selftest/cases/eSDK.py | 1 - meta/lib/oeqa/selftest/cases/gcc.py | 1 - meta/lib/oeqa/selftest/cases/glibc.py | 1 - meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 +- .../oeqa/selftest/cases/incompatible_lic.py | 1 - meta/lib/oeqa/selftest/cases/meta_ide.py | 2 +- .../oeqa/selftest/cases/oelib/buildhistory.py | 1 - meta/lib/oeqa/selftest/cases/oescripts.py | 5 ++--- meta/lib/oeqa/selftest/cases/prservice.py | 1 - meta/lib/oeqa/selftest/cases/recipeutils.py | 16 +++++++-------- meta/lib/oeqa/selftest/cases/reproducible.py | 1 - .../oeqa/selftest/cases/resulttooltests.py | 1 - meta/lib/oeqa/selftest/cases/runtime_test.py | 3 +-- meta/lib/oeqa/selftest/cases/selftest.py | 1 - meta/lib/oeqa/selftest/cases/signing.py | 2 +- meta/lib/oeqa/selftest/cases/sysroot.py | 2 +- meta/lib/oeqa/selftest/cases/tinfoil.py | 4 ++-- meta/lib/oeqa/selftest/cases/wic.py | 2 +- meta/lib/oeqa/selftest/context.py | 4 ++-- meta/lib/oeqa/utils/__init__.py | 4 ++-- meta/lib/oeqa/utils/commands.py | 2 +- meta/lib/oeqa/utils/git.py | 2 -- meta/lib/oeqa/utils/gitarchive.py | 1 - meta/lib/oeqa/utils/httpserver.py | 3 +-- meta/lib/oeqa/utils/nfs.py | 1 - meta/lib/oeqa/utils/qemurunner.py | 4 ++-- meta/lib/oeqa/utils/testexport.py | 3 +-- .../glibc/glibc/check-test-wrapper | 1 - .../systemd/systemd-systemctl/systemctl | 2 +- .../python-numpy/files/run-ptest | 1 - .../python3/check_build_completeness.py | 1 - .../python/python3/create_manifest3.py | 13 ++++++------ .../python/python3/get_module_deps3.py | 10 +++++----- .../python/python3/reformat_sysconfig.py | 1 - .../perf/perf/sort-pmuevents.py | 7 +++---- scripts/cp-noerror | 2 +- scripts/lib/build_perf/__init__.py | 1 - scripts/lib/build_perf/report.py | 1 - scripts/lib/checklayer/cases/bsp.py | 2 +- scripts/lib/checklayer/cases/distro.py | 2 +- scripts/lib/recipetool/create.py | 1 - scripts/lib/resulttool/log.py | 1 - scripts/lib/resulttool/regression.py | 1 - scripts/lib/resulttool/resultutils.py | 1 - scripts/lib/wic/partition.py | 1 - scripts/oe-build-perf-test | 1 - scripts/oe-trim-schemas | 1 - scripts/oepydevshell-internal.py | 2 +- scripts/opkg-query-helper.py | 1 - .../pybootchartgui/pybootchartgui/batch.py | 1 - scripts/pybootchartgui/pybootchartgui/gui.py | 2 +- .../pybootchartgui/pybootchartgui/main.py.in | 10 +++++----- .../pybootchartgui/tests/parser_test.py | 11 +++++----- scripts/relocate_sdk.py | 1 - 95 files changed, 125 insertions(+), 183 deletions(-)
contrib/git-hooks/sendemail-validate.sample +0 -1
@@ -75,4 +75,3 @@ def main(): if __name__ == "__main__": sys.exit(main()) -
meta/lib/bblayers/create.py +0 -1
@@ -79,4 +79,3 @@ class CreatePlugin(LayerPlugin): parser_create_layer.add_argument('--priority', '-p', default=6, help='Priority of recipes in layer') parser_create_layer.add_argument('--example-recipe-name', '-e', dest='examplerecipe', default='example', help='Filename of the example recipe') parser_create_layer.add_argument('--example-recipe-version', '-v', dest='version', default='0.1', help='Version number for the example recipe') -
meta/lib/oe/cachedpath.py +2 -2
@@ -43,7 +43,7 @@ class CachedPath(object): self.statcache[path] = False return False - # We might as well call lstat and then only + # We might as well call lstat and then only # call stat as well in the symbolic link case # since this turns out to be much more optimal # in real world usage of this cache
@@ -183,7 +183,7 @@ class CachedPath(object): loop_cnt -= 1 target = os.path.normpath(os.readlink(file)) - + if not os.path.isabs(target): tdir = os.path.dirname(file) assert(self.__is_path_below(tdir, root))
meta/lib/oe/elf.py +4 -4
@@ -6,7 +6,7 @@ def machine_dict(d): # TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit? machdata = { - "darwin9": { + "darwin9": { "arm": (40, 0, 0, True, 32), }, "eabi": {
@@ -28,7 +28,7 @@ def machine_dict(d): "riscv32": (243, 0, 0, True, 32), "riscv64": (243, 0, 0, True, 64), }, - "linux": { + "linux": { "aarch64": (183, 0, 0, True, 64), "aarch64_be": (183, 0, 0, False, 64), "arm": (40, 97, 0, True, 32),
@@ -62,7 +62,7 @@ def machine_dict(d): "microblaze": (189, 0, 0, False, 32), "microblazeel": (189, 0, 0, True, 32), }, - "linux-musl": { + "linux-musl": { "aarch64": (183, 0, 0, True, 64), "aarch64_be": (183, 0, 0, False, 64), "arm": (40, 97, 0, True, 32),
@@ -87,7 +87,7 @@ def machine_dict(d): }, "uclinux-uclibc": { "bfin": (106, 0, 0, True, 32), - }, + }, "linux-gnueabi": { "arm": (40, 0, 0, True, 32), "armeb": (40, 0, 0, False, 32),
meta/lib/oe/license.py +1 -1
@@ -190,7 +190,7 @@ class ManifestVisitor(LicenseVisitor): elif ops[-1] in ['[', ']']: ops.append(op) else: - ops[-1] = op + ops[-1] = op for op in ops: if op == '[' or op == ']':
meta/lib/oe/package.py +1 -1
@@ -27,7 +27,7 @@ def runstrip(arg): stripcmd = [strip] skip_strip = False - # kernel module + # kernel module if elftype & 16: if is_kernel_module_signed(file): bb.debug(1, "Skip strip on signed module %s" % file)
meta/lib/oe/patch.py +1 -2
@@ -218,7 +218,7 @@ class PatchTree(PatchSet): with open(self.seriespath, 'w') as f: for p in patches: f.write(p) - + def Import(self, patch, force=None): """""" PatchSet.Import(self, patch, force)
@@ -905,4 +905,3 @@ def should_apply(parm, d): return False, "applies to later version" return True, None -
meta/lib/oe/path.py +2 -2
@@ -91,7 +91,7 @@ def format_display(path, metadata): def copytree(src, dst): # We could use something like shutil.copytree here but it turns out to - # to be slow. It takes twice as long copying to an empty directory. + # to be slow. It takes twice as long copying to an empty directory. # If dst already has contents performance can be 15 time slower # This way we also preserve hardlinks between files in the tree.
@@ -122,7 +122,7 @@ def copyhardlinktree(src, dst): bb.debug(2, "Hardlink test failed with " + str(e)) if (canhard): - # Need to copy directories only with tar first since cp will error if two + # Need to copy directories only with tar first since cp will error if two # writers try and create a directory at the same time cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst) subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
meta/lib/oe/recipeutils.py +1 -1
@@ -1038,7 +1038,7 @@ def get_recipe_upstream_version(rd): revision = ud.method.latest_revision(ud, rd, 'default') upversion = pv if revision != rd.getVar("SRCREV"): - upversion = upversion + "-new-commits-available" + upversion = upversion + "-new-commits-available" else: pupver = ud.method.latest_versionstring(ud, rd) (upversion, revision) = pupver
meta/lib/oe/reproducible.py +0 -1
@@ -111,4 +111,3 @@ def get_source_date_epoch(d, sourcedir): get_source_date_epoch_from_youngest_file(d, sourcedir) or fixed_source_date_epoch(d) # Last resort ) -
meta/lib/oe/sdk.py +1 -1
@@ -139,7 +139,7 @@ def get_extra_sdkinfo(sstate_dir): This function is going to be used for generating the target and host manifest files packages of eSDK. """ import math - + extra_info = {} extra_info['tasksizes'] = {} extra_info['filesizes'] = {}
meta/lib/oe/sstatesig.py +0 -2
@@ -630,5 +630,3 @@ def OEOuthashBasic(path, sigfile, task, d): os.chdir(prev_dir) return h.hexdigest() - -
meta/lib/oe/utils.py +1 -1
@@ -284,7 +284,7 @@ def execute_pre_post_process(d, cmds): bb.note("Executing %s ..." % cmd) bb.build.exec_func(cmd, d) -# For each item in items, call the function 'target' with item as the first +# For each item in items, call the function 'target' with item as the first # argument, extraargs as the other arguments and handle any exceptions in the # parent thread
meta/lib/oeqa/controllers/testtargetloader.py +4 -4
@@ -11,8 +11,8 @@ import os class TestTargetLoader: - # Search oeqa.controllers module directory for and return a controller - # corresponding to the given target name. + # Search oeqa.controllers module directory for and return a controller + # corresponding to the given target name. # AttributeError raised if not found. # ImportError raised if a provided module can not be imported. def get_controller_module(self, target, bbpath):
@@ -46,7 +46,7 @@ class TestTargetLoader: return controllerslist # Search for and return a controller from given target name and - # set of module names. + # set of module names. # Raise AttributeError if not found. # Raise ImportError if a provided module can not be imported def load_controller_from_name(self, target, modulenames):
@@ -65,7 +65,7 @@ class TestTargetLoader: # is valid that a module may not have the target class. try: obj = getattr(module, target) - if obj: + if obj: from oeqa.targetcontrol import BaseTarget if(not issubclass(obj, BaseTarget)): bb.warn("Target {0} found, but subclass is not BaseTarget".format(target))
meta/lib/oeqa/core/case.py +0 -1
@@ -105,4 +105,3 @@ class OEPTestResultTestCase: sections[section] = {} resultname = "ptestresult.{}.{}".format(section, test) self.extraresults[resultname] = {"status": result} -
meta/lib/oeqa/core/decorator/__init__.py +0 -1
@@ -81,4 +81,3 @@ def OETestTag(*tags): item.__oeqa_testtags = expandedtags return item return decorator -
meta/lib/oeqa/core/decorator/data.py +0 -1
@@ -235,4 +235,3 @@ class skipIfQemu(OETestDecorator): self.logger.debug(msg) if is_qemu(self.case.td, self.value): self.case.skipTest(self.msg) -
meta/lib/oeqa/core/loader.py +1 -1
@@ -201,7 +201,7 @@ class OETestLoader(unittest.TestLoader): # a setUpDecorators/tearDownDecorators that methods # will call setUp/tearDown original methods. setattr(testCaseClass, 'setUpMethod', - getattr(testCaseClass, 'setUp')) + getattr(testCaseClass, 'setUp')) setattr(testCaseClass, 'tearDownMethod', getattr(testCaseClass, 'tearDown')) setattr(testCaseClass, 'setUp', testCaseClass._oeSetUp)
meta/lib/oeqa/core/target/qemu.py +1 -1
@@ -47,7 +47,7 @@ class OEQemuTarget(OESSHTarget): logfile=bootlog, boottime=boottime, use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir, dump_host_cmds=dump_host_cmds, logger=logger, - serial_ports=serial_ports, boot_patterns=boot_patterns, + serial_ports=serial_ports, boot_patterns=boot_patterns, use_ovmf=ovmf, tmpfsdir=tmpfsdir) dump_monitor_cmds = kwargs.get("testimage_dump_monitor") self.monitor_dumper = MonitorDumper(dump_monitor_cmds, dump_dir, self.runner)
meta/lib/oeqa/core/tests/cases/oetag.py +0 -1
@@ -37,4 +37,3 @@ class TagClassTest(OETestCase): def testTagNone(self): self.assertTrue(True, msg='How is this possible?') -
meta/lib/oeqa/core/utils/concurrencytest.py +0 -1
@@ -346,4 +346,3 @@ def partition_tests(suite, count): # No point in empty threads so drop them return [p for p in partitions if p] -
meta/lib/oeqa/core/utils/path.py +0 -1
@@ -21,4 +21,3 @@ def findFile(file_name, directory): def remove_safe(path): if os.path.exists(path): os.remove(path) -
meta/lib/oeqa/runtime/cases/buildlzip.py +0 -1
@@ -32,4 +32,3 @@ class BuildLzipTest(OERuntimeTestCase): self.project.run_configure() self.project.run_make() self.project.run_install() -
meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py +10 -10
@@ -5,30 +5,30 @@ from oeqa.core.decorator.data import skipIfQemu class Ethernet_Test(OERuntimeTestCase): - def set_ip(self, x): + def set_ip(self, x): x = x.split(".") - sample_host_address = '150' + sample_host_address = '150' x[3] = sample_host_address x = '.'.join(x) return x - - @skipIfQemu('qemuall', 'Test only runs on real hardware') + + @skipIfQemu('qemuall', 'Test only runs on real hardware') @OETestDepends(['ssh.SSHTest.test_ssh']) def test_set_virtual_ip(self): (status, output) = self.target.run("ifconfig eth0 | grep 'inet ' | awk '{print $2}'") self.assertEqual(status, 0, msg='Failed to get ip address. Make sure you have an ethernet connection on your device, output: %s' % output) - original_ip = output + original_ip = output virtual_ip = self.set_ip(original_ip) - + (status, output) = self.target.run("ifconfig eth0:1 %s netmask 255.255.255.0 && sleep 2 && ping -c 5 %s && ifconfig eth0:1 down" % (virtual_ip, virtual_ip)) self.assertEqual(status, 0, msg='Failed to create virtual ip address, output: %s' % output) - - @OETestDepends(['ethernet_ip_connman.Ethernet_Test.test_set_virtual_ip']) - def test_get_ip_from_dhcp(self): + + @OETestDepends(['ethernet_ip_connman.Ethernet_Test.test_set_virtual_ip']) + def test_get_ip_from_dhcp(self): (status, output) = self.target.run("connmanctl services | grep -E '*AO Wired|*AR Wired' | awk '{print $3}'") self.assertEqual(status, 0, msg='No wired interfaces are detected, output: %s' % output) wired_interfaces = output - + (status, output) = self.target.run("ip route | grep default | awk '{print $3}'") self.assertEqual(status, 0, msg='Failed to retrieve the default gateway, output: %s' % output) default_gateway = output
meta/lib/oeqa/runtime/cases/logrotate.py +4 -6
@@ -37,20 +37,20 @@ class LogrotateTest(OERuntimeTestCase): status, output = self.target.run('echo "create \n olddir $HOME/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') msg = ('Could not write to /tmp/logrotate-test.conf') self.assertEqual(status, 0, msg=msg) - + # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') status, _ = self.target.run('find $HOME/logrotate_dir -type f | grep wtmp.1') msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) self.assertEqual(status, 0, msg=msg) - + @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) def test_logrotate_newlog(self): - + status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') msg = ('Could not create logrotate test file in /var/log') self.assertEqual(status, 0, msg=msg) - + status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1" > /etc/logrotate.d/logrotate_testfile') msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') self.assertEqual(status, 0, msg=msg)
@@ -68,5 +68,3 @@ class LogrotateTest(OERuntimeTestCase): status, _ = self.target.run('find $HOME/logrotate_dir -type f | grep logrotate_testfile.1') msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) self.assertEqual(status, 0, msg=msg) - -
meta/lib/oeqa/runtime/cases/ltp.py +3 -3
@@ -78,7 +78,7 @@ class LtpTest(LtpTestBase): # copy nice log from DUT dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group) - remote_src = "/opt/ltp/results/%s" % ltp_group + remote_src = "/opt/ltp/results/%s" % ltp_group (status, output) = self.target.copyFrom(remote_src, dst, True) msg = 'File could not be copied. Output: %s' % output if status:
@@ -97,7 +97,7 @@ class LtpTest(LtpTestBase): testname = ("ltpresult." + ltp_group + "." + test) self.extras[testname] = {'status': result} if result == 'FAILED': - failed_tests[ltp_group] = test + failed_tests[ltp_group] = test if failed_tests: self.failmsg = self.failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests)
@@ -112,7 +112,7 @@ class LtpTest(LtpTestBase): @OETestDepends(['ltp.LtpTest.test_ltp_help']) def test_ltp_groups(self): - for ltp_group in self.ltp_groups: + for ltp_group in self.ltp_groups: self.runltp(ltp_group) @OETestDepends(['ltp.LtpTest.test_ltp_groups'])
meta/lib/oeqa/runtime/cases/ltp_compliance.py +3 -3
@@ -77,14 +77,14 @@ class LtpPosixTest(LtpPosixBase): runtime = int(endtime - starttime) sections['duration'] = runtime self.sections[posix_group] = sections - + failed_tests = {} for test in results: result = results[test] testname = ("ltpposixresult." + posix_group + "." + test) self.extras[testname] = {'status': result} if result == 'FAILED': - failed_tests[posix_group] = test + failed_tests[posix_group] = test if failed_tests: self.failmsg = self.failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests)
@@ -94,5 +94,5 @@ class LtpPosixTest(LtpPosixBase): @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(["ltp"]) def test_posix_groups(self): - for posix_group in self.posix_groups: + for posix_group in self.posix_groups: self.runltp(posix_group)
meta/lib/oeqa/runtime/cases/ltp_stress.py +2 -2
@@ -76,14 +76,14 @@ class LtpStressTest(LtpStressBase): runtime = int(endtime - starttime) sections['duration'] = runtime self.sections[stress_group] = sections - + failed_tests = {} for test in results: result = results[test] testname = ("ltpstressresult." + stress_group + "." + test) self.extras[testname] = {'status': result} if result == 'FAILED': - failed_tests[stress_group] = test + failed_tests[stress_group] = test if failed_tests: self.failmsg = self.failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests)
meta/lib/oeqa/runtime/cases/opkg.py +2 -2
@@ -40,11 +40,11 @@ class OpkgRepoTest(OpkgTest): apt_get_source_server = 'http://%s:%s/' % (self.tc.target.server_ip, self.repo_server.port) apt_get_sourceslist_dir = '/etc/opkg/' self.target.run('cd %s; echo src/gz all %s >> opkg.conf' % (apt_get_sourceslist_dir, apt_get_source_server)) - + def cleanup_source_config_for_package_install(self): apt_get_sourceslist_dir = '/etc/opkg/' self.target.run('cd %s; sed -i "/^src/d" opkg.conf' % (apt_get_sourceslist_dir)) - + @skipIfNotFeature('package-management', 'Test requires package-management to be in IMAGE_FEATURES') @skipIfNotDataVar('IMAGE_PKGTYPE', 'ipk',
meta/lib/oeqa/runtime/cases/rpm.py +0 -2
@@ -141,5 +141,3 @@ class RpmInstallRemoveTest(OERuntimeTestCase): self.assertEqual(0, status, msg=msg) self.tc.target.run('rm -f %s' % self.dst) - -
meta/lib/oeqa/runtime/cases/rtc.py +2 -3
@@ -22,7 +22,7 @@ class RTCTest(OERuntimeTestCase): def test_rtc(self): (status, output) = self.target.run('hwclock -r') self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output) - + (status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"') self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime)
@@ -33,7 +33,6 @@ class RTCTest(OERuntimeTestCase): (status, output) = self.target.run('date %s' % current_datetime) self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output) - + (status, output) = self.target.run('hwclock -w') self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output) -
meta/lib/oeqa/runtime/cases/runlevel.py +3 -3
@@ -5,7 +5,7 @@ import time class RunLevel_Test(OERuntimeTestCase): - + @OETestDepends(['ssh.SSHTest.test_ssh']) def test_runlevel_3(self): (status, output) = self.target.run("init 3 && sleep 5 && runlevel")
@@ -13,8 +13,8 @@ class RunLevel_Test(OERuntimeTestCase): self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 3, current runlevel : %s' % output[-1]) (status, output) = self.target.run("uname -a") self.assertEqual(status, 0, msg='Failed to run uname command, output: %s' % output) - - @OETestDepends(['runlevel.RunLevel_Test.test_runlevel_3']) + + @OETestDepends(['runlevel.RunLevel_Test.test_runlevel_3']) def test_runlevel_5(self): (status, output) = self.target.run("init 5 && sleep 5 && runlevel") runlevel = '3 5'
meta/lib/oeqa/runtime/cases/storage.py +3 -3
@@ -36,7 +36,7 @@ class StorageBase(OERuntimeTestCase): msg = ('File %s not created on %s' % (cls.test_file, cls.device)) cls.assertFalse(status, msg=msg) # move file - (status, output) = cls.target.run('mv %s/%s %s/%s1' % + (status, output) = cls.target.run('mv %s/%s %s/%s1' % (cls.test_dir, cls.test_file, cls.test_dir, cls.test_file)) msg = ('File %s not moved to %s' % (cls.test_file, cls.device)) cls.assertFalse(status, msg=msg)
@@ -47,7 +47,7 @@ class StorageBase(OERuntimeTestCase): def storage_read(cls): # check if message is in file - (status, output) = cls.target.run('cat %s/%s' % + (status, output) = cls.target.run('cat %s/%s' % (cls.test_dir, cls.test_file)) match = re.search('%s' % cls.test_msg, output)
@@ -56,7 +56,7 @@ class StorageBase(OERuntimeTestCase): def storage_write(cls): # create test message in file on device - (status, output) = cls.target.run('echo "%s" > %s/%s' % + (status, output) = cls.target.run('echo "%s" > %s/%s' % (cls.test_msg, cls.test_dir, cls.test_file)) msg = ('File %s not create test message on %s' % (cls.test_file, cls.device)) cls.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/suspend.py +7 -7
@@ -7,23 +7,23 @@ import time class Suspend_Test(OERuntimeTestCase): - def test_date(self): + def test_date(self): (status, output) = self.target.run('date') self.assertEqual(status, 0, msg='Failed to run date command, output : %s' % output) - + def test_ping(self): t_thread = threading.Thread(target=self.target.run, args=("ping 8.8.8.8",)) t_thread.start() time.sleep(2) - + status, output = self.target.run('pidof ping') self.target.run('kill -9 %s' % output) - self.assertEqual(status, 0, msg='Not able to find process that runs ping, output : %s' % output) - - def set_suspend(self): + self.assertEqual(status, 0, msg='Not able to find process that runs ping, output : %s' % output) + + def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) - + @skipIfQemu('qemuall', 'Test only runs on real hardware') @OETestDepends(['ssh.SSHTest.test_ssh']) def test_suspend(self):
meta/lib/oeqa/runtime/cases/terminal.py +2 -2
@@ -14,9 +14,9 @@ class TerminalTest(OERuntimeTestCase): t_thread = threading.Thread(target=self.target.run, args=("export DISPLAY=:0 && matchbox-terminal -e 'sh -c \"uname -a && exec sh\"'",)) t_thread.start() time.sleep(2) - + status, output = self.target.run('pidof matchbox-terminal') number_of_terminal = len(output.split()) self.assertEqual(number_of_terminal, 1, msg='There should be only one terminal being launched. Number of terminal launched : %s' % number_of_terminal) self.target.run('kill -9 %s' % output) - self.assertEqual(status, 0, msg='Not able to find process that runs terminal.') + self.assertEqual(status, 0, msg='Not able to find process that runs terminal.')
meta/lib/oeqa/runtime/cases/usb_hid.py +5 -5
@@ -6,18 +6,18 @@ from oeqa.runtime.decorator.package import OEHasPackage class USB_HID_Test(OERuntimeTestCase): - def keyboard_mouse_simulation(self): + def keyboard_mouse_simulation(self): (status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100') return self.assertEqual(status, 0, msg='Failed to simulate keyboard/mouse input event, output : %s' % output) - - def set_suspend(self): + + def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') return self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) - + @OEHasPackage(['xdotool']) @skipIfQemu('qemuall', 'Test only runs on real hardware') @OETestDepends(['ssh.SSHTest.test_ssh']) def test_USB_Hid_input(self): self.keyboard_mouse_simulation() self.set_suspend() - self.keyboard_mouse_simulation() + self.keyboard_mouse_simulation()
meta/lib/oeqa/sdk/cases/gcc.py +1 -1
@@ -19,7 +19,7 @@ class GccCompileTest(OESDKTestCase): @classmethod def setUpClass(self): files = {'test.c': self.tc.files_dir, 'test.cpp': self.tc.files_dir, - 'testsdkmakefile': self.tc.sdk_files_dir} + 'testsdkmakefile': self.tc.sdk_files_dir} for f in files: shutil.copyfile(os.path.join(files[f], f), os.path.join(self.tc.sdk_dir, f))
meta/lib/oeqa/sdk/context.py +1 -1
@@ -80,7 +80,7 @@ class OESDKTestContextExecutor(OETestContextExecutor): # required options, seems that don't keep track of already parsed # options sdk_rgroup = self.parser.add_argument_group('sdk required options') - sdk_rgroup.add_argument('--sdk-dir', required=False, action='store', + sdk_rgroup.add_argument('--sdk-dir', required=False, action='store', help='sdk installed directory') self.parser.add_argument('-j', '--num-processes', dest='processes', action='store',
meta/lib/oeqa/sdk/testsdk.py +0 -2
@@ -144,5 +144,3 @@ class TestSDK(TestSDKBase): if fail: bb.fatal("%s - FAILED - check the task log and the commands log" % pn) - -
meta/lib/oeqa/sdkext/testsdk.py +0 -1
@@ -105,4 +105,3 @@ class TestSDKExt(TestSDKBase): if fail: bb.fatal("%s - FAILED - check the task log and the commands log" % pn) -
meta/lib/oeqa/selftest/cases/binutils.py +0 -1
@@ -49,4 +49,3 @@ class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase): with open(sumspath, "r") as f: for test, result in parse_values(f): self.ptest_result(ptestsuite, test, result) -
meta/lib/oeqa/selftest/cases/eSDK.py +0 -1
@@ -118,4 +118,3 @@ SSTATE_MIRRORS = "file://.* file://%s/PATH" image = 'core-image-minimal' cmd = "devtool build-image %s" % image oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) -
meta/lib/oeqa/selftest/cases/gcc.py +0 -1
@@ -165,4 +165,3 @@ class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): def test_libitm(self): self.check_skip("libitm") self.run_check_emulated("libitm") -
meta/lib/oeqa/selftest/cases/glibc.py +0 -1
@@ -90,4 +90,3 @@ class GlibcSelfTest(GlibcSelfTestBase): class GlibcSelfTestSystemEmulated(GlibcSelfTestBase): def test_glibc(self): self.run_check_emulated() -
meta/lib/oeqa/selftest/cases/imagefeatures.py +1 -1
@@ -262,7 +262,7 @@ PNBLACKLIST[busybox] = "Don't build this" Author: Humberto Ibarra <[email protected]> Yeoh Ee Peng <[email protected]> """ - + image_name = 'core-image-minimal' features = 'IMAGE_GEN_DEBUGFS = "1"\n' features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
meta/lib/oeqa/selftest/cases/incompatible_lic.py +0 -1
@@ -135,4 +135,3 @@ RDEPENDS_packagegroup-core-full-cmdline-multiuser_remove = "gzip"\n """) bitbake('core-image-full-cmdline') bitbake('-c testimage core-image-full-cmdline') -
meta/lib/oeqa/selftest/cases/meta_ide.py +1 -1
@@ -23,7 +23,7 @@ class MetaIDE(OESelftestTestCase): cls.environment_script_path = '%s/%s' % (cls.tmpdir, cls.environment_script) cls.corebasedir = bb_vars['COREBASE'] cls.tmpdir_metaideQA = tempfile.mkdtemp(prefix='metaide') - + @classmethod def tearDownClass(cls): shutil.rmtree(cls.tmpdir_metaideQA, ignore_errors=True)
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +0 -1
@@ -144,4 +144,3 @@ class TestFileListCompare(OESelftestTestCase): self.maxDiff = None self.assertCountEqual(rendered, expectedResult) -
meta/lib/oeqa/selftest/cases/oescripts.py +2 -3
@@ -109,7 +109,7 @@ class OEGitproxyTests(OESelftestTestCase): res = runCmd('%s%s/oe-git-proxy 127.1.2.3 9418' % (prefix, self.scripts_dir)) self.assertIn('TCP:', res.output) - + # test that * globbering is off os.environ['NO_PROXY'] = "*" res = runCmd('%s%s/oe-git-proxy host.example.com 9418' %
@@ -135,7 +135,7 @@ class OeRunNativeTest(OESelftestTestCase): class OEListPackageconfigTests(OEScriptTests): #oe-core.scripts.List_all_the_PACKAGECONFIG's_flags - def check_endlines(self, results, expected_endlines): + def check_endlines(self, results, expected_endlines): for line in results.output.splitlines(): for el in expected_endlines: if line.split() == el.split():
@@ -188,4 +188,3 @@ class OEListPackageconfigTests(OEScriptTests): expected_endlines.append("pinentry gtk2 libcap ncurses qt secret") self.check_endlines(results, expected_endlines) -
meta/lib/oeqa/selftest/cases/prservice.py +0 -1
@@ -123,4 +123,3 @@ class BitbakePrTests(OESelftestTestCase): ret = runCmd('bitbake-prserv --host localhost --port %s --loglevel=DEBUG --stop' % port) self.assertEqual(ret.status, 0) -
meta/lib/oeqa/selftest/cases/recipeutils.py +8 -8
@@ -43,15 +43,15 @@ class RecipeUtilsTests(OESelftestTestCase): -LICENSE = "BSD" +LICENSE = "something" LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e" - + inherit pypi - + PYPI_PACKAGE = "async" - + -SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b" +SRC_URI[md5sum] = "aaaaaa" SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051" - + RDEPENDS_${PN} += "${PYTHON_PN}-threading" """ patchlines = []
@@ -74,9 +74,9 @@ class RecipeUtilsTests(OESelftestTestCase): --- a/recipes-test/recipeutils/recipeutils-test_1.2.bb +++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb @@ -8,6 +8,4 @@ - + BBCLASSEXTEND = "native nativesdk" - + -SRC_URI += "file://somefile" - SRC_URI_append = " file://anotherfile"
@@ -98,9 +98,9 @@ class RecipeUtilsTests(OESelftestTestCase): --- a/recipes-test/recipeutils/recipeutils-test_1.2.bb +++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb @@ -8,6 +8,3 @@ - + BBCLASSEXTEND = "native nativesdk" - + -SRC_URI += "file://somefile" - -SRC_URI_append = " file://anotherfile"
meta/lib/oeqa/selftest/cases/reproducible.py +0 -1
@@ -334,4 +334,3 @@ class ReproducibleTests(OESelftestTestCase): if fails: self.fail('\n'.join(fails)) -
meta/lib/oeqa/selftest/cases/resulttooltests.py +0 -1
@@ -96,4 +96,3 @@ class ResultToolTests(OESelftestTestCase): resultutils.append_resultsdata(results, ResultToolTests.base_results_data, configmap=resultutils.flatten_map) resultutils.append_resultsdata(results, ResultToolTests.target_results_data, configmap=resultutils.flatten_map) self.assertEqual(len(results[''].keys()), 5, msg="Flattened results not correct %s" % str(results)) -
meta/lib/oeqa/selftest/cases/runtime_test.py +1 -2
@@ -388,7 +388,7 @@ IMAGE_INSTALL_append = " systemtap-runtime" bitbake(self.image) with runqemu(self.image) as qemu: - cmd = "crosstap -r [email protected] -s %s/general/helloworld.stp " % systemtap_examples + cmd = "crosstap -r [email protected] -s %s/general/helloworld.stp " % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap helloworld returned a non 0 status:%s' % result.output)
@@ -427,4 +427,3 @@ IMAGE_INSTALL_append = " systemtap-runtime" cmd = "crosstap -r [email protected] -s %s/process/ syscalls_by_pid.stp" % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output) -
meta/lib/oeqa/selftest/cases/selftest.py +0 -1
@@ -53,4 +53,3 @@ def search_method(module, method): if m == method: return True return False -
meta/lib/oeqa/selftest/cases/signing.py +1 -1
@@ -130,7 +130,7 @@ class Signing(OESelftestTestCase): test_recipe = 'ed' - # Since we need gpg but we can't use gpg-native for sstate signatures, we + # Since we need gpg but we can't use gpg-native for sstate signatures, we # build gpg-native in our original builddir then run the tests in a second one. builddir = os.environ.get('BUILDDIR') + "-testsign" sstatedir = os.path.join(builddir, 'test-sstate')
meta/lib/oeqa/selftest/cases/sysroot.py +1 -1
@@ -16,7 +16,7 @@ class SysrootTests(OESelftestTestCase): sysroot is correctly cleaned up. The files in the two providers overlap so can cause errors if the sysroot code doesn't function correctly. Yes, sysroot-test should be machine specific really to avoid this, however - the sysroot cleanup should also work [YOCTO #13702]. + the sysroot cleanup should also work [YOCTO #13702]. """ uuid1 = uuid.uuid4()
meta/lib/oeqa/selftest/cases/tinfoil.py +2 -2
@@ -103,9 +103,9 @@ class TinfoilTests(OESelftestTestCase): start = time.time() # Wait for maximum 60s in total so we'd detect spurious heartbeat events for example # The test is IO load sensitive too - while (not (eventreceived == True and commandcomplete == True) + while (not (eventreceived == True and commandcomplete == True) and (time.time() - start < 60)): - # if we received both events (on let's say a good day), we are done + # if we received both events (on let's say a good day), we are done event = tinfoil.wait_event(1) if event: if isinstance(event, bb.command.CommandCompleted):
meta/lib/oeqa/selftest/cases/wic.py +1 -1
@@ -247,7 +247,7 @@ class Wic(WicTestCase): runCmd(cmd) sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') images = glob(self.resultdir + "mkefidisk-*.direct") - result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot)) + result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot)) self.assertIn("kernel", result.output) def test_sdimage_bootpart(self):
meta/lib/oeqa/selftest/context.py +2 -2
@@ -199,14 +199,14 @@ class OESelftestTestContextExecutor(OETestContextExecutor): machines = [] bbpath = self.tc_kwargs['init']['td']['BBPATH'].split(':') - + for path in bbpath: found_machines = glob.glob(os.path.join(path, 'conf', 'machine', '*.conf')) if found_machines: for i in found_machines: # eg: '/home/<user>/poky/meta-intel/conf/machine/intel-core2-32.conf' machines.append(os.path.splitext(os.path.basename(i))[0]) - + return machines def _get_cases_paths(self, bbpath):
meta/lib/oeqa/utils/__init__.py +2 -2
@@ -46,8 +46,8 @@ def avoid_paths_in_environ(paths): def make_logger_bitbake_compatible(logger): import logging - """ - We need to raise the log level of the info output so unittest + """ + We need to raise the log level of the info output so unittest messages are visible on the console. """ def _bitbake_log_info(msg, *args, **kwargs):
meta/lib/oeqa/utils/commands.py +1 -1
@@ -117,7 +117,7 @@ class Command(object): else: deadline = time.time() + self.timeout for thread in self.threads: - timeout = deadline - time.time() + timeout = deadline - time.time() if timeout < 0: timeout = 0 thread.join(timeout)
meta/lib/oeqa/utils/git.py +0 -2
@@ -78,5 +78,3 @@ class GitRepo(object): return self.run_cmd(['symbolic-ref', 'HEAD'])[11:] except GitError: return None - -
meta/lib/oeqa/utils/gitarchive.py +0 -1
@@ -241,4 +241,3 @@ def rev_find(revs, attr, val): if getattr(rev, attr) == val: return i raise ValueError("Unable to find '{}' value '{}'".format(attr, val)) -
meta/lib/oeqa/utils/httpserver.py +1 -2
@@ -42,7 +42,7 @@ class HTTPService(object): self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir, self.logger]) # The signal handler from testimage.bbclass can cause deadlocks here - # if the HTTPServer is terminated before it can restore the standard + # if the HTTPServer is terminated before it can restore the standard #signal behaviour orig = signal.getsignal(signal.SIGTERM) signal.signal(signal.SIGTERM, signal.SIG_DFL)
@@ -60,4 +60,3 @@ class HTTPService(object): self.process.join() if self.logger: self.logger.info("Stopped HTTPService on %s:%s" % (self.host, self.port)) -
meta/lib/oeqa/utils/nfs.py +0 -1
@@ -37,4 +37,3 @@ def unfs_server(directory, logger=None): if exports is not None: # clean up exports file os.unlink(exports.name) -
meta/lib/oeqa/utils/qemurunner.py +2 -2
@@ -192,7 +192,7 @@ class QemuRunner: qmp_file = "." + next(tempfile._get_candidate_names()) qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file) qmp_port = self.tmpdir + "/" + qmp_file - # Create a second socket connection for debugging use, + # Create a second socket connection for debugging use, # note this will NOT cause qemu to block waiting for the connection qmp_file2 = "." + next(tempfile._get_candidate_names()) qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2)
@@ -354,7 +354,7 @@ class QemuRunner: os.chdir(origpath) # We worry that mmap'd libraries may cause page faults which hang the qemu VM for periods - # causing failures. Before we "start" qemu, read through it's mapped files to try and + # causing failures. Before we "start" qemu, read through it's mapped files to try and # ensure we don't hit page faults later mapdir = "/proc/" + str(self.qemupid) + "/map_files/" try:
meta/lib/oeqa/utils/testexport.py +1 -2
@@ -34,7 +34,7 @@ except ImportError: if msg: print("FATAL:" + msg) sys.exit(1) - bb = my_log() + bb = my_log() def determine_if_poky_env():
@@ -271,4 +271,3 @@ def rm_bin(removal_list): # need to know both if the binary is sent archived and if status != 0: bb.warn("Failed to remove: %s. Please ensure connection with the target device is up and running and " "you have the needed rights." % item) -
meta/recipes-core/glibc/glibc/check-test-wrapper +0 -1
@@ -77,4 +77,3 @@ try: sys.exit(r.returncode) except subprocess.TimeoutExpired: sys.exit(-1) -
meta/recipes-core/systemd/systemd-systemctl/systemctl +1 -1
@@ -31,7 +31,7 @@ class SystemdFile(): self._parse(root, path) dirname = os.path.basename(path.name) + ".d" for location in locations: - for path2 in sorted((root / location / "system" / dirname).glob("*.conf")): + for path2 in sorted((root / location / "system" / dirname).glob("*.conf")): self._parse(root, path2) def _parse(self, root, path):
meta/recipes-devtools/python-numpy/files/run-ptest +0 -1
@@ -2,4 +2,3 @@ import numpy numpy.test(label='full', verbose=2) -
meta/recipes-devtools/python/python3/check_build_completeness.py +0 -1
@@ -14,4 +14,3 @@ if failed_to_build != -1: if necessary_bits != -1 or failed_to_build != -1: sys.exit(1) -
meta/recipes-devtools/python/python3/create_manifest3.py +6 -7
@@ -5,7 +5,7 @@ # packages only when the user needs them, hence why we split upstream python # into several packages. # -# In a very simplistic way what this does is: +# In a very simplistic way what this does is: # Launch python and see specifically what is required for it to run at a minimum # # Go through the python-manifest file and launch a separate task for every single
@@ -136,9 +136,9 @@ for coredep in output.split(): # The second step is to loop through the existing files contained in the core package -# according to the old manifest, identify if they are modules, or some other type +# according to the old manifest, identify if they are modules, or some other type # of file that we cant import (directories, binaries, configs) in which case we -# can only assume they were added correctly (manually) so we ignore those and +# can only assume they were added correctly (manually) so we ignore those and # pass them to the manifest directly. for filedep in old_manifest['core']['files']:
@@ -216,7 +216,7 @@ for pypkg in old_manifest: # each of them by launching a separate task. # The output of that task is then parsed and the manifest is updated # accordingly, wether it should add the module on FILES for the current package -# or if that module already belongs to another package then the current one +# or if that module already belongs to another package then the current one # will RDEPEND on it for pypkg in old_manifest:
@@ -237,7 +237,7 @@ for pypkg in old_manifest: print('Handling package %s' % pypkg) print('--------------------------') - # Handle special cases, we assume that when they were manually added + # Handle special cases, we assume that when they were manually added # to the manifest we knew what we were doing. special_packages = ['misc', 'modules', 'dev', 'tests'] if pypkg in special_packages or 'staticdev' in pypkg:
@@ -315,7 +315,7 @@ for pypkg in old_manifest: # # 2 - We do it the other way around, checking if the folder is contained in the path # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2 - # is folder_string inside path/folder1/folder2/filename?, + # is folder_string inside path/folder1/folder2/filename?, # Yes, it works, but we waste a couple of milliseconds. pymodule_dep = pymodule_dep.replace(pyversion, '${PYTHON_MAJMIN}')
@@ -438,4 +438,3 @@ if (repeated): error_msg += '\n'.join(repeated) error_msg += '\n' sys.exit(error_msg) -
meta/recipes-devtools/python/python3/get_module_deps3.py +5 -5
@@ -1,5 +1,5 @@ # This script is launched on separate task for each python module -# It checks for dependencies for that specific module and prints +# It checks for dependencies for that specific module and prints # them out, the output of this execution will have all dependencies # for a specific module, which will be parsed an dealt on create_manifest.py #
@@ -106,8 +106,8 @@ for item in dif: # Deals with NameError: name 'dep_path' is not defined # because module is not found (wasn't compiled?), e.g. bddsm if debug == True: - log.write(item + ' ') - log.write(str(e)) + log.write(item + ' ') + log.write(str(e)) pass if dep_path == '':
@@ -158,8 +158,8 @@ for item in dif: except NameError as e: # Deals with NameError: name 'cached' is not defined if debug == True: - log.write(item + ' ') - log.write(str(e)) + log.write(item + ' ') + log.write(str(e)) pass if cached is not None: if debug == True:
meta/recipes-devtools/python/python3/reformat_sysconfig.py +0 -1
@@ -18,4 +18,3 @@ with open(sys.argv[1], 'w') as f: f.write('%s = ' % k) pprint.pprint(l[k], stream=f, width=sys.maxsize) f.write('\n') -
meta/recipes-kernel/perf/perf/sort-pmuevents.py +3 -4
@@ -55,12 +55,12 @@ for struct in re.findall(struct_block_regex, data): if cpuid: #print( " cpuid found: %s" % cpuid.group(1) ) entry_dict[struct[1]]['fields'][cpuid.group(1)] = entry - + name = re.search(name_regex, entry) if name: #print( " name found: %s" % name.group(1) ) entry_dict[struct[1]]['fields'][name.group(1)] = entry - + # created ordered dictionaries from the captured values. These are ordered by # a sorted() iteration of the keys. We don't care about the order we read
@@ -75,7 +75,7 @@ for i in sorted(entry_dict.keys()): entry_dict_sorted[i]['type'] = entry_dict[i]['type'] entry_dict_sorted[i]['fields'] = {} for f in sorted(entry_dict[i]['fields'].keys()): - entry_dict_sorted[i]['fields'][f] = entry_dict[i]['fields'][f] + entry_dict_sorted[i]['fields'][f] = entry_dict[i]['fields'][f] # dump the sorted elements to the outfile outf = open(outfile, 'w')
@@ -90,4 +90,3 @@ for d in entry_dict_sorted: outf.write("};\n") outf.close() -
scripts/cp-noerror +1 -1
@@ -17,7 +17,7 @@ def copytree(src, dst, symlinks=False, ignore=None): names = os.listdir(src) try: os.makedirs(dst) - except OSError: + except OSError: # Already exists pass errors = []
scripts/lib/build_perf/__init__.py +0 -1
@@ -22,4 +22,3 @@ def print_table(rows, row_fmt=None): for row in rows: print(*[row_fmt[i].format(col, wid=col_widths[i]) for i, col in enumerate(row)]) -
scripts/lib/build_perf/report.py +0 -1
@@ -336,4 +336,3 @@ def measurement_stats(meas, prefix=''): stats[prefix + 'plus'] = val_cls(max_val - mean_val) return stats -
scripts/lib/checklayer/cases/bsp.py +1 -1
@@ -17,7 +17,7 @@ class BSPCheckLayer(OECheckLayerTestCase): self.tc.layer['name']) def test_bsp_defines_machines(self): - self.assertTrue(self.tc.layer['conf']['machines'], + self.assertTrue(self.tc.layer['conf']['machines'], "Layer is BSP but doesn't defines machines.") def test_bsp_no_set_machine(self):
scripts/lib/checklayer/cases/distro.py +1 -1
@@ -17,7 +17,7 @@ class DistroCheckLayer(OECheckLayerTestCase): self.tc.layer['name']) def test_distro_defines_distros(self): - self.assertTrue(self.tc.layer['conf']['distros'], + self.assertTrue(self.tc.layer['conf']['distros'], "Layer is BSP but doesn't defines machines.") def test_distro_no_set_distros(self):
scripts/lib/recipetool/create.py +0 -1
@@ -1335,4 +1335,3 @@ def register_commands(subparsers): parser_create.add_argument('--devtool', action="store_true", help=argparse.SUPPRESS) parser_create.add_argument('--mirrors', action="store_true", help='Enable PREMIRRORS and MIRRORS for source tree fetching (disabled by default).') parser_create.set_defaults(func=create_recipe) -
scripts/lib/resulttool/log.py +0 -1
@@ -105,4 +105,3 @@ def register_commands(subparsers): help='show raw ptest log') parser.add_argument('--raw-reproducible', action='store_true', help='show raw reproducible build logs') -
scripts/lib/resulttool/regression.py +0 -1
@@ -189,4 +189,3 @@ def register_commands(subparsers): parser_build.add_argument('--commit-number', help="Revision number to search for, redundant if --commit is specified") parser_build.add_argument('--commit2', help="Revision to compare with") parser_build.add_argument('--commit-number2', help="Revision number to compare with, redundant if --commit2 is specified") -
scripts/lib/resulttool/resultutils.py +0 -1
@@ -237,4 +237,3 @@ def test_run_results(results): if not 'result' in test_run: continue yield path, run_name, test_run, test_run['result'] -
scripts/lib/wic/partition.py +0 -1
@@ -493,4 +493,3 @@ class Partition(): logger.warn("%s Inodes (of size %d) are too small." % (get_err_str(self), size)) break -
scripts/oe-build-perf-test +0 -1
@@ -214,4 +214,3 @@ def main(argv=None): if __name__ == '__main__': sys.exit(main()) -
scripts/oe-trim-schemas +0 -1
@@ -61,4 +61,3 @@ for schema in child(xml.getroot(), "schemalist").getchildren(): locale.remove(e) xml.write(sys.stdout, "UTF-8") -
scripts/oepydevshell-internal.py +1 -1
@@ -74,7 +74,7 @@ try: if readdata: i = i + readdata.decode('utf-8') if i: - # Write a page at a time to avoid overflowing output + # Write a page at a time to avoid overflowing output # d.keys() is a good way to do that sys.stdout.write(i[:4096]) sys.stdout.flush()
scripts/opkg-query-helper.py +0 -1
@@ -69,4 +69,3 @@ for line in fileinput.input(args): for rec in recs: rec = verregex.sub('', rec) print("%s|%s [REC]" % (pkg, rec)) -
scripts/pybootchartgui/pybootchartgui/batch.py +0 -1
@@ -44,4 +44,3 @@ def render(writer, trace, app_options, filename): draw.render(ctx, options, 1.0, trace) write_surface(surface) writer.status("bootchart written to '%s'" % filename) -
scripts/pybootchartgui/pybootchartgui/gui.py +1 -1
@@ -14,7 +14,7 @@ # along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>. import gi -gi.require_version('Gtk', '3.0') +gi.require_version('Gtk', '3.0') from gi.repository import Gtk as gtk from gi.repository import Gtk from gi.repository import Gdk
scripts/pybootchartgui/pybootchartgui/main.py.in +5 -5
@@ -29,7 +29,7 @@ def _mk_options_parser(): usage = "%prog [options] /path/to/tmp/buildstats/<recipe-machine>/<BUILDNAME>/" version = "%prog v1.0.0" parser = optparse.OptionParser(usage, version=version) - parser.add_option("-i", "--interactive", action="store_true", dest="interactive", default=False, + parser.add_option("-i", "--interactive", action="store_true", dest="interactive", default=False, help="start in active mode") parser.add_option("-f", "--format", dest="format", default="png", choices=["png", "svg", "pdf"], help="image format (png, svg, pdf); default format png")
@@ -46,7 +46,7 @@ def _mk_options_parser(): parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False, help="suppress informational messages") # parser.add_option("-t", "--boot-time", action="store_true", dest="boottime", default=False, -# help="only display the boot time of the boot in text format (stdout)") +# help="only display the boot time of the boot in text format (stdout)") parser.add_option("--very-quiet", action="store_true", dest="veryquiet", default=False, help="suppress all messages except errors") parser.add_option("--verbose", action="store_true", dest="verbose", default=False,
@@ -73,7 +73,7 @@ class Writer: def __init__(self, write, options): self.write = write self.options = options - + def error(self, msg): self.write(msg)
@@ -94,7 +94,7 @@ def _mk_writer(options): def write(s): print(s) return Writer(write, options) - + def _get_filename(path): """Construct a usable filename for outputs"""
@@ -112,7 +112,7 @@ def main(argv=None): try: if argv is None: argv = sys.argv[1:] - + parser = _mk_options_parser() options, args = parser.parse_args(argv)
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +5 -6
@@ -26,7 +26,7 @@ writer = main._mk_writer(options) class TestBCParser(unittest.TestCase): - + def setUp(self): self.name = "My first unittest" self.rootdir = bootchart_dir
@@ -43,7 +43,7 @@ class TestBCParser(unittest.TestCase): def test_parseTimedBlocks(self): trace = parsing.Trace(writer, args, options) state = parsing.parse_file(writer, trace, self.mk_fname('proc_diskstats.log')) - self.assertEqual(141, len(state.disk_stats)) + self.assertEqual(141, len(state.disk_stats)) def testParseProcPsLog(self): trace = parsing.Trace(writer, args, options)
@@ -78,17 +78,17 @@ class TestBCParser(unittest.TestCase): for index, line in enumerate(diskstats_data): tokens = line.split('\t') sample = samples[index] - if debug: + if debug: print(line.rstrip()) print(sample) print('-------------------') - + self.assertEqual(tokens[0], str(sample.time)) self.assert_(floatEq(float(tokens[1]), sample.read)) self.assert_(floatEq(float(tokens[2]), sample.write)) self.assert_(floatEq(float(tokens[3]), sample.util)) diskstats_data.close() - + def testparseProcStatLog(self): trace = parsing.Trace(writer, args, options) samples = parsing.parse_file(writer, trace, self.mk_fname('proc_stat.log')).cpu_stats
@@ -111,4 +111,3 @@ class TestBCParser(unittest.TestCase): if __name__ == '__main__': unittest.main() -
scripts/relocate_sdk.py +0 -1
@@ -257,4 +257,3 @@ for e in executables_list: if old_size != os.path.getsize(e): print("New file size for %s is different. Looks like a relocation error!", e) sys.exit(-1) -
Signature · 1 line
2.17.1
Quoted 3 lines · Armin Kuster
I am forwarding a pull request;
https://github.com/openembedded/openembedded-core/pull/71
Looking at the comments on that pull request, "I did this on more than 100 repos" suggests this hasn't been done with any attention to the specifics of openembedded-core/bitbake. In my opinion that approach is a waste of maintainer's time.
Signature · 2 lines
Paul Barker Konsulko Group
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Persian Prince
@Paul Barker
I spent days and nights for testing the outcome of my
PEP8.shscript and I used it on more than 100 repos to check the results, what you see now is the result of that.People at https://github.com/OpenVisionE2 , https://github.com/OpenPLi , https://github.com/oe-alliance and more other teams like ViX, ATV and ... trusted my work and all those are using the changed codes for months!
This is why I write "Safe PEP8" not just "PEP8" as if you just run a normal PEP8 on your repos you'll end up with dead ones.
If you check https://github.com/openembedded/meta-openembedded you're using my changes for 3 months on this repo also so I don't get you being rude.
Please start with
https://docs.yoctoproject.org/dev-manual/common-tasks.html#making-changes-to-the-yocto-project
which documents the way to make contributions to the project. If you're using an automated tool please give a quick description of it alongside the changes, preferably with a link to its source code.
You may also want to check
https://git.openembedded.org/openembedded-core/tree/scripts/oe-pylint.
Running that script should flag up errors which we do want to see fixed. If there are more warnings & errors to consider then these should be added to that script or to a pylint/pep8/flake8 config file so that we can run this against all new patches in the future.
Signature · 2 lines
Paul Barker Konsulko Group