toaster: toaster oe-selftest support

This patch adds toaster tests using the oe-selftest infrastructure.
You need to have builds done - the tests will verify data integrity
after the toaster collection phase.

Once you have your toaster builds done, to run the automated backend
tests via oe-selftest do the followings:

1. Update builddir/conf/bblayers.conf to contain the meta-selftest
layer
2. From the builddir run:

'oe-selftest toaster'

or if you just want to run a single test:

'oe-selftest toaster.Toaster_DB_Tests.testname'

This first part adds the meta/lib/oeqa toaster file.

Signed-off-by: Ionut Chisanovici <ionutx.chisanovici@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: sort columns properly after edit columns

If a sorted column is made invisible through the edit columns function,
resort the table the its default order.

[YOCTO 5919]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: reduce redundant foreign key lookups

Replace redundant foreign key lookups with "with" to improve all
recipes page load time. Do depends pre-lookup in the view class,
and use python itertation instead of filter() all to achieve x16
processing speedup.

[YOCTO #6137]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>

Conflicts:
	bitbake/lib/toaster/toastergui/views.py
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
data_smart: Fix an unusual variable reference bug

If you try:

Y = ""
Y_remove = "X"

in OE-Core, bitbake will crash with a KeyError during expansion. The reason
is that no expansion of the empty value is attempted but removal from is it
and hence no varparse data is present for it in the expand_cache.

If the value is empty, there is nothing to remove so the best fix is simply
not to check for None but check it has any value.

Also add a test for this error so it doesn't get reintroduced.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>