]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agotoaster: fix local imports
Ed Bartosh [Tue, 10 May 2016 12:17:26 +0000 (15:17 +0300)] 
toaster: fix local imports

Replaced local imports with absolute imports.
Used .module for local imports.

This should make the code to work on python 2 and python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix imports to work for python 3
Ed Bartosh [Tue, 10 May 2016 11:35:55 +0000 (14:35 +0300)] 
toaster: fix imports to work for python 3

Some APIs have been moved to other modules in python 3:
 getstatusoutput: moved from commands to subproces
 urlopen: moved from urllib2 to urllib.request
 urlparse: moved from urlparse to urllib.parse

Made the imports work for both python versions by
catching ImportError and importing APIs from different
modules.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: get rid of using reduce
Ed Bartosh [Tue, 10 May 2016 08:39:04 +0000 (11:39 +0300)] 
toaster: get rid of using reduce

Replaced compicated calls of reduce with more clear code.
As reduce was removed from python 3 this change is mandatory
for the code to work on both pythons.

Here is an example change for illustration purposes:

original code:

  querydict = dict(zip(or_keys, or_values))
  query = reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict])))

replaced with:

  query = None
  for key, val in zip(or_keys, or_values):
      x = __get_q_for_val(k, val)
      query = query | x if query else x

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use force_text instead of force_bytes
Ed Bartosh [Tue, 10 May 2016 08:04:49 +0000 (11:04 +0300)] 
toaster: use force_text instead of force_bytes

Usage of force_bytes in BuildRequest.__str__ method caused
python 3 to throw "__str__ returned non-string (type bytes)"
error.

Replaced force_bytes with force_text to make the code working
on both python 2 and python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agogoggle/image-writer: Drop since bitrotting and no longer used
Richard Purdie [Fri, 13 May 2016 13:11:02 +0000 (14:11 +0100)] 
goggle/image-writer: Drop since bitrotting and no longer used

The upgrade to python3 is the final nail in the coffin for image-writer
and the goggle UI. Neither seem used or recieve patches and are based
on old versions of GTK+ so drop them, and the remaining crumbs support
pieces.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoimage-writer/goggle: Disable pygtkcompat problems
Richard Purdie [Fri, 13 May 2016 11:56:51 +0000 (12:56 +0100)] 
image-writer/goggle: Disable pygtkcompat problems

Disable the problematic gtk usage for use with pygtkcompat. The following
commit removes these tools/UIs entirely but we may as well leave this
piece in the history in case anyone does want a starting point for reusing
them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb: Set required python 3 version to 3.4.0
Jeremy Puhlman [Thu, 12 May 2016 22:32:05 +0000 (15:32 -0700)] 
lib/bb: Set required python 3 version to 3.4.0

get_context was added to mutliprocessing as part of 3.4.0

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart: Simplify ExpansionError exception
Richard Purdie [Thu, 12 May 2016 07:22:52 +0000 (08:22 +0100)] 
data_smart: Simplify ExpansionError exception

This seemingly convoluted syntax doesn't work in python3. Instead
use the chained exception handling syntax which appears to make more
sense here.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Convert to python 3
Richard Purdie [Thu, 12 May 2016 07:30:35 +0000 (08:30 +0100)] 
bitbake: Convert to python 3

Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Drop futures usage since we're python 3
Richard Purdie [Thu, 12 May 2016 07:22:18 +0000 (08:22 +0100)] 
bitbake: Drop futures usage since we're python 3

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake/pyinotify.py: Upgrade to py3 version
Richard Purdie [Fri, 6 May 2016 08:07:37 +0000 (09:07 +0100)] 
bitbake/pyinotify.py: Upgrade to py3 version

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake/bs4: Upgrade 4.3.2 -> 4.4.1 (python 3 version)
Richard Purdie [Fri, 6 May 2016 08:06:51 +0000 (09:06 +0100)] 
bitbake/bs4: Upgrade 4.3.2 -> 4.4.1 (python 3 version)

Upgrade to 4.4.1 which has been run through 2to3 as per the maintainers
recommendation for v3 use.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoclasses/base.bbclass: Fix missing getVarFlag parameter
Richard Purdie [Tue, 24 May 2016 14:54:38 +0000 (15:54 +0100)] 
classes/base.bbclass: Fix missing getVarFlag parameter

