Files
poky/meta/lib/oeqa/selftest/bblayers.py
Paul Eggleton f1daefbf52 lib/oeqa/selftest/bblayers: use dashed subcommands
bitbake-layers subcommands with underscores are the old syntax; the
dashed form has been supported (and displayed in the help text) for
quite a while now, and the old syntax is about to be unsupported, so use
the dashed form in the tests.

(From OE-Core rev: ab2efd82b2c3419e0139b91c79a9993b257970c9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:36 +00:00

44 lines
1.7 KiB
Python

import unittest
import os
import logging
import re
import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd
from oeqa.utils.decorators import testcase
class BitbakeLayers(oeSelfTest):
@testcase(756)
def test_bitbakelayers_showcrossdepends(self):
result = runCmd('bitbake-layers show-cross-depends')
self.assertTrue('aspell' in result.output)
@testcase(83)
def test_bitbakelayers_showlayers(self):
result = runCmd('bitbake-layers show-layers')
self.assertTrue('meta-selftest' in result.output)
@testcase(93)
def test_bitbakelayers_showappends(self):
result = runCmd('bitbake-layers show-appends')
self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised')
@testcase(90)
def test_bitbakelayers_showoverlayed(self):
result = runCmd('bitbake-layers show-overlayed')
self.assertTrue('aspell' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised')
@testcase(95)
def test_bitbakelayers_flatten(self):
self.assertFalse(os.path.isdir(os.path.join(self.builddir, 'test')))
result = runCmd('bitbake-layers flatten test')
bb_file = os.path.join(self.builddir, 'test/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
self.assertTrue(os.path.isfile(bb_file))
contents = ftools.read_file(bb_file)
find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
shutil.rmtree(os.path.join(self.builddir, 'test'))
self.assertTrue(find_in_contents)