|
| 1 | +#!/usr/bin/env python |
| 2 | +# ex:ts=4:sw=4:sts=4:et |
| 3 | +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
| 4 | +# |
| 5 | +# Copyright (c) 2017, Intel Corporation. |
| 6 | +# All rights reserved. |
| 7 | +# |
| 8 | +# This program is free software; you can redistribute it and/or modify |
| 9 | +# it under the terms of the GNU General Public License version 2 as |
| 10 | +# published by the Free Software Foundation. |
| 11 | +# |
| 12 | +# This program is distributed in the hope that it will be useful, |
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +# GNU General Public License for more details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License along |
| 18 | +# with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | +# |
| 21 | +# AUTHORS |
| 22 | +# Patrick Ohly <[email protected]> |
| 23 | + |
| 24 | +""" |
| 25 | +Test cases that verify certain aspects of meta-refkit-extra |
| 26 | +in relation to meta-refkit. They need to be here because |
| 27 | +meta-refkit-extra is not enabled by default and thus |
| 28 | +tests defined there wouldn't be found. |
| 29 | +""" |
| 30 | + |
| 31 | +import re |
| 32 | + |
| 33 | +from oeqa.selftest.base import oeSelfTest |
| 34 | +from oeqa.utils.commands import runCmd, bitbake, get_bb_var |
| 35 | + |
| 36 | +class MetaRefkitExtra(oeSelfTest): |
| 37 | + """ |
| 38 | + These tests must run in a build configuration that does *not* have |
| 39 | + meta-refkit-extra. |
| 40 | + """ |
| 41 | + |
| 42 | + def setUpLocal(self): |
| 43 | + """ |
| 44 | + This code is executed before each test method. |
| 45 | + It verifies that meta-refkit-extra is not active. |
| 46 | + """ |
| 47 | + |
| 48 | + result = runCmd('bitbake-layers show-layers') |
| 49 | + for layer, path, pri in re.findall(r'^(\S+)\s+(.*?)\s+(\d+)$', result.output, re.MULTILINE): |
| 50 | + if layer == 'meta-refkit-extra': |
| 51 | + self.skipTest('meta-refkit-extra already in bblayers.conf') |
| 52 | + if layer == 'meta-refkit': |
| 53 | + self.refkit_extra_path = path + '/../meta-refkit-extra' |
| 54 | + |
| 55 | + def test_yocto_compat(self): |
| 56 | + """ |
| 57 | + Checks for 'Yocto Compatible 2.0' using the yocto-compat-layer.py tool. |
| 58 | + """ |
| 59 | + runCmd("yocto-compat-layer.py '%s'" % self.refkit_extra_path) |
0 commit comments