summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/utils/targetbuild: tmp dir improvementsJoshua Lock2017-04-061-3/+7
| | | | | | | | | | Don't hard-code /tmp as the tmpdir, instead use WORKDIR as the tmpdir if the instantiater doesn't specify a value. (From OE-Core rev: c43c966e0ed4ed836bdf90b1d4c3f2f45426f1ec) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/buildproject: create a more unique tmp dirJoshua Lock2017-04-061-2/+5
| | | | | | | | | | Rather than hardcoding /tmp as the default tmpdir make a more unique tmpdir with tempfile.mkdtemp() when the caller doesn't specify a tmpdir value. (From OE-Core rev: 9425c2658fea0b45468a04574cd77bffc6668a8d) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/commands: extend variable regex to include A_B variable notationLeonardo Sandoval2017-04-051-1/+1
| | | | | | | | | | This change allows quering for variables with the format A_B, i.e. PREFERRED_PROVIDER_virtual/kernel instead of just A. (From OE-Core rev: 3810738eff6bdcf27c7e291dbeaedc699ab14bfc) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: allow persistent image writes in runqemu()Patrick Ohly2017-03-283-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, QemuRunner avoids modifying the image files that it boots into by enabling the qemu snapshot mode. However, some tests may want to test changes that must persists across reboots, so this mode should be optional. This can be combined by copying the image file to a temporary location first and then booting with that copy. It's also useful when testing with additional drives attached to a virtual machine. QemuTinyRunner doesn't use the snapshot parameter and therefore ignores the new parameter. Long term, a better way of passing these various configuration parameters should be used, and perhaps QemuRunner and QemuTinyRunner can be merged into one again to avoid code duplication. But for now the patch follows the exiting style. Also beware that QemuTarget.start() now acts in two different modes (with or without explicit launch command), and depending on that mode parameters like discard_writes must be ignored, i.e. not get passed to launch(). (From OE-Core rev: 969d079a33a57f5a8f7af86d7bab04d35ab07584) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: allow customizing image used by runqemu()Patrick Ohly2017-03-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | runqemu() takes all parameters for the virtual machine from the variables of the given recipe. By allowing the caller to provide a hash with variables that get applied locally, the caller gets more control. Here's the intended usage: <prepare internal-image in self.resultdir> overrides = { 'DEPLOY_DIR_IMAGE': self.resultdir, 'IMAGE_LINK_NAME': 'internal-image-%s' % self.image_arch, } with runqemu('refkit-installer-image', ssh=False, overrides=overrides) as qemu: .... This can be used to replace the image completely with something else or to copy it before allowing runqemu() to write into it. (From OE-Core rev: 4c6ba32abd6b9de33f4b8a0b87e8a56432ed7825) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: allow extending qemuparams="..."Patrick Ohly2017-03-281-2/+2
| | | | | | | | | | | | | | | Sometimes it is useful to reconfigure the qemu virtual machine directly. runqemu has the "qemuparams" parameter for that, and the underlying start() methods also supported modifying that via their "params" parameter. Only the runqemu() wrapper function lacked a way to specify additional parameters. One potential usage is to attach additional disks. (From OE-Core rev: b2a1cf09ea65ed6f561886b1b4241f9adf3e5709) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: tolerate interrupted select() while waiting for qemuPatrick Ohly2017-03-282-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, the OEQA utility code aborts with: ... File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams) File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch sread, swrite, serror = select.select(socklist, [], [], 5) InterruptedError: [Errno 4] Interrupted system call strace shows that this is because of a SIGWINCH: Connection from 127.0.0.1:52668 select(21, [20], [], [], {5, 0}) = ? ERESTARTNOHAND (To be restarted if no handler) --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} --- This is related to some special conditions: * whether qemu opens a graphical console window (enabled in Poky by default) * where that window gets opened * whether the window manager changes the size of the shell window (mine is a tiling window manager and reorders and resizes windows automatically) Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example, run() in ssh.py) already does the same thing. (From OE-Core rev: 44fe106baf5fd5aebe26c5f28004e2b18d839b7c) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.commands: limit runCmd exception outputMarkus Lehtonen2017-03-271-3/+10
| | | | | | | | | | | | Make it possible to limit the length of output lines shown in runCmd exceptions. E.g when running bitbake we easily get thousands of lines of log output, where only the last few (tens) are interesting or relevant when an error occurs. (From OE-Core rev: 403dd205828002d6ef4e8b474aedb6082289e22f) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: fix handling of runqemuparamsChen Qi2017-03-271-3/+3
| | | | | | | | | | The launch() doesn't need runqemuparams, we need handle it in start(). (From OE-Core rev: 16400f2b8bffc4cae0263bb597522071299b46ca) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol.py: modify it to test runqemuRobert Yang2017-03-272-13/+28
| | | | | | | | | | | | | | | | | | Modify the following files to test runqemu: targetcontrol.py utils/commands.py utils/qemurunner.py We need simulate how "runqemu" works in command line, so when test "runqemu", the targetcontrol.py, utils/commands.py and utils/qemurunner.py don't have to find the rootfs or set env vars. [YOCTO #10249] (From OE-Core rev: 9305d816bdf8837ea3a407091cb7f24a9a3ae8dc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: configurable timeout for run_serial()Patrick Ohly2017-03-272-10/+15
| | | | | | | | | | | | | | | | | | | Some commands might need to run longer than the default timeout of five seconds. If that occurred, run_serial() returned with a status code of zero (sic!) and no other indication of what went wrong. Now the timeout is configurable (with five still the default) and an explicit warning ("<<< run_serial(): command timed out after 5 seconds without output >>>") gets appended at the end of the data returned to the caller. While at it, the logic for checking for the timeout was updated a bit because both implementations could overshoot the timeout when entering select() right before the final deadline. (From OE-Core rev: accf0362f964cc9d6330b6e52e83d748d890521f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: configure guest networkingEd Bartosh2017-03-221-0/+13
| | | | | | | | | | | | | | Configured guest network interface through serial connection when kernel is not run by qemu. This should make it possible to test wic images with testimage. [YOCTO #10833] (From OE-Core rev: 2032d9be26b539bf867622c0090fb4696209eba9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: get network params from runqemu outputEd Bartosh2017-03-221-14/+22
| | | | | | | | | | | | Parsed runqemu output to get guest network configuration if it's not present in runqemu command line. [YOCTO #10833] (From OE-Core rev: d4d7ed48c1cff1351ddc2f60bcfa153c373a8ab8) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: ignore decode errorsEd Bartosh2017-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu output can contain control characters. This cause qemurunner API to crash when decoding the output to utf-8: Traceback (most recent call last): File "/usr/lib64/python3.4/threading.py", line 911, in _bootstrap_inner self.run() File "meta/lib/oeqa/utils/qemurunner.py", line 472, in run threading.Thread.run(self) File "/usr/lib64/python3.4/threading.py", line 859, in run self._target(*self._args, **self._kwargs) File "meta/lib/oeqa/utils/qemurunner.py", line 465, in threadtarget self.eventloop() File "meta/lib/oeqa/utils/qemurunner.py", line 526, in eventloop self.logfunc(data) File "meta/lib/oeqa/utils/qemurunner.py", line 77, in log msg = msg.decode("utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 0: unexpected end of data Added errors='ignore' to decode call to fix this. (From OE-Core rev: 4a46dd5190d97fdcb6297a0c1d8c824d425c4c51) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* targetcontrol: add image_fstype argument to commands.runqemuEd Bartosh2017-03-081-2/+2
| | | | | | | | | | | | | | | | | | qemu runner picks up first fsimage type from the hard-coded list of supported types. This makes it impossible to test particular image type unless it's not ext4(first type in the hardcoded list of types). Added image_fstypes argument to commands.runqemu and QemuTarget __init__ to specify type of the image to run qemu with. This will be used to pass wic image type to test efi wic images. (From OE-Core rev: f1f224a2d4d3f2a760632c2254e91a8f94c8814f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: add runqemuparams argument to commands.runqemuEd Bartosh2017-03-083-5/+5
| | | | | | | | | | | | | | | Added possibility to pass additional runqemu parameters down the stack of APIs: commands.runqemu -> QemuTarget.start -> QemuRunner.start This will be used to pass ovmf parameter in testing of efi wic images under qemu. (From OE-Core rev: 5aa4b5a10fb8191cd3453d09701c8beeff9a952f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: add output to subprocess exceptionsRoss Burton2017-03-011-0/+19
| | | | | | | | | | | | | Out of the box subprocess.CalledProcessError.__str__() just displays the command and exit code, which isn't very useful for debugging. Add a function to oeqa.utils.subprocesstweak to monkey-patch __str__() so that it can also display the value of stdout and stderr. (From OE-Core rev: c55401ba1646202fa36e4973b05dbacaa146cb16) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: fix typoHumberto Ibarra2017-02-231-2/+2
| | | | | | | | | | | | | The word 'uninstall' was spelled incorrectly in various parts of oeqa files. (From OE-Core rev: af365e025030436f83b233fa51ecc9c58c58ce3c) (From OE-Core rev: 9d25188e873645b849584b51a77b86588a51d4ba) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: remove result file log awkward checkingBenjamin Esquivel2017-02-151-3/+4
| | | | | | | | | | | | | | | | | | | because of the way that the test cases are looked in the results, the file logger is incompatible with extended implementations of the unittest runner. as the xml runner extends the unittest runner, it shares the id() method which returns the full name of the test, not only the test function name. With that, a single check of the full name reviews at the same time the class name as well as the function name. [YOCTO#11012] (From OE-Core rev: 19b025333846018fd3e4ee4ca5cc18d375fa6213) Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.git: support bare reposMarkus Lehtonen2017-02-151-4/+12
| | | | | | | | | | [YOCTO #10582] (From OE-Core rev: a223b4d26c8834485cbec1f10defca42301550f7) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.git: add git_dir propertyMarkus Lehtonen2017-02-151-0/+4
| | | | | | | | | | [YOCTO #10582] (From OE-Core rev: 5fce33644a58b55d0af6c1775e8f65b426eb4dcb) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/buildproject: Run gnu-configize by defaultRichard Purdie2017-02-051-1/+1
| | | | | | | | | | | | The runtime oeqa tests were failing in the on-target case, only for aarch64. This was because an old config.sub was being used. Similar to the SDK testing, call gnu-configize in the on-target case too to resolve the failing tests. (From OE-Core rev: 7918fe08d8e48f46cf2402afa66d35063eb72545) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/oeqa: Replace subprocess.check_call() with check_output()Richard Purdie2017-01-232-3/+3
| | | | | | | | | | If you use subprocess.check_output() the traceback will contain the output when the command fails which is very useful for debugging. There is no good reason not to use this everywhere. (From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: Add package install featureMariano Lopez2017-01-231-13/+33
| | | | | | | | | | | | This allows to use the package install feature with the new OEQA framework. [YOCTO #10234] (From OE-Core rev: 077dc19445574457769eb4f231de97e8059cb75e) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: Add support for package extractionMariano Lopez2017-01-231-0/+161
| | | | | | | | | | | | | testimage support the installation of packages without a package manager in the target. This adds support for package extraction required to support the installation feature. [YOCTO #10234] (From OE-Core rev: 8c7335290cb00ed0683241249297ca573ebd353a) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/dump: Move get_host_dumper to OERuntimeTestContextExecutor classAníbal Limón2017-01-231-9/+2
| | | | | | | | | | | | To avoid getVar calls inside a utils module, also moves get_host_dumper import inside testexport isn't needed. [YOCTO #10231] (From OE-Core rev: f8beaf94e943a8b20d146be47a756af312ef107c) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: {Target,SDK,}BuildProject remove dependency of bbAníbal Limón2017-01-231-24/+7
| | | | | | | | | | | | | | | | | | | Don't use bitbake references inside utils modules, in order todo that changes getVar calls for arguments in the __init__ method like dl_dir for all the classes and testlogdir, builddatetime in SDKBUildProject. Also don't export proxies inside _download_archive method, a good practice is to setup the proxies at init of the process instead of do it in this helper module. [YOCTO #10231] [YOCTO #10599] (From OE-Core rev: 581c34d1efe9839f50ef322761269b4e4d8a56a6) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Move targetbuild to buildproject moduleAníbal Limón2017-01-231-0/+69
| | | | | | | | | | | | | | | | The new buildproject module will contain only BuildProject class a helper class for build source code. The remaining classes TargetBuildProject and SDKBuildProject was move to runtime and sdk respectively. [YOCTO #10599] (From OE-Core rev: 525fd2a5cda00890e921b63f7f608a10bc024d73) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/__init__.py: Adds compatibility with bitbake loggerMariano Lopez2017-01-231-0/+30
| | | | | | | | | | | | | | | | | | | | | | | The bitbake logger changes the way debug is logged and adds different levels within debug, this is passed as argument to the function and breaks compatibility with vanilla loggers. This implements a way to handle this adding a new function for debug, that will dispatch the correct logging method signature. Also overrides info method to use logging.INFO + 1 in order to see plain data. Also this commit fix the issue of not showing the test summary and results when running from bitbake. [YOCTO #10686] (From OE-Core rev: 619c9ab308fbef9e3563dc661e432603e764b562) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner.py: Be sure to stop qemu-systemMariano Lopez2017-01-191-0/+9
| | | | | | | | | | | | | | | When runqemu fails, qemu-system process would keep running and won't be killed, setpgrp() was used when runqemu was a shell script but it seems it doesn't work always with python. This would kill qemu-system explicity and to avoid leaving it behind. (From OE-Core rev: 9d2b1aa1bcfb2f1933a8eeb9470b4174d5da2f0d) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner.py: Add missing sys moduleMariano Lopez2017-01-191-0/+1
| | | | | | | | | | | | | This adds the missing sys module used by the child process to exit. It seems the exception was cached in testimage and selftest. It seems nobody noticed this because the module is only used for sys.exit(). (From OE-Core rev: 66f66d1d763ff7bbaab9e8fcdf7fc882f2dfbb13) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: include BB_NUMBER_THREADS and PARALLEL_MAKEMarkus Lehtonen2017-01-191-1/+1
| | | | | | | | | | | | Inlude values of BB_NUMBER_THREADS and PARALLEL_MAKE in the metadata. [YOCTO #10590] (From OE-Core rev: 97c07a55815c2fc3915705317b6f30d212fa1d45) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: allow storing any bitbake config variablesMarkus Lehtonen2017-01-191-3/+9
| | | | | | | | | | | | | | | | | | | Make it possible to store any bitbake config variables in the metadata. Config values will be stored under a new config element in the xml report: <config> <variable name="MACHINE">qemux86</variable> </config> The value of MACHINE is moved there instead of having a dedicated <machine> element. [YOCTO #10590] (From OE-Core rev: 6e7e6e37664b0a86111272f5f6f4a4e1d0f23302) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: add bitbake revision informationMarkus Lehtonen2017-01-191-13/+19
| | | | | | | | | | [YOCTO #10590] (From OE-Core rev: 71ca7dab08fc500b231054249aacc90ae4aa85da) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: have layer name as an attribute in xmlMarkus Lehtonen2017-01-191-3/+5
| | | | | | | | | | | | | | Have the layer name as an attribute instead of of the name of the element itself. That is, have <layer name="layer_name"/> instead of <layer_name/>. A bit better XML design. [YOCTO #10590] (From OE-Core rev: 50ea44c19005b536a2791113f8b536fd10548ead) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: add commit count informationMarkus Lehtonen2017-01-191-1/+2
| | | | | | | | | | | | Makes it easier to put the commits into a timeline. [YOCTO #10590] (From OE-Core rev: 7757970bced4ecd6503991c0cf11f4d9158f650c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: rename 'revision' to 'commit'Markus Lehtonen2017-01-191-1/+1
| | | | | | | | | | | | | | Revision is a bit vague and could point to a tag, for example. Git commit objects are unambiguous and persistent so be explicit that the element should contain git commit hash. [YOCTO #10590] (From OE-Core rev: a6521b89e86ddba6bd646dd3974d7b0390323b56) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: fix retrieval of git branch and revisionMarkus Lehtonen2017-01-191-3/+5
| | | | | | | | | | | | | | | Always return a valid branch name, or, '(nobranch)' if the current HEAD is detached. Also, always return the hash of the commit object that HEAD is pointing to. Previous code returned an incorrect branch name (or crashed) e.g. in the case of detached HEAD. [YOCTO #10590] (From OE-Core rev: 02d3ba17a8090bd088beb973980651d664f713bb) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: drop 'unknown' git data elementsMarkus Lehtonen2017-01-191-4/+3
| | | | | | | | | | | | | It's better just to not have the xml elements than to have elements with faux data. One could have git branch named 'unknown', for example. [YOCTO #10590] (From OE-Core rev: fce531c21f5e56d0f416b3405a0b0fc5ba567679) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: re-organise distro informationMarkus Lehtonen2017-01-191-7/+10
| | | | | | | | | | | | | Use the same format, based on /etc/os-release, as for host distro information. [YOCTO #10590] (From OE-Core rev: 0156ef46ccf5334ee72f0202f1089249c62af37b) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa.utils.metadata: re-organise host distro informationMarkus Lehtonen2017-01-191-5/+21
| | | | | | | | | | | | | | | | Put all host distro data under one <host_distro> element. In addition take the data directly from /etc/os-release instead of the "lsb API". The /etc/os-release file is virtually ubiquitous, now, and using its field names and values provides a more standardized and extensible format. [YOCTO #10590] (From OE-Core rev: 98cad0b4063772dad94fea96edce1a5422256c32) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands.py: allow use of binaries from native sysrootMaciej Borzecki2016-12-221-1/+8
| | | | | | | | | | | | | | | | Tests may need to run a native tool that is not available on the host filesystem, but can be built using one of the *-native recipes. In such case, the tool will be available in native sysroot, and running in from that location will require adjustments to PATH. runCmd() can now take a path to native sysroot as one of its arguments and setup PATH accordingly. (From OE-Core rev: f2a04631949db72d4261d1c142c5044fad3741f9) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: import git module only when neededEd Bartosh2016-12-201-1/+1
| | | | | | | | | | | | | | | | | git module is not included into standard Python library and therefore causes import errors on the systems where PythonGit is not installed. As git module only used in the code implementing --repository functionality it's better to import git only in the scope that requires it. [YOCTO #10821] (From OE-Core rev: 66be32c1a075201d6ee0e9b9e10b84e6a2ace745) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-165-20/+20
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands.py: Fix get_bb_vars() when called without argumentsMariano Lopez2016-12-141-1/+2
| | | | | | | | | | Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling get_bb_vars() when called without arguments. This fix this issue. (From OE-Core rev: 91f856426c7523e1ebdf6d6f93f5fa7e509d6e49) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: use tinfoil.parse_recipe()Paul Eggleton2016-12-141-3/+1
| | | | | | | | | | | Use tinfoil.parse_recipe() in order to allow oe-selftest to be used in memres mode. (From OE-Core rev: 499ee9006271112f22cfe08fa5ba5c21be95380b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: make tinfoil quiet when using to start QEMUPaul Eggleton2016-12-141-1/+1
| | | | | | | | | | | We don't need to see the parsing/cache loading message in the oe-selftest output, so use the newly added quiet option to disable it. (From OE-Core rev: c023bc55ff000d1de891d1a8e2a163e94bf63de6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/metadata.py: Add metadata libraryMariano Lopez2016-12-131-0/+83
| | | | | | | | | | | | Adds functions to get metadata from the host running the tests. [YOCTO #9954] (From OE-Core rev: 10b05794254886e55c76f29f7778d783c550befa) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands.py: Make a copy of variables in get_bb_varsMariano Lopez2016-12-131-0/+1
| | | | | | | | | | | | | | | The function get_bb_vars will remove items for the list passed as the function argument, this will leave the caller with an empty list and the function never says it will consume the items. This hasn't been found before because only get_bb_var uses this function. (From OE-Core rev: 22b7fa24fefcc3974806d1b282c93b8c5880f6a4) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sshcontrol: Handle interrupted system call errorRichard Purdie2016-10-071-11/+13
| | | | | | | | | | | | Deal with an interrupted system call gracefully: | File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/sshcontrol.py", line 55, in _run | if select.select([self.process.stdout], [], [], 5)[0] != []: | InterruptedError: [Errno 4] Interrupted system call (From OE-Core rev: 556125e4004fb7ac5169b59f51dc151f18c1806a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>