summaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r--meta/classes/testimage.bbclass25
1 files changed, 10 insertions, 15 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 8d8443ca84..07744aff92 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -35,7 +35,7 @@ TEST_NEEDED_PACKAGES_DIR ?= "${WORKDIR}/testimage/packages"
35TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted" 35TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted"
36TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged" 36TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged"
37 37
38RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}" 38RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf rpm', '', d)}"
39SYSTEMDSUITE = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" 39SYSTEMDSUITE = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
40MINTESTSUITE = "ping" 40MINTESTSUITE = "ping"
41NETTESTSUITE = "${MINTESTSUITE} ssh df date scp oe_syslog ${SYSTEMDSUITE}" 41NETTESTSUITE = "${MINTESTSUITE} ssh df date scp oe_syslog ${SYSTEMDSUITE}"
@@ -74,12 +74,11 @@ TESTIMAGEDEPENDS = ""
74TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot" 74TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot"
75TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" 75TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
76TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" 76TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
77TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-native:do_populate_sysroot', '', d)}" 77TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
78TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}" 78TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
79TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot', '', d)}" 79TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot', '', d)}"
80TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}" 80TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}"
81TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}" 81TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
82TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-native:do_populate_sysroot', '', d)}"
83 82
84TESTIMAGELOCK = "${TMPDIR}/testimage.lock" 83TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
85TESTIMAGELOCK_qemuall = "" 84TESTIMAGELOCK_qemuall = ""
@@ -120,7 +119,7 @@ python do_testimage() {
120 testimage_sanity(d) 119 testimage_sanity(d)
121 120
122 if (d.getVar('IMAGE_PKGTYPE') == 'rpm' 121 if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
123 and 'smart' in d.getVar('TEST_SUITES')): 122 and 'dnf' in d.getVar('TEST_SUITES')):
124 create_rpm_index(d) 123 create_rpm_index(d)
125 124
126 testimage_main(d) 125 testimage_main(d)
@@ -324,30 +323,26 @@ def create_index(arg):
324 323
325def create_rpm_index(d): 324def create_rpm_index(d):
326 # Index RPMs 325 # Index RPMs
327 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo") 326 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
328 index_cmds = [] 327 index_cmds = []
329 archs = (d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or '').replace('-', '_') 328 archs = (d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or '').replace('-', '_')
330 329
331 for arch in archs.split(): 330 for arch in archs.split():
332 rpm_dir = os.path.join(d.getVar('DEPLOY_DIR_RPM'), arch) 331 rpm_dir = os.path.join(d.getVar('DEPLOY_DIR_RPM'), arch)
333 idx_path = os.path.join(d.getVar('WORKDIR'), 'rpm', arch) 332 idx_path = os.path.join(d.getVar('WORKDIR'), 'oe-testimage-repo', arch)
334 db_path = os.path.join(d.getVar('WORKDIR'), 'rpmdb', arch)
335 333
336 if not os.path.isdir(rpm_dir): 334 if not os.path.isdir(rpm_dir):
337 continue 335 continue
338 if os.path.exists(db_path):
339 bb.utils.remove(dbpath, True)
340 336
341 lockfilename = os.path.join(d.getVar('DEPLOY_DIR_RPM'), 'rpm.lock') 337 lockfilename = os.path.join(d.getVar('DEPLOY_DIR_RPM'), 'rpm.lock')
342 lf = bb.utils.lockfile(lockfilename, False) 338 lf = bb.utils.lockfile(lockfilename, False)
343 oe.path.copyhardlinktree(rpm_dir, idx_path) 339 oe.path.copyhardlinktree(rpm_dir, idx_path)
344 # Full indexes overload a 256MB image so reduce the number of rpms 340 # Full indexes overload a 256MB image so reduce the number of rpms
345 # in the feed. Filter to p* since we use the psplash packages and 341 # in the feed. Filter to r* since we use the run-postinst packages and
346 # this leaves some allarch and machine arch packages too. 342 # this leaves some allarch and machine arch packages too.
347 bb.utils.remove(idx_path + "*/[a-oq-z]*.rpm") 343 bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
348 bb.utils.unlockfile(lf) 344 bb.utils.unlockfile(lf)
349 cmd = '%s --dbpath %s --update -q %s' % (rpm_createrepo, 345 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
350 db_path, idx_path)
351 346
352 # Create repodata 347 # Create repodata
353 result = create_index(cmd) 348 result = create_index(cmd)