From patchwork Mon Oct 22 20:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anibal Limon X-Patchwork-Id: 149399 Delivered-To: patch@linaro.org Received: by 2002:a2e:29db:0:0:0:0:0 with SMTP id p88-v6csp103484ljp; Mon, 22 Oct 2018 13:29:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV60uPQShmw0hSIaX7mo5jvFqgliFXkEJyT4BKisHNNpr1D/2T/Ryx48RNjG73zMXkuRZOhVY X-Received: by 2002:a65:4103:: with SMTP id w3-v6mr44822393pgp.284.1540240145191; Mon, 22 Oct 2018 13:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540240145; cv=none; d=google.com; s=arc-20160816; b=c/zEfDNre5MpyjR34X5x+AKrqN0xNtOxpp3R1VrmHtcWkYwZ0uZyV/Yc14maUEoVzb E61qB/TpaCyLCaoqteeMV2L3jbi2eYCB7+BDITGwxDvluHK41rbYDqWDflPRCqlMaRNq HfgqV1Duc9MlUn1LsV6k9tfOAsCAD5I6Bg8a3vkTJ6+/NK1XcoDHrg0KwQdpXghQ3zFk aqntJv1MYGTfUvMQwRnDAjnpL/PhhIsQqH/VrsazyMS5WDuoZTKF6i8gAeh2mwp83QaW NwjoCui8Bw455Aw5k/Bj6pL/vJV3Sp30Ti8o0r10TiJIaWPKtOC3z6yKDae0lzf5TN2l 0psg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=dddgbBDWgRcqgJ42VRiL4aTHvOJGPLCJTlfQD/02ylE=; b=vk7E7d3OsprGZhVy7Eh+wNlhw3Q5LAOVkOrd0du79On+5JVRydRfbo3dlhMyen/AqW DfQXPvXhiDPkcGdwvMTDg58aE3mm1KhFwyJ8REXiFqNRSuqDUuzdrbJW9XRc3sCPePm5 /2O0bH4WEzYi205LAbpYOTYYXSJBfninw3QUnOVcLCH3gFnVFPPiDAtzFapNXmKU8Aec TOkGmkNzHrIfLr87WOaOpeIQ3z99biQpkgkbX31WEkb5HLCZa3HxMVWqXQ1NMv6Ha0Ri ElgNKdcTJbDUmSuo2yGDco/v5H44a0R9hDwtQLwbu6cs3efh8lAGAIubmY9VfZPuY3wf nfTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jwhepvSo; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id f32-v6si15368487pgm.505.2018.10.22.13.29.04; Mon, 22 Oct 2018 13:29:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jwhepvSo; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 8B29679BA7; Mon, 22 Oct 2018 20:29:01 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mail.openembedded.org (Postfix) with ESMTP id 161E4746AB for ; Mon, 22 Oct 2018 20:29:00 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id g21-v6so13473248pfi.7 for ; Mon, 22 Oct 2018 13:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TDgX0MT/UfHkbNGjy05NHJytDijDRTxVLYVnoYyGEok=; b=jwhepvSoC+WzpLkDBF4Lpe5ceSHIJPNedKfCz2NcuaLlyjHWaH990FcO+u4Y3fhdSH PPMKi63F5GhCILVoiNsVIhXXJMYyC7QoIob0+CWwko3cmUpfRFZgBRSizxkrubtm4j4n AljtzD9SgV314nqx1yNOcp3KIu97czt6fiql0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TDgX0MT/UfHkbNGjy05NHJytDijDRTxVLYVnoYyGEok=; b=D0cxe1+Lp8SGtYqsG+4gRLpUkWkbfK0nfAnGJybrSdzxf8mvJtd4Rr+UKq+D5igKss x+LZ8Kwgv2NNkTp8xikvN5fbHF09hDNcUBudxT66FNIxFFkmzkBvKd4qkM+god055dO4 d/RbmG8gaeU7aibkytD2yZh5HqQJbclyMgTXPUi+Hp2VQj4ZN1+xlU6vxAdOBd9gR+rS rP6inf0nI4te7sSrz+QCLOntbR/R+epCtXRXfkiVB2I1X+JPsL87Z84Y/b6lXWzNQPbW WIJ4/kMeea6LFE53kuZ+h1TL6l5M8JhPDvQbxMAtOw5De5KVwiDDIAUbYaVcm/GQ005F 1KLQ== X-Gm-Message-State: ABuFfohWzBgM8WdbmdF+dW9J5HsFKBNgAFUVb9dNebEJZ+gbP3dlzrnP NWVvJ9LNxWuGwbbSglzPmGk6NtukjgU= X-Received: by 2002:a62:e414:: with SMTP id r20-v6mr47191322pfh.25.1540240141711; Mon, 22 Oct 2018 13:29:01 -0700 (PDT) Received: from blackbox.Home ([200.68.141.5]) by smtp.gmail.com with ESMTPSA id u62-v6sm41483539pfu.69.2018.10.22.13.28.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 13:29:01 -0700 (PDT) From: =?utf-8?b?QW7DrWJhbCBMaW3Ds24=?= To: openembedded-core@lists.openembedded.org Date: Mon, 22 Oct 2018 15:28:53 -0500 Message-Id: <20181022202853.11552-1-anibal.limon@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [OE-core] [PATCHv2] meta/classes/testexport: Use manfiest filenames for package and testdata 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: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Is clear to know for what image and machine the testexport package manifest and testdata was build. The oe-seltest case was update. Signed-off-by: Aníbal Limón --- meta/classes/testexport.bbclass | 4 ++-- meta/lib/oeqa/runtime/context.py | 9 +++++++-- meta/lib/oeqa/selftest/cases/runtime_test.py | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/meta/classes/testexport.bbclass b/meta/classes/testexport.bbclass index 59cbaefbf9..f38d093e81 100644 --- a/meta/classes/testexport.bbclass +++ b/meta/classes/testexport.bbclass @@ -128,8 +128,8 @@ def copy_needed_files(d, tc): tdname = "%s.testdata.json" % image_name test_data_path = os.path.join(export_path, 'data') bb.utils.mkdirhier(test_data_path) - shutil.copy2(image_manifest, os.path.join(test_data_path, 'manifest')) - shutil.copy2(tdname, os.path.join(test_data_path, 'testdata.json')) + shutil.copy2(image_manifest, os.path.join(test_data_path, os.path.basename(image_manifest))) + shutil.copy2(tdname, os.path.join(test_data_path, os.path.basename(tdname))) for subdir, dirs, files in os.walk(export_path): for dir in dirs: diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py index a7f3823996..31dba75784 100644 --- a/meta/lib/oeqa/runtime/context.py +++ b/meta/lib/oeqa/runtime/context.py @@ -2,6 +2,7 @@ # Released under the MIT license (see COPYING.MIT) import os +import glob from oeqa.core.context import OETestContext, OETestContextExecutor from oeqa.core.target.ssh import OESSHTarget @@ -42,11 +43,15 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): default_cases = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases') default_data = None - default_test_data = 'data/testdata.json' + m = glob.glob('data/*.testdata.json') + if m: + default_test_data = m[0] default_tests = '' default_target_type = 'simpleremote' - default_manifest = 'data/manifest' + m = glob.glob('data/*.manifest') + if m: + default_manifest = m[0] default_server_ip = '192.168.7.1' default_target_ip = '192.168.7.2' default_host_dumper_dir = '/tmp/oe-saved-tests' diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 906e460d4f..b57f9d91cd 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -6,6 +6,7 @@ import os import re import tempfile import shutil +import glob class TestExport(OESelftestTestCase): @@ -45,8 +46,17 @@ class TestExport(OESelftestTestCase): with runqemu('core-image-minimal') as qemu: # Attempt to run runexported.py to perform ping test test_path = os.path.join(testexport_dir, "oe-test") - data_file = os.path.join(testexport_dir, 'data', 'testdata.json') - manifest = os.path.join(testexport_dir, 'data', 'manifest') + + data_file = '' + m = glob.glob("%s/*.testdata.json" % os.path.join(testexport_dir, 'data')) + if m: + data_file = m[0] + + manifest = '' + m = glob.glob("%s/*.manifest" % os.path.join(testexport_dir, 'data')) + if m: + manifest = m[0] + cmd = ("%s runtime --test-data-file %s --packages-manifest %s " "--target-ip %s --server-ip %s --quiet" % (test_path, data_file, manifest, qemu.ip, qemu.server_ip))