Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 04c7c38

Browse files
committed
meta-refkit-extra: Yocto compatible
The yocto-compat-layer.py tool checks whether a layer follows the "Yocto Compatible 2.0" guidelines. We want to comply, so now meta-refkit-extra gets tested by the tool via a selftest defined in meta-refkit. The selftest has to be defined there, otherwise it would not be found via oe-selftest as meta-refkit-extra isn't enabled in our normal CI builds. That is suitable for the yocto-compat-layer.py tool, because it is designed to test layers that are not already enabled. The only problem found by the tool is the missing README in the top directory. This is addressed (at least as far as the automated check is concerned) by moving the README from the doc directory. However, we probably also lack some information commonly expected in the file itself. Signed-off-by: Patrick Ohly <[email protected]>
1 parent de6a422 commit 04c7c38

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed
File renamed without changes.

meta-refkit/conf/distro/include/refkit-ci.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ REFKIT_VM_IMAGE_TYPES = "wic.xz wic.zip wic.bmap wic.xz.sha256sum"
5353
# pre/post-build oe-selftests started by CI builder, whitespace-separated.
5454
#
5555
REFKIT_CI_PREBUILD_SELFTESTS="iotsstatetests.SStateTests.test_sstate_samesigs"
56-
REFKIT_CI_POSTBUILD_SELFTESTS="image-installer"
56+
REFKIT_CI_POSTBUILD_SELFTESTS="image-installer meta-refkit-extra"
5757
#
5858
# Automated build targets
5959
# Those targets should be space separated list of items,
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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

Comments
 (0)