Skip to content

Commit

Permalink
add test to check order of layers in bblayers
Browse files Browse the repository at this point in the history
Add a test to check the correct ordering of layers added to BBLAYERS
which come from multiple repositories.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
fmoessbauer authored and jan-kiszka committed Oct 9, 2024
1 parent e36cd18 commit d8756b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,14 @@ def test_layers_strip_dot(dokas):
lines = f.readlines()
assert any(f'{LAYERBASE}/kas3 ' in x for x in lines)
assert any(f'{LAYERBASE}/kas3/meta-bar' in x for x in lines)


def test_layers_order(dokas):
with open('build/conf/bblayers.conf', 'r') as f:
layers = [x.strip(' \\"\n').replace(LAYERBASE, '')
for x in f.readlines() if x.lstrip().startswith(LAYERBASE)]
# layers of a repo are sorted alphabetically
assert layers[1] == '/kas1/meta-bar'
assert layers[2] == '/kas1/meta-foo'
# repos are sorted alphabetically (aa-kas from kas4 is last)
assert layers[-1] == '/aa-kas/meta'
8 changes: 8 additions & 0 deletions tests/test_layers/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ repos:
layers:
.:
meta-bar:

kas4:
url: https://github.com/siemens/kas.git
path: aa-kas
name: zz-last
branch: master
layers:
meta:

0 comments on commit d8756b8

Please sign in to comment.