From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id F17EE6E660 for ; Thu, 31 Mar 2016 22:54:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u2VMsdte013577 for ; Thu, 31 Mar 2016 23:54:39 +0100 Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BoubvuoPmTcr for ; Thu, 31 Mar 2016 23:54:39 +0100 (BST) Received: from hex ([192.168.3.34]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u2VMsYDd013574 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 31 Mar 2016 23:54:35 +0100 Message-ID: <1459464874.21672.72.camel@linuxfoundation.org> From: Richard Purdie To: openembedded-core Date: Thu, 31 Mar 2016 23:54:34 +0100 X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Subject: [PATCH] selftest/signing: Use packagedata to obtain PR value for signing test X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 22:54:39 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Using PF to calculate the rpm filename doesn't work when PR server is enabled and an extra PR value can be injected. Add code to use packagedata to obtain the full name, allowing the test to work when PR server is in use. Signed-off-by: Richard Purdie diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/signing.py index 312e502..681a959 100644 --- a/meta/lib/oeqa/selftest/signing.py +++ b/meta/lib/oeqa/selftest/signing.py @@ -46,6 +46,7 @@ class Signing(oeSelfTest): Author: Daniel Istrate AutomatedBy: Daniel Istrate """ + import oe.packagedata package_classes = get_bb_var('PACKAGE_CLASSES') if 'package_rpm' not in package_classes: @@ -65,13 +66,18 @@ class Signing(oeSelfTest): bitbake(test_recipe) self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) - pf = get_bb_var('PF', test_recipe) + pkgdatadir = get_bb_var('PKGDATA_DIR', test_recipe) + pkgdata = oe.packagedata.read_pkgdatafile(pkgdatadir + "/runtime/ed") + if 'PKGE' in pkgdata: + pf = pkgdata['PN'] + "-" + pkgdata['PKGE'] + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] + else: + pf = pkgdata['PN'] + "-" + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] deploy_dir_rpm = get_bb_var('DEPLOY_DIR_RPM', test_recipe) package_arch = get_bb_var('PACKAGE_ARCH', test_recipe).replace('-', '_') staging_bindir_native = get_bb_var('STAGING_BINDIR_NATIVE') pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm'))) # Use a temporary rpmdb rpmdb = tempfile.mkdtemp(prefix='oeqa-rpmdb')