[YOCTO #9603]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Fix parse progress for python3
Richard Purdie [Fri, 20 May 2016 11:48:02 +0000 (12:48 +0100)] 
cooker: Fix parse progress for python3

Under python the type conversions can mean there are float values
used for triggering the parse progress events which then fails.
Add an explict int() conversion to ensure the parse events are
generated under python3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests builds Add SSTATE_MISS as a valid condition for tc=833
Michael Wood [Thu, 19 May 2016 12:59:33 +0000 (13:59 +0100)] 
toaster: tests builds Add SSTATE_MISS as a valid condition for tc=833

Task.SSTATE_NA and Task.SSTATE_MISS are both valid conditions for the
condition that a Task.OUTCOME_COVERED and Task.OUTCOME_PREBUILT.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests build Add a test for a build of core-image-minimal
Michael Wood [Thu, 19 May 2016 12:59:32 +0000 (13:59 +0100)] 
toaster: tests build Add a test for a build of core-image-minimal

This is a port of the oe self test to the django test framework from
oe-core meta/lib/oeqa/selftest/_toaster.py

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests Add a BuildTest helper class
Michael Wood [Thu, 19 May 2016 12:59:31 +0000 (13:59 +0100)] 
toaster: tests Add a BuildTest helper class

Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Add a specific test settings file
Michael Wood [Thu, 19 May 2016 12:59:30 +0000 (13:59 +0100)] 
toaster: Add a specific test settings file

When running certain tests we want a particular database specified.
When bitbake toaster ui is being tested pass it these test settings so
that it uses the same database as the unit tests running.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: runbuilds move the execution sequence out of the poll loop
Michael Wood [Thu, 19 May 2016 12:59:29 +0000 (13:59 +0100)] 
toaster: runbuilds move the execution sequence out of the poll loop

Move the execution sequence for a build out of the polling loop and into
it's own fuction. This means that we can call the function on it's own
if we just want to trigger one build rather than infinite polling.
This is something needed for the build tests.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Remove DATABASE_URL being passed around as an environment var
Michael Wood [Thu, 19 May 2016 12:59:28 +0000 (13:59 +0100)] 
toaster: Remove DATABASE_URL being passed around as an environment var

We don't need to pass the DATABASE_URL around and read it back if we
setup the django framework in the correct way.
We make the default sqlite database path a full path so that the
database isn't being assumed to be in CWD.

Also add some more useful comments on the database settings.

This is preparation work to migrate the build tests and be able to
trigger builds on differently configured databases.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: tests for project config
Sujith H [Thu, 19 May 2016 10:43:32 +0000 (11:43 +0100)] 
toaster-tests: tests for project config

Add basic tests to validate the value user types
in the text box for IMAGEFS_TYPES. Added a test
case to show the checkbox get automatically selected
when user types value available in the check list.
Added a test case to verify if the check box is enabled
then the text box should also get updated accordingly.

[YOCTO #7828]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: projectconf Small tweaks to IMAGE_FSTYPES form
Belen Barros Pena [Thu, 19 May 2016 10:43:31 +0000 (11:43 +0100)] 
toaster: projectconf Small tweaks to IMAGE_FSTYPES form

Add a label to clarify the purpose of the first input field, replace <p>
with <label> for the second set of controls, and give some top margin to
the validation message.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: handle multiple imagefs types
Sujith H [Thu, 19 May 2016 10:43:30 +0000 (11:43 +0100)] 
toaster: handle multiple imagefs types

This functionality helps users to add custom
image fs types available other than the checkboxes
in the UI. User can add imagefs types in the text
box and use them in the build.

[YOCTO #7828]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Improve taskgraph file handling
Richard Purdie [Thu, 19 May 2016 14:16:11 +0000 (15:16 +0100)] 
cooker: Improve taskgraph file handling

Use open() instead of file() and close files when finished with them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Increase cache version after code parser dependency changes
Richard Purdie [Wed, 18 May 2016 22:20:42 +0000 (23:20 +0100)] 
codeparser: Increase cache version after code parser dependency changes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.codeparser: track variable flag references
Christopher Larson [Sat, 30 Apr 2016 19:52:45 +0000 (12:52 -0700)] 
bb.codeparser: track variable flag references

Previously we only tracked the flags (minus excluded) of variables we depend
on, but not the flags we use explicitly.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoProvide LAYERDIR_RE for layer.conf
Christopher Larson [Sat, 30 Apr 2016 19:52:49 +0000 (12:52 -0700)] 
Provide LAYERDIR_RE for layer.conf

This variable is a regex-escaped version of LAYERDIR, for safer use in
BBFILE_PATTERN, so as to avoid issues with regex special characters in the
layer path.

[YOCTO #8402]

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Increase cache version after task checksum calculation changes
Richard Purdie [Wed, 18 May 2016 22:20:21 +0000 (23:20 +0100)] 
cache: Increase cache version after task checksum calculation changes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoImplement support for per-task exports
Christopher Larson [Sat, 30 Apr 2016 19:52:48 +0000 (12:52 -0700)] 
Implement support for per-task exports

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.cooker: show limited traceback for parsing ExpansionError
Christopher Larson [Sat, 30 Apr 2016 19:52:46 +0000 (12:52 -0700)] 
bb.cooker: show limited traceback for parsing ExpansionError

It's useful to see tracebacks for ExpansionErrors, but only if we skip the
leading bitbake-internal elements, otherwise we see elements of the expansion
process.

As one example:

Before:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

After:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
    Traceback (most recent call last):
      File "PV[:=]", line 1, in <module>
      File "/scratch/yocto-new/external-as-needed/meta-sourcery/recipes-external/glibc/glibc-external-version.inc", line 3, in get_external_libc_version(d=<bb.data_smart.DataSmart
    object at 0x7f05d2566950>):
             sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so')
        >    found_paths = oe.external.find_sysroot_files([sopattern], d)
             if found_paths:
    ExpansionError: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-layers: convert to plugin-based
Christopher Larson [Sat, 30 Apr 2016 19:41:00 +0000 (12:41 -0700)] 
bitbake-layers: convert to plugin-based

This uses bb.utils.load_plugins, based on the plugin handling in recipetool
and devtool in oe-core.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Fix output buffering issues
Richard Purdie [Mon, 16 May 2016 21:52:00 +0000 (22:52 +0100)] 
knotty: Fix output buffering issues

We need to flush the footer removal, else it may not be outputted until
the buffer is flushed as part of StreamHandler and this would lead to
it removing the ERROR output just printed which is extremely confusing.

Also ensure the footer is cleared before printing a summary as in
some cases it wasn't being removed, also leading to user confusion.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: Fixes to handle sigdata/siginfo files only containing basehash data
Richard Purdie [Mon, 16 May 2016 21:51:08 +0000 (22:51 +0100)] 
siggen: Fixes to handle sigdata/siginfo files only containing basehash data

The signature data file comparison functions are meant to be able to
handle data files containing just the base hash data. This had regressed
in some places so add fixes to allow these comparisons to be made. The
runtime components in the data files are optional.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: don't show "Rebuild" button for cancelled cli builds
Elliot Smith [Thu, 12 May 2016 14:10:38 +0000 (15:10 +0100)] 
toaster: don't show "Rebuild" button for cancelled cli builds

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui: capture keyboard interrupts the same way as knotty
Elliot Smith [Thu, 12 May 2016 14:10:37 +0000 (15:10 +0100)] 
toasterui: capture keyboard interrupts the same way as knotty

knotty captures two levels of keyboard interrupt: a single interrupt
or two interrupts in a row. These then trigger stateShutdown
and stateForceShutdown respectively.

toasterui doesn't have an equivalent way of capturing interrupts and
using them to shut down bitbake. Now that we are no longer using
knotty + XMLRPCServer for our command line builds (since switching to
per-project build directories), we see some odd side effects of this,
such as builds continuing after they have been interrupted on the
command line.

Bring toasterui in line with knotty (copy-paste most of the code
in knotty.py which deals with interrupts) so that a keyboard
interrupt actually shuts down the bitbake server (if not in
observe only mode).

Additionally use the cancel_cli_build() method to set the Build
status to CANCELLED in Toaster's db when we get keyboard interrupts.
This means that builds interrupted on the command line show as
cancelled (same as if they'd been cancelled from the Toaster UI),
as specified in the UI designs.

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: add method to set current build as CANCELLED
Elliot Smith [Thu, 12 May 2016 14:10:36 +0000 (15:10 +0100)] 
buildinfohelper: add method to set current build as CANCELLED

This will be used from toasterui to cancel the current command-line
build when a keyboard interrupt is captured.

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toastergui tests Fix toastertable tests
Michael Wood [Mon, 16 May 2016 13:50:41 +0000 (14:50 +0100)] 
toaster: toastergui tests Fix toastertable tests

After clean ups remove api assumptions. Our table data often contains
html snippets to display certain things such as dependency pop overs or
simply links to other parts of the UI. Take these into account when
testing the values of the table data.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toastertables: Clean up and fix up a number of items
Michael Wood [Mon, 16 May 2016 13:50:40 +0000 (14:50 +0100)] 
toaster: toastertables: Clean up and fix up a number of items

 - Remove the unused 'computation' field
 - Remove the code to try to make the tables behave like an api
 - Remove custom JSON encoder in favour of DjangoJSONEncoder
 - Simplify get_data and add comments
 - Add exception type instead of using generic Exception
 - Clean up python style warnings

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use new syntax of except statement
Ed Bartosh [Tue, 10 May 2016 14:10:30 +0000 (17:10 +0300)] 
toaster: use new syntax of except statement

Used except 'except (<exception1>, <exception2>):' syntax as it's
supported by python 2 and pythone 3.

Old syntax 'except <exception1>, <exception2>:' is not supported
by python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use print function in toaster script
Ed Bartosh [Tue, 10 May 2016 08:31:14 +0000 (11:31 +0300)] 
toaster: use print function in toaster script

Used print() function instead of print statement
to make toaster script to work with both python 2 and python 3

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use 'in' instead of has_key
Ed Bartosh [Tue, 10 May 2016 13:27:19 +0000 (16:27 +0300)] 
toaster: use 'in' instead of has_key

Dictionary method has_key is deprecated in python 2 and absent
in python 3.

Used '<key> in <dict>' statement to make the code working on
both python 2 and python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoserver/process: Fix missing log messages issue
Richard Purdie [Thu, 12 May 2016 22:27:25 +0000 (23:27 +0100)] 
server/process: Fix missing log messages issue

Currently if the server dies, its possible that log messages are never
displayed which is particularly problematic if one of those messages
is the exception and backtrace the server died with.

Rather than having the event queue exit as soon as the server disappears,
we should pop events from the queue until its empty before exiting.

This patch tweaks that code so that even if the server is dead and we're
going to exit, we return any events left in the pipe. This makes
debugging certain failures much easier.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker/toasterui: Drop SEND_DEPENDS_TREE UI feature
Richard Purdie [Fri, 13 May 2016 13:02:56 +0000 (14:02 +0100)] 
cooker/toasterui: Drop SEND_DEPENDS_TREE UI feature

Now the event is sent unconditionally we can drop this feature
as its no longer needed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue.py: always emit bb.event.DepTreeGenerated
Patrick Ohly [Thu, 12 May 2016 15:00:10 +0000 (17:00 +0200)] 
runqueue.py: always emit bb.event.DepTreeGenerated

The data included in the event is useful for implementing a pre-build
check that warns about unexpected components, for example because of
an incorrect configuration or changed dependencies.

Such a check can be done in a .bbclass that gets inherited
globally. But in contrast to a UI, such a class cannot request that
the event shall be emitted, and thus the event has to be emitted
whether there is a consumer or not.

This was done conditionally earlier out of concerns about the
performance impact. But now events are handled more efficiently, so
that concern no longer seems valid: in some simple testing (admittedly
on a fast build workstation), the two lines (generating the data and
emitting the event with it) only took about 0.05 seconds (measured
with timeit). That was for a build with roughly 500 recipes (from
pn-buildlist aka depgraph['pn']), triggered via the command line. That
was even with a consumer of the data active and doing some work, so it
should be even faster when there is no consumer.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix progress bar in MySQL environment
Elliot Smith [Fri, 13 May 2016 16:02:58 +0000 (17:02 +0100)] 
toaster: fix progress bar in MySQL environment

When using MySQL, the project builds info delivered by MySQL
differs from that delivered by SQLite: the former returns text
values from the enumeration for Build outcomes, while the latter
returns the integer value. This causes the progress bar JS to
break, as it is expecting outcome strings.

Modify the recent_build() method to include an outcomeText property
for each Build object, then use this in the conditionals in the
progress bar JS.

[YOCTO #9498]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: Ensure exceptions are correctly displayed
Richard Purdie [Thu, 12 May 2016 07:15:34 +0000 (08:15 +0100)] 
main: Ensure exceptions are correctly displayed

If the cooker fails to start, ensure a correct exception is displayed to the
user. After handling any queued events simply re-raise the original exception
else the output can be unclear.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata: Fix log messages and ensure we exit
Richard Purdie [Thu, 12 May 2016 07:13:04 +0000 (08:13 +0100)] 
cookerdata: Fix log messages and ensure we exit

The string formatting wasn't correct and we should exit if we hit
errors here similar to the other exception handlers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoevent/msg: Pass formatted exceptions
Richard Purdie [Thu, 12 May 2016 07:05:32 +0000 (08:05 +0100)] 
event/msg: Pass formatted exceptions

python3 can't cope with the previous approach we were using to pass
exceptions through the RPC. Avoid this by creating a formatted exception
on the sender side.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch: Use OrderedDict for url parameters
Richard Purdie [Thu, 12 May 2016 07:04:17 +0000 (08:04 +0100)] 
fetch: Use OrderedDict for url parameters

Without this, the dict can reorder causing sanity test failures.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: Change warn() -> warning()
Richard Purdie [Thu, 12 May 2016 07:02:45 +0000 (08:02 +0100)] 
main: Change warn() -> warning()

This avoids a deprecation warning in python 3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Fix log message syntax
Richard Purdie [Thu, 12 May 2016 07:01:23 +0000 (08:01 +0100)] 
cooker: Fix log message syntax

Ensure we pass the string parameter correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoutils: Force bitbake to en_US.UTF-8 locale setting everywhere
Richard Purdie [Wed, 11 May 2016 22:00:15 +0000 (23:00 +0100)] 
utils: Force bitbake to en_US.UTF-8 locale setting everywhere

Under python 3, if we spawn python processes, we need to have a UTF-8
locale, else python's file access methods will use ascii. You can't
change that mode once the interpreter is started so we have to ensure
a locale is set. Ideally we'd use C.UTF-8 since OE already forces the
C locale but not all distros support that and we need to set something.
Was tempted to choose en_GB so colour gets spelt correctly :).

This is in some ways pretty nasty, forcing it into the environment
everywhere however we only have a limited number of ways of making
everything work correctly and this beats having to add utf-8 encoding
to every file access command.

A similar change will be needed to bitbake.conf in OE.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobin/bitbake-worker: Fix invalid bb.msg.fatal usage
Richard Purdie [Wed, 11 May 2016 21:57:10 +0000 (22:57 +0100)] 
bin/bitbake-worker: Fix invalid bb.msg.fatal usage

The logging domain specified to bb.msg.fatal was invalid. Replace with
a logger.critical() call instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocontrib/dump_cache.py, cache: Fix to use python 3 syntax
Richard Purdie [Wed, 11 May 2016 21:56:29 +0000 (22:56 +0100)] 
contrib/dump_cache.py, cache: Fix to use python 3 syntax

Some tweaks to use python 3 syntax in a python 2 compatible way.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Ensure consolelog file handle is closed
Richard Purdie [Wed, 11 May 2016 21:55:53 +0000 (22:55 +0100)] 
knotty: Ensure consolelog file handle is closed

If we don't close the console log file handle, python prints a warning
about unclosed file handles upon exit which is annoying.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Improve timestamp comparisons
Richard Purdie [Wed, 11 May 2016 21:55:14 +0000 (22:55 +0100)] 
runqueue: Improve timestamp comparisons

python3 cares more about invalid type comparisons. Add break statements
and better tests to make the code paths clearer and avoid type issues
in python3. No code functionality change.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodaemonize/prserv/tests/fetch: Convert file() -> open()
Richard Purdie [Wed, 11 May 2016 21:54:22 +0000 (22:54 +0100)] 
daemonize/prserv/tests/fetch: Convert file() -> open()

Use python3 compatible functions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests browser Add test for creating a project
Michael Wood [Mon, 9 May 2016 23:01:52 +0000 (00:01 +0100)] 
toaster: tests browser Add test for creating a project

Add browser tests for creating a project and test validation of
duplicate project names.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: models Add missing import sys
Michael Wood [Mon, 9 May 2016 23:01:51 +0000 (00:01 +0100)] 
toaster: models Add missing import sys

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ui handles duplicate project name in project page
Sujith H [Mon, 9 May 2016 23:01:50 +0000 (00:01 +0100)] 
toaster: ui handles duplicate project name in project page

When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name. When an existing project is typed the save
button will be disabled. Else user can proceed ahead by
modifying the project name.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ui handles duplicate project name in new project page
Sujith H [Mon, 9 May 2016 23:01:49 +0000 (00:01 +0100)] 
toaster: ui handles duplicate project name in new project page

When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: projectNameValidation API added
Sujith H [Mon, 9 May 2016 23:01:48 +0000 (00:01 +0100)] 
toaster: projectNameValidation API added

The projectNameValidation API would help users
to validate if a project name exists or not. This
API is added to libtoaster.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Fix missing fakeworker under dry run
Richard Purdie [Mon, 9 May 2016 13:15:26 +0000 (14:15 +0100)] 
runqueue: Fix missing fakeworker under dry run

We shouldn't try and use fakeworker when performing a dry_run. This
makes the core match the other fakeworker execution points.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils.py: Fix explode_dep_versions2() determinism issue
Richard Purdie [Mon, 9 May 2016 13:07:17 +0000 (14:07 +0100)] 
lib/bb/utils.py: Fix explode_dep_versions2() determinism issue

When we pass data into explode_dep_versions2(), we need to result to be
able to be processed in a deterministic way so that we end up with
consistent hash values. This means we need an ordered structure rather
than an unordered one.

To do this, return an OrderedDict() rather than a dict().

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobin, toaster: Fix print and exception syntax
Richard Purdie [Mon, 9 May 2016 13:05:09 +0000 (14:05 +0100)] 
bin, toaster: Fix print and exception syntax

This updates the print "" syntax to print() and fixes some exception
handling syntax such that its compatible with python v2 and v3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotests: assertEquals -> assertEqual
Richard Purdie [Mon, 9 May 2016 13:03:41 +0000 (14:03 +0100)] 
tests: assertEquals -> assertEqual

The preferred form is assertEqual, assertEquals is deprecated and
not present in python v3.

This is v2.7 safe.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Update logger.warn() -> logger.warning()
Richard Purdie [Mon, 9 May 2016 13:01:12 +0000 (14:01 +0100)] 
bitbake: Update logger.warn() -> logger.warning()

python deprecated logger.warn() in favour of logger.warning(). This is only
used in bitbake code so we may as well just translate everything to avoid
warnings under python 3. Its safe for python 2.7.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.{cooker, data}: only emit a var as python if 'func' is set
Christopher Larson [Sat, 30 Apr 2016 20:10:34 +0000 (13:10 -0700)] 
bb.{cooker, data}: only emit a var as python if 'func' is set

This avoids a common issue where PACKAGECONFIG is emitted as a function in
bitbake -e when the 'python' flag exists. It isn't a python function unless
both 'func' and 'python' are set. This aligns with the behavior of
emit_func_python.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: let loaded plugins provide a plugin object
Christopher Larson [Sat, 30 Apr 2016 19:40:59 +0000 (12:40 -0700)] 
bb.utils: let loaded plugins provide a plugin object

This lets us avoid treating the module like an object, so no globals are
needed, if one chooses to do so.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: use imp.get_suffixes for load_plugins
Christopher Larson [Sat, 30 Apr 2016 19:40:58 +0000 (12:40 -0700)] 
bb.utils: use imp.get_suffixes for load_plugins

Rather than hardcoding .py, use python's knowledge of its file extensions.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: add load_plugins from scriptutils
Christopher Larson [Sat, 30 Apr 2016 19:40:57 +0000 (12:40 -0700)] 
bb.utils: add load_plugins from scriptutils

Imported as of oe-core 184a256.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.data_smart: use iter() for __len__
Christopher Larson [Sat, 30 Apr 2016 19:43:54 +0000 (12:43 -0700)] 
bb.data_smart: use iter() for __len__

It seems the frozenset constructor in pypy runs len(), so we can't pass the
DataSmart instance directly to it, instead pass the iterator. Fixes pypy
support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.event: handle __builtins__ as a module
Christopher Larson [Sat, 30 Apr 2016 19:43:53 +0000 (12:43 -0700)] 
bb.event: handle __builtins__ as a module

Fixes pypy support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.build: handle __builtins__ as a module
Christopher Larson [Sat, 30 Apr 2016 19:43:52 +0000 (12:43 -0700)] 
bb.build: handle __builtins__ as a module

Fixes pypy support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: fetch2: Safer check for BB_ORIGENV datastore
Leonardo Sandoval [Tue, 3 May 2016 19:55:48 +0000 (14:55 -0500)] 
bitbake: fetch2: Safer check for BB_ORIGENV datastore

BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError
exception when calling the getVar method. To avoid this, a check is done before
accesing it.

[YOCTO #9567]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Fix noweb command
Michael Wood [Thu, 21 Apr 2016 13:22:06 +0000 (14:22 +0100)] 
toaster: bin/toaster Fix noweb command

For the noweb command we don't need to check if a socket is in use or
not as we're not starting the django development server. We're just
setting up the environment and running the runbuilds scheduler.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Add ability to specify port and address to bind to
Michael Wood [Thu, 21 Apr 2016 13:22:05 +0000 (14:22 +0100)] 
toaster: bin/toaster Add ability to specify port and address to bind to

Allow binding to a specified address and port to start the django
development server on.
Remove the assumption that you want to bind to 0.0.0.0 and set the
default to localhost.
Add some additional help text after Toaster webserver has started

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Add help text for unrecognised command
Michael Wood [Thu, 21 Apr 2016 13:22:04 +0000 (14:22 +0100)] 
toaster: bin/toaster Add help text for unrecognised command

Add help text for unrecognised or missing command for toaster script
Remove assumption that no command is 'start' as the default.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitake: main: fix line-too-long pytling warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:29 +0000 (11:16 +0300)] 
bitake: main: fix line-too-long pytling warnings

Wrapped long lines to fix "Line too long" pylint warnings.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: fix bad-continuation warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:28 +0000 (11:16 +0300)] 
bitbake: main: fix bad-continuation warnings

Fixed pylint warning 'Wrong continued indentation'.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: fix bad-witespace pylint warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:27 +0000 (11:16 +0300)] 
bitbake: main: fix bad-witespace pylint warnings

Fixed pylint warnings:
 No space allowed around keyword argument assignment
 No space allowed after bracket
 No space allowed before bracket

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: set defaults from env variables
Ed Bartosh [Wed, 20 Apr 2016 07:31:29 +0000 (10:31 +0300)] 
bitbake: main: set defaults from env variables

Environment variables BBSERVER, BBTOKEN and BBEVENTLOG silently
overwrite bitbake command line arguments. This is confusing and
can cause issues that are difficult to debug. It's better to use
them as default values instead.

Used environment variables BBSERVER, BBTOKEN and BBEVENTLOG to set
default values for command line arguments.

Changed setting default value of --ui command line argument from
BITBAKE_UI to look similar way.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: add 2 environment variables
Ed Bartosh [Wed, 20 Apr 2016 07:31:28 +0000 (10:31 +0300)] 
bitbake: main: add 2 environment variables

Bitbake uses set of environment variables to set command line
options, e.g. seeting BBTOKEN variable has the same effect
as using --token command line option.

Added new environment variables BBPRECONF and BBPOSTCONF that
are equivalents of --read and --postread command line options.
They can be used by high level scripts to append or prepend
configuration files to conf/local.conf

[YOCTO #9235]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: customrecipe Only show download icon or button if it's possible
Michael Wood [Tue, 26 Apr 2016 16:18:07 +0000 (17:18 +0100)] 
toaster: customrecipe Only show download icon or button if it's possible

If the based on recipe has not yet been checked out/cloned we cannot
generate the custom image recipe file that uses it. So disable/remove
the option to download it.

[YOCTO #9425]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: orm Add get_base_recipe_file to CustomImageRecipe
Michael Wood [Tue, 26 Apr 2016 16:18:06 +0000 (17:18 +0100)] 
toaster: orm Add get_base_recipe_file to CustomImageRecipe

This function returns the base recipe file path only if it currently
exists. This allows us to know whether we can proceed at this point with
generating a custom image recipe. It also enables us to call this
function from the templates to enable visual indication of this state.

Some whitespace fixes also added in generate_recipe_file_contents

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Switch to post release version
Richard Purdie [Fri, 29 Apr 2016 06:41:34 +0000 (07:41 +0100)] 
bitbake: Switch to post release version

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication agents
Ross Burton [Fri, 22 Apr 2016 15:56:50 +0000 (16:56 +0100)] 
fetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication agents

Some users may want to use authenticated SSH connections with credentials stored
in a keyring, such as gnome-keyring.  These typically need a DBus session bus
connection, so pass DBUS_SESSION_BUS_ADDRESS into the fetcher environment.

To avoid the user needing to set it in their local.conf (which wouldn't be
usable) or adding it to the environment-cleansing whitelist (which would
potentially impact builds) allow the variables being passed to the fetchers to
come from the data store (first) or the original environment (second).

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: tests for build dashboard
Elliot Smith [Tue, 19 Apr 2016 16:28:47 +0000 (17:28 +0100)] 
toaster-tests: tests for build dashboard

Convert existing tests to Selenium.

Add basic tests to check that the modal contains radio buttons to select
a custom image to edit when a build built multiple custom images, and
to create a new custom image from one of the images built during
the build.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add modal to select custom image for editing
Elliot Smith [Tue, 19 Apr 2016 16:28:46 +0000 (17:28 +0100)] 
toaster: add modal to select custom image for editing

Add functionality to the placeholder button on the build dashboard
to open a modal dialog displaying editable custom images, in cases
where multiple custom images were built by the build. Where there
is only one editable custom image, go direct to its edit page.

The images shown in the modal are custom recipes for the project
which were built during the build shown in the dashboard.

This also affects the new custom image dialog, as that also has
to show custom image recipes as well as image recipes built during
the build. Modify the API on the Build object to support both.

Also modify and rename the queryset_to_list template filter so that
it can deal with lists as well as querysets, as the new custom image
modal has to show a list of image recipes which is an amalgam of two
querysets.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add build dashboard buttons to edit/create custom images
Elliot Smith [Tue, 19 Apr 2016 16:28:45 +0000 (17:28 +0100)] 
toaster: add build dashboard buttons to edit/create custom images

When a build is viewed in the dashboard, enable users to edit
a custom image which was built during that build, and/or create
a new custom image based on one of the image recipes built during
the build.

Add methods to the Build model to enable querying for the
set of image recipes built during a build.

Add buttons to the dashboard, with the "Edit custom image"
button opening a basic modal for now. The "New custom image"
button opens the existing new custom image modal, but is modified
to show a list of images available as a base for a new custom image.

Add a new function to the new custom image modal's script which
enables multiple potential custom images to be shown as radio
buttons in the dialog (if there is more than 1). Modify existing
code to use this new function.

Add a template filter which allows the queryset of recipes for
a build to be available to client-side scripts, and from there
be used to populate the new custom image modal.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: make helper click on input before entering text
Elliot Smith [Tue, 19 Apr 2016 16:28:44 +0000 (17:28 +0100)] 
toaster-tests: make helper click on input before entering text

The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.

Prefix all text entry with a click() on the element to ensure
that keyup events fire.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: add tests for new custom image page
Elliot Smith [Tue, 19 Apr 2016 16:28:43 +0000 (17:28 +0100)] 
toaster-tests: add tests for new custom image page

Test adding a new custom image when:

1. No custom images are in the project yet.
2. User tries to add custom image which duplicates the name of
an existing custom image.
3. User tries to add custom image which duplicates the name
of a non-image recipe.

[YOCTO #9209]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: prevent exception when Project.release is null
Elliot Smith [Tue, 19 Apr 2016 16:28:42 +0000 (17:28 +0100)] 
toaster: prevent exception when Project.release is null

Project.release can be null. This causes an exception when calling
get_all_compatible_layer_versions(), as the query to fetch
the layer versions references release.branch_name.

Add a guard to the function so that an empty queryset is returned
if the release isn't set for a project.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: only prevent duplicate custom image names within a project
Elliot Smith [Tue, 19 Apr 2016 16:28:41 +0000 (17:28 +0100)] 
toaster: only prevent duplicate custom image names within a project

We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.

Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.

[YOCTO #9209]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: disable/enable "Add layer" button according to input's content
Elliot Smith [Tue, 19 Apr 2016 16:28:40 +0000 (17:28 +0100)] 
toaster: disable/enable "Add layer" button according to input's content

In the import layer page, the "Add layer" button in the layer dependencies
section doesn't accurately reflect whether the layer name in the
corresponding input can be added. A partial or empty layer name can
leave the button active, such that when it is clicked, a
previously-selected layer can be accidentally added.

Fix by keeping track of the items currently available in the typeahead,
only activating the "Add layer" button when the input matches the name
of one of those items.

[YOCTO #8511]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix sorting after hiding a column in build tables
Elliot Smith [Tue, 19 Apr 2016 16:28:39 +0000 (17:28 +0100)] 
toaster: fix sorting after hiding a column in build tables

When hiding a column in the build tasks or build packages included
table, if the column is set as the current order by for the table, the
order by is not reset to the default. The result is that the table
stays sorted by the hidden column.

Set the default_orderby for these two tables correctly to ensure the
corresponding table is re-sorted when a column is hidden, if that column
was being used as the order by.

[YOCTO #9011]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ensure ToasterTable headings are reset when order by changes
Michael Wood [Tue, 19 Apr 2016 16:28:38 +0000 (17:28 +0100)] 
toaster: ensure ToasterTable headings are reset when order by changes

If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.

Store the default order by and re-apply it when the data is updated.

[YOCTO #9011]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: fix processing of BBEVENTLOG
Ed Bartosh [Tue, 19 Apr 2016 13:54:39 +0000 (16:54 +0300)] 
main: fix processing of BBEVENTLOG

Fixed typo that caused incorrect processing of BBEVENTLOG
environment variable. Even if variable is set it was ignored
by bitbake.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: add docstring for contains()
Ross Burton [Tue, 5 Apr 2016 14:46:41 +0000 (15:46 +0100)] 
lib/bb/utils: add docstring for contains()

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Updated the 'bitbake -h' output example.
Scott Rifenbark [Fri, 15 Apr 2016 16:20:19 +0000 (09:20 -0700)] 
bitbake-user-manual: Updated the 'bitbake -h' output example.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>