From patchwork Thu Jun 21 16:18:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 139553 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2278010lji; Thu, 21 Jun 2018 09:18:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLBPJQvZGPjRZJs95p/4yHIi0e0PoZxZXpm+e+y7ED3yEBm1C5Tse/9YJWkzqhYh9ZqwH/K X-Received: by 2002:a62:c45a:: with SMTP id y87-v6mr28351873pff.190.1529597905546; Thu, 21 Jun 2018 09:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529597905; cv=none; d=google.com; s=arc-20160816; b=ZcZR+v5NvMil/t2XFvVrzgSXp8ReUlBQbKb2l0ykIGEZGzCNLm3ZRAb1Tf96bo+xqY YYRYH0TngLYNMtMefk+O6vNy1lYghhxOPH6p+Lw9tAoeL4pGNM0ZCw+1uou4FklXk3FT fqtAfgXv+jsIiI17xhWsUR2Cfx3pLBLtuyy12JvLRcRsIE8IDkX2CCvLPSDT9r22hxKy wUIUP2rEU31t3ScyoIfHXllxzM2vczfLedQGedQ/snCXq6dggTS50Yk/fCAiDwjkES/+ SIPks+XcJN20VMAP4qiyZ708WLjOA0JXEcCO/ZY1UAqwcggTG+YSDYjc2crvdkdbmi6E lKFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=UBxY2nDZU6/Z7J0Tkq9uJkVe8I0ZkRtdXJmy6GX5ERE=; b=bhQedjg0drxupwHGRCyuCAso07iVgPTwGzZMtaT4qSxVzyNHcNxbDJc9PuNhDPEErf TEKLwieNa5vit9cyQzp0jUgH80rVKZfCrMBc9FVeRuxf+oMJrYQZp1HNeNSmVvp+2Hrl KYue28x6zYJppNvbUgvh/fFWlo3JLiPU6n9MkbKFfnrmNtckv2XIZRXGKVl94zcL7h5V seoDPp1YJMrFsoPlW5R4I4y36q8b38IrGIKRb8r5Qm8LE7iuw0zRdlrvmd2Zaaaab82Y N9xJHdsNbonLQXp8QiXa120aTLkGKIwpIMpa1CRME4MdteUVVj+KAVYNANh2CdTG4r1U NJVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=o9DTgoUs; 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=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id e82-v6si5470766pfm.220.2018.06.21.09.18.24; Thu, 21 Jun 2018 09:18:25 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=o9DTgoUs; 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=intel.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 48B2078417; Thu, 21 Jun 2018 16:18:20 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by mail.openembedded.org (Postfix) with ESMTP id A0D3477DAF for ; Thu, 21 Jun 2018 16:18:18 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id n5-v6so7192012wmc.5 for ; Thu, 21 Jun 2018 09:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=ZMJ4Y7Q8wcSibbnWtFg/X/jLCBfKx4nrv2nfpp9udxY=; b=o9DTgoUsvPIQ30jTwJY5yAGq7whkXJYzueO97GHHSvBamyEm9bK6WVuIHa5Y9fWUC8 7vslaBjO7QsxDN6P/+2BZhx7Ng/jWrRoMvvvi8axk48jlnApk0cFUlRqPAXr16aFKXEW 0W0uQFPp3V21R09ZJUFzTuFd64SzIMUyQvbjBNMtjpTZUOJAnpWz4DKja+J4IvvEM+kY rNQnnvxbwfp+p7GtSxXhCeIQNCMXQhG6TsvOJ545MCTxkSLupmBQ9UkN/yqWKaz7qABP RXlRo2Sxk5UWqcDdhqorvp+cKL6o0C0p+PHTS6TiuaKTbQIjWXmlPfVK++MonkThScCU eVZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=ZMJ4Y7Q8wcSibbnWtFg/X/jLCBfKx4nrv2nfpp9udxY=; b=Px1foCh3mAbU2PM6/Lxe7LIjhKpfD3UsYolDXHT6xFq0n0H6RK3MaCtJoamTHL10CH qVpyyaL/0R+LdtzADE/o2+cpM0x4HCELD0s1PyxAgUuAarJrQAi35eXwHSKC7+8BRdLo iljUG0Ua+y54YpDxNa7Tfiz48jo1uDK/moY0euiJhihsQO3xxrEQ4OMYrjiMUkN7a0kv fzUxWCW6OcHjArqAgpMs7t2LLITED5tJppWjiZMcGIaCELBYKmfj9MYrUFisCACuxgFF vA/oIoJNYMJYchRqkN61TW9d8JzsMc7ru1ic5RDnB1/X0ALRmdHv34IN1nhPQn2y7I+6 dyGg== X-Gm-Message-State: APt69E0fYMYUpro9f6ROj2wsc+k+aloKhxNmCgw4HuLDG3kVY/vQB2CY 46b0naBRxnqZBYBeAh1hxFfiP8QI X-Received: by 2002:a1c:ec47:: with SMTP id k68-v6mr5865178wmh.109.1529597898910; Thu, 21 Jun 2018 09:18:18 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id n12-v6sm4268295wrp.69.2018.06.21.09.18.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 09:18:18 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 21 Jun 2018 17:18:15 +0100 Message-Id: <20180621161815.19449-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] oeqa: add Git mirror 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: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Add an automated test to exercise that fetching a git: recipe... 1) works over git without mirrors 2) fails without git connectivity or mirrors 3) works without git connectivity but with a mirror (2) is done by setting GIT_PROXY_COMMAND to 'false' which should break any git network operations. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/fetch.py | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/fetch.py -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/selftest/cases/fetch.py b/meta/lib/oeqa/selftest/cases/fetch.py new file mode 100644 index 00000000000..4acc8cdcc8e --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/fetch.py @@ -0,0 +1,49 @@ +import oe.path +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake +from oeqa.core.decorator.oeid import OETestID + +class Fetch(OESelftestTestCase): + @OETestID(1058) + def test_git_mirrors(self): + """ + Verify that the git fetcher will fall back to the HTTP mirrors. The + recipe needs to be one that we have on the Yocto Project source mirror + and is hosted in git. + """ + + # TODO: mktempd instead of hardcoding + dldir = os.path.join(self.builddir, "download-git-mirrors") + self.track_for_cleanup(dldir) + + # No mirrors, should use git to fetch successfully + features = """ +DL_DIR = "%s" +MIRRORS_forcevariable = "" +PREMIRRORS_forcevariable = "" +""" % dldir + self.write_config(features) + oe.path.remove(dldir, recurse=True) + bitbake("dbus-wait -c fetch -f") + + # No mirrors and broken git, should fail + features = """ +DL_DIR = "%s" +GIT_PROXY_COMMAND = "false" +MIRRORS_forcevariable = "" +PREMIRRORS_forcevariable = "" +""" % dldir + self.write_config(features) + oe.path.remove(dldir, recurse=True) + with self.assertRaises(AssertionError): + bitbake("dbus-wait -c fetch -f") + + # Broken git but a specific mirror + features = """ +DL_DIR = "%s" +GIT_PROXY_COMMAND = "false" +MIRRORS_forcevariable = "git://.*/.* http://downloads.yoctoproject.org/mirror/sources/" +""" % dldir + self.write_config(features) + oe.path.remove(dldir, recurse=True) + bitbake("dbus-wait -c fetch -f")