hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# SPDX-License-Identifier: MIT
#
 
import os
 
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake
 
class ImageTypeDepTests(OESelftestTestCase):
 
    # Verify that when specifying a IMAGE_TYPEDEP: of the form "foo.bar" that
    # the conversion type bar gets added as a dep as well
    def test_conversion_typedep_added(self):
 
        self.write_recipeinc('emptytest', """
# Try to empty out the default dependency list
PACKAGE_INSTALL = ""
DISTRO_EXTRA_RDEPENDS=""
 
LICENSE = "MIT"
IMAGE_FSTYPES = "testfstype"
 
IMAGE_TYPES_MASKED += "testfstype"
IMAGE_TYPEDEP:testfstype = "tar.bz2"
 
inherit image
 
""")
        # First get the dependency that should exist for bz2, it will look
        # like CONVERSION_DEPENDS_bz2="somedep"
        result = bitbake('-e emptytest')
 
        dep = None
        for line in result.output.split('\n'):
            if line.startswith('CONVERSION_DEPENDS_bz2'):
                dep = line.split('=')[1].strip('"')
                break
 
        self.assertIsNotNone(dep, "CONVERSION_DEPENDS_bz2 dependency not found in bitbake -e output")
 
        # Now get the dependency task list and check for the expected task
        # dependency
        bitbake('-g emptytest')
 
        taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
        dep =  dep + ".do_populate_sysroot"
        depfound = False
        expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
 
        with open(taskdependsfile, "r") as f:
            for line in f:
                if line.strip() == expectedline:
                    depfound = True
                    break
 
        if not depfound:
            raise AssertionError("\"{}\" not found".format(expectedline))