From patchwork Sat May 12 02:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912351 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qTXETWtB"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrT4c62z9s19 for ; Sat, 12 May 2018 12:59:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6A08F8A2FA; Sat, 12 May 2018 02:59:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PaQ7gwjHZO8Y; Sat, 12 May 2018 02:58:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 876638A2FB; Sat, 12 May 2018 02:58:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 6A7121C29B1 for ; Sat, 12 May 2018 02:58:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 66ED72F263 for ; Sat, 12 May 2018 02:58:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wn2RsicCgwb6 for ; Sat, 12 May 2018 02:58:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by silver.osuosl.org (Postfix) with ESMTPS id 730781FEED for ; Sat, 12 May 2018 02:58:56 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id f1-v6so9609447qtj.6 for ; Fri, 11 May 2018 19:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=+z7SVOh6UGwQBKgfrNfVzl/eEkwkIeBiV+RRJUf03v4=; b=qTXETWtBVy5yktSS5zheVx48+8AhY1ZjFp4wIXTjRBAZAc2LNwiaM03rV2lsmFl/cf yohLtq3GidapU3QoWNFMlfV57alLXE/h+fZKZjNSO++Q2Az0iZysZ5xr4JBRL/L9Ftpc FCjEo4/cCgdXF1vAPfoqKzJmByx4OQzeZsFxsCMduSE6EoslB5DDw/45oXzTpZ3fKbWV gp2wZF4jNXidTx/qvYbhqxRsdPi4+Gr+wTUVVhq4dstv8+IM4zXZoBjvDcvVnqNeaKhO ivi1go/M9CsPZMGepArEYXBt0OI2Ybydx4NMRvUEj0eXt63r2XP8pqp1O8C1WHbQSW4r jrwQ== 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:in-reply-to :references:in-reply-to:references; bh=+z7SVOh6UGwQBKgfrNfVzl/eEkwkIeBiV+RRJUf03v4=; b=YPqPYDSts2Mm8qGPjNyC2mVOREclJY+F2CZcIfuH9ik9oICmhcVMSo4lAhOXvuizL/ tkseIy2z0Q96k/4fLV1/kRCaGWzARioP7kPiCy/076hnIjSPwqUbiTx5xZrefBQ9pONW AJwGG7bpp7nd5BEuS3tONdYtkEG8Tc2zqXtI05WwMXhyNuparFf2TCBy2MVQhdqJeb8m P4w3Ou4uYur04Upr6ZE3bhIo1d6rSTGoE4+MaXSkUTFt8vviSFZnrcL+m3pzuOTVTpJ8 XFaFMr2ob5uD5K0dcUCaCnbuI8ZLSeDchEdR5Yv8UVHBdJBpPZo5DK7KUd2mDohMewbn YaPQ== X-Gm-Message-State: ALKqPwdxlMh8hS1meFyLiEv6eYvcBC9vkmddsQkmI5T8+4vKcp92IYDb LMbOLdwoHm1wPpIbtP+0GM0Bpw== X-Google-Smtp-Source: AB8JxZq7pjSFEC9FtakrfAoS93wT2yNtN1uyaAGkWdCr6N5shslAkpH6RxsuxTv3ryBQYMoF288k5Q== X-Received: by 2002:aed:2ac7:: with SMTP id t65-v6mr530067qtd.194.1526093935323; Fri, 11 May 2018 19:58:55 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.58.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:58:54 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:24 -0300 Message-Id: <20180512025833.22998-2-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 01/10] testing/infra/builder: build with target and environment X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Make the builder able to call 'VAR1=1 make VAR2=2 target'. Allow to send extra parameters to be added to the end of make command line. It can be used for these purposes: - to configure a br2-external, by passing 'BR2_EXTERNAL="dir"'; - to specify a make target, such as 'foo-source'. Allow to add variables to the environment in which make runs. It can be used to override values from environment, such as 'BR2_DL_DIR="dl"'. This change will be needed when adding a common class to test the git download infra. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Changes v4 -> v5: - no changes Changes v3 -> v4: - no changes Changes v2 -> v3: - rebase after adding patch 1 to the series, which runs make using an empty env; - use docstring (Arnout Vandecappelle); - use more descriptive parameter names (make_extra_opts, make_extra_env) (Arnout Vandecappelle); - default make_extra_env to {} and use update() (Arnout Vandecappelle); - for consistence I did the equivalent to make_extra_opts; - for symmetry, use make_extra_env also in the configure() (Arnout Vandecappelle); - remove old example from commit message since using a static repo to test git refs do not need to override _VERSION. Changes v1 -> v2: - new patch to adapt the test infra to test git download; --- support/testing/infra/builder.py | 38 ++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/support/testing/infra/builder.py b/support/testing/infra/builder.py index faf1eb1494..d478c0d212 100644 --- a/support/testing/infra/builder.py +++ b/support/testing/infra/builder.py @@ -12,7 +12,18 @@ class Builder(object): self.builddir = builddir self.logfile = infra.open_log_file(builddir, "build", logtofile) - def configure(self): + def configure(self, make_extra_opts=[], make_extra_env={}): + """ + Configure the build. + + make_extra_opts: a list of arguments to be passed to the make + command. + e.g. make_extra_opts=["BR2_EXTERNAL=/path"] + + make_extra_env: a dict of variables to be appended (or replaced) + in the environment that calls make. + e.g. make_extra_env={"BR2_DL_DIR": "/path"} + """ if not os.path.isdir(self.builddir): os.makedirs(self.builddir) @@ -25,17 +36,36 @@ class Builder(object): self.logfile.flush() env = {"PATH": os.environ["PATH"]} + env.update(make_extra_env) + cmd = ["make", - "O={}".format(self.builddir), - "olddefconfig"] + "O={}".format(self.builddir)] + cmd += make_extra_opts + cmd += ["olddefconfig"] + ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile, env=env) if ret != 0: raise SystemError("Cannot olddefconfig") - def build(self): + def build(self, make_extra_opts=[], make_extra_env={}): + """ + Perform the build. + + make_extra_opts: a list of arguments to be passed to the make + command. It can include a make target. + e.g. make_extra_opts=["foo-source"] + + make_extra_env: a dict of variables to be appended (or replaced) + in the environment that calls make. + e.g. make_extra_env={"BR2_DL_DIR": "/path"} + """ env = {"PATH": os.environ["PATH"]} + env.update(make_extra_env) + cmd = ["make", "-C", self.builddir] + cmd += make_extra_opts + ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile, env=env) if ret != 0: From patchwork Sat May 12 02:58:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912353 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cM6Yttcu"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrX3SY5z9s1w for ; Sat, 12 May 2018 12:59:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4F1D98852B; Sat, 12 May 2018 02:59:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0XSxG4_Ha51m; Sat, 12 May 2018 02:59:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37E10884D2; Sat, 12 May 2018 02:59:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 00AE31C29B1 for ; Sat, 12 May 2018 02:59:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EBEC88A2FB for ; Sat, 12 May 2018 02:59:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0pkgUeUJnCMZ for ; Sat, 12 May 2018 02:59:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f180.google.com (mail-qt0-f180.google.com [209.85.216.180]) by hemlock.osuosl.org (Postfix) with ESMTPS id D57058A2FD for ; Sat, 12 May 2018 02:58:59 +0000 (UTC) Received: by mail-qt0-f180.google.com with SMTP id q13-v6so9599239qtp.4 for ; Fri, 11 May 2018 19:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=bcsCv+MTmYgGDdo0jzYG6lzIOAN9uz8SKWBfdfM8iwg=; b=cM6YttcuU9t4I0byg4zdSZNwY24gROmp5Aj4awHgHnoYq4mIHzlviCuuQLp9kihGbh cGFXvNMWMsQ/LOflNMgC4dFuxPnwZ2xC+0+JJLDK5svLygzmsB5zfHNYuW7XOtiwkWoF f6KQflebycwMKGx7G2ioJeO+0XmIfPugPisuOeLvFA1G/IIWq7/SmPkhSo5zxeRJPw7i RTFN5pnUaPmMpp1dvJ8OFxl4Tf2wrsMs35xBqDAjfAtpTwhX2xj88Par/8/YRtb3Lavg tW54vFsNbtO8FeX16sDJwCXWK+2XFdVptNyOhFAQNDfhrf0sxBFY+RCKIhqfU8FsOd5L vSGA== 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:in-reply-to :references:in-reply-to:references; bh=bcsCv+MTmYgGDdo0jzYG6lzIOAN9uz8SKWBfdfM8iwg=; b=cehlOmUZXFw0Rk2hbsl6eBntC/4Fxu1qz3ZNU+yp2iTbBeYvax0oLVbuUp/1Gh5lHc nhddad2hlN9BUBiE/2ooNj9Na/+JK4VfUH9DtlxzOAicf6bbBB5FhnNocqm0Vecn1TwI 4I2mTflF0CsLTg080u42gksD9jj/LaC2/u1MJukadloRgkXuhNgzg1ZSiLRPES8BwJQn bWO5G8UOS9P5icYasW2RTrCpflb8LDiFu7CwM9IN3mRMH6wzDfBUGzYu6iQDITH7oCal lvT8U1zPdo5F/JecklASneh7yfez0pgOSO3E9pshQ8gotR2Wc25ddqJiFtTKN4WBBXp0 sz0Q== X-Gm-Message-State: ALKqPwcr2dXIbjOJ99tRBDe33S68eATEE8+OGHAMlkCdnJhfGiGG7OgG YvAPcyVajphuGIkKsigQ/nWHww== X-Google-Smtp-Source: AB8JxZr56joGNURgoDpJjW01Qto+hSyqaDBdGDcmWmQDP7fko3atrDRbQSm+hT70NppblQQrEm7JyA== X-Received: by 2002:aed:22f8:: with SMTP id q53-v6mr489231qtc.99.1526093938612; Fri, 11 May 2018 19:58:58 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:58:58 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:25 -0300 Message-Id: <20180512025833.22998-3-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 02/10] testing/infra: split runtime test from BRTest X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Move the setup of emulator to a new class, RuntimeTestBase, that bahaves exactly like BRTest currently does. It will avoid duplicating code when adding a common class to test the git download infra. Change all current test cases to use the new class. Do this by first using automatic replace: $ find support/testing/ -name '*.py' | \ xargs grep -l BRTest | \ xargs sed -i \ -e 's,import infra.basetest,\0\nimport infra.runtimetest,g' \ -e 's,infra.basetest.BRTest,infra.runtimetest.RuntimeTestBase,g' and then manually add code to import runtimetest in test_external.py to avoid this error: AttributeError: 'module' object has no attribute 'LoadTestsFailure' This explicit import was not need before because run-tests imports BRTest and this is the only test file that do not use the defconfig fragments from basetest.py in its code. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- WARNING: this patch changes all current test cases, so if a new test case was applied after this patch was sent, 'git am' will apply this patch cleanly, yet any testcase created in the meantime will be broken. But I can refresh it if need. It will probably only need the automatic replace from the commit log to be re-run. Changes v4 -> v5: - no changes Changes v3 -> v4: - re-run the automatic replace command Changes v2 -> v3: - new patch - search for "RuntimeTestBase" in http://patchwork.ozlabs.org/patch/806161/ --- support/testing/infra/basetest.py | 10 -------- support/testing/infra/runtimetest.py | 23 +++++++++++++++++++ support/testing/tests/boot/test_atf.py | 7 +++--- .../testing/tests/core/test_post_scripts.py | 3 ++- .../testing/tests/core/test_rootfs_overlay.py | 3 ++- support/testing/tests/core/test_timezone.py | 7 +++--- support/testing/tests/fs/test_ext.py | 9 ++++---- support/testing/tests/fs/test_iso9660.py | 13 ++++++----- support/testing/tests/fs/test_jffs2.py | 3 ++- support/testing/tests/fs/test_squashfs.py | 3 ++- support/testing/tests/fs/test_ubi.py | 3 ++- support/testing/tests/fs/test_yaffs2.py | 3 ++- support/testing/tests/init/base.py | 3 ++- .../testing/tests/package/test_dropbear.py | 3 ++- support/testing/tests/package/test_python.py | 3 ++- support/testing/tests/package/test_rust.py | 3 ++- .../testing/tests/package/test_syslog_ng.py | 3 ++- .../testing/tests/toolchain/test_external.py | 3 ++- 18 files changed, 67 insertions(+), 38 deletions(-) create mode 100644 support/testing/infra/runtimetest.py diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index f3f13ad97f..4773312585 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -3,7 +3,6 @@ import os import datetime from infra.builder import Builder -from infra.emulator import Emulator BASIC_TOOLCHAIN_CONFIG = \ """ @@ -41,7 +40,6 @@ class BRTest(unittest.TestCase): super(BRTest, self).__init__(names) self.testname = self.__class__.__name__ self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname) - self.emulator = None self.config += '\nBR2_DL_DIR="{}"\n'.format(self.downloaddir) self.config += "\nBR2_JLEVEL={}\n".format(self.jlevel) @@ -57,17 +55,9 @@ class BRTest(unittest.TestCase): self.b.delete() if not self.b.is_finished(): - self.show_msg("Building") self.b.configure() - self.b.build() - self.show_msg("Building done") - - self.emulator = Emulator(self.builddir, self.downloaddir, - self.logtofile, self.timeout_multiplier) def tearDown(self): self.show_msg("Cleaning up") - if self.emulator: - self.emulator.stop() if self.b and not self.keepbuilds: self.b.delete() diff --git a/support/testing/infra/runtimetest.py b/support/testing/infra/runtimetest.py new file mode 100644 index 0000000000..68bb03d091 --- /dev/null +++ b/support/testing/infra/runtimetest.py @@ -0,0 +1,23 @@ +from infra.basetest import BRTest +from infra.emulator import Emulator + + +class RuntimeTestBase(BRTest): + def __init__(self, names): + super(RuntimeTestBase, self).__init__(names) + self.emulator = None + + def setUp(self): + super(RuntimeTestBase, self).setUp() + if not self.b.is_finished(): + self.show_msg("Building") + self.b.build() + self.show_msg("Building done") + + self.emulator = Emulator(self.builddir, self.downloaddir, + self.logtofile, self.timeout_multiplier) + + def tearDown(self): + if self.emulator: + self.emulator.stop() + super(RuntimeTestBase, self).tearDown() diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py index 75cea01fc8..0ea486fb5b 100644 --- a/support/testing/tests/boot/test_atf.py +++ b/support/testing/tests/boot/test_atf.py @@ -1,7 +1,8 @@ import infra.basetest +import infra.runtimetest -class TestATFVexpress(infra.basetest.BRTest): +class TestATFVexpress(infra.runtimetest.RuntimeTestBase): config = \ """ BR2_aarch64=y @@ -25,7 +26,7 @@ class TestATFVexpress(infra.basetest.BRTest): pass -class TestATFAllwinner(infra.basetest.BRTest): +class TestATFAllwinner(infra.runtimetest.RuntimeTestBase): config = \ """ BR2_aarch64=y @@ -54,7 +55,7 @@ class TestATFAllwinner(infra.basetest.BRTest): pass -class TestATFMarvell(infra.basetest.BRTest): +class TestATFMarvell(infra.runtimetest.RuntimeTestBase): config = \ """ BR2_aarch64=y diff --git a/support/testing/tests/core/test_post_scripts.py b/support/testing/tests/core/test_post_scripts.py index a0e5b6b454..c4dfb91550 100644 --- a/support/testing/tests/core/test_post_scripts.py +++ b/support/testing/tests/core/test_post_scripts.py @@ -2,9 +2,10 @@ import os import csv import infra.basetest +import infra.runtimetest -class TestPostScripts(infra.basetest.BRTest): +class TestPostScripts(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_INIT_NONE=y diff --git a/support/testing/tests/core/test_rootfs_overlay.py b/support/testing/tests/core/test_rootfs_overlay.py index fedd40d8ac..66b5531221 100644 --- a/support/testing/tests/core/test_rootfs_overlay.py +++ b/support/testing/tests/core/test_rootfs_overlay.py @@ -2,13 +2,14 @@ import os import subprocess import infra.basetest +import infra.runtimetest def compare_file(file1, file2): return subprocess.call(["cmp", file1, file2]) -class TestRootfsOverlay(infra.basetest.BRTest): +class TestRootfsOverlay(infra.runtimetest.RuntimeTestBase): rootfs_overlay_path = infra.filepath("tests/core/rootfs-overlay") diff --git a/support/testing/tests/core/test_timezone.py b/support/testing/tests/core/test_timezone.py index 050624e0aa..dca38bebe8 100644 --- a/support/testing/tests/core/test_timezone.py +++ b/support/testing/tests/core/test_timezone.py @@ -1,6 +1,7 @@ import os import infra.basetest +import infra.runtimetest def boot_armv5_cpio(emulator, builddir): @@ -10,7 +11,7 @@ def boot_armv5_cpio(emulator, builddir): emulator.login() -class TestNoTimezone(infra.basetest.BRTest): +class TestNoTimezone(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ # BR2_TARGET_TZ_INFO is not set @@ -26,7 +27,7 @@ class TestNoTimezone(infra.basetest.BRTest): self.assertEqual(tz[0].strip(), "UTC") -class TestGlibcAllTimezone(infra.basetest.BRTest): +class TestGlibcAllTimezone(infra.runtimetest.RuntimeTestBase): config = \ """ BR2_arm=y @@ -48,7 +49,7 @@ class TestGlibcAllTimezone(infra.basetest.BRTest): self.assertEqual(tz[0].strip(), "CET") -class TestGlibcNonDefaultLimitedTimezone(infra.basetest.BRTest): +class TestGlibcNonDefaultLimitedTimezone(infra.runtimetest.RuntimeTestBase): config = \ """ BR2_arm=y diff --git a/support/testing/tests/fs/test_ext.py b/support/testing/tests/fs/test_ext.py index f5f9e9fdf1..a8f68bc54c 100644 --- a/support/testing/tests/fs/test_ext.py +++ b/support/testing/tests/fs/test_ext.py @@ -2,6 +2,7 @@ import os import subprocess import infra.basetest +import infra.runtimetest VOLNAME_PROP = "Filesystem volume name" REVISION_PROP = "Filesystem revision #" @@ -41,7 +42,7 @@ def boot_img_and_check_fs_type(emulator, builddir, fs_type): return exit_code -class TestExt2(infra.basetest.BRTest): +class TestExt2(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_EXT2=y @@ -60,7 +61,7 @@ class TestExt2(infra.basetest.BRTest): self.assertEqual(exit_code, 0) -class TestExt2r1(infra.basetest.BRTest): +class TestExt2r1(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_EXT2=y @@ -80,7 +81,7 @@ class TestExt2r1(infra.basetest.BRTest): self.assertEqual(exit_code, 0) -class TestExt3(infra.basetest.BRTest): +class TestExt3(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_EXT2=y @@ -99,7 +100,7 @@ class TestExt3(infra.basetest.BRTest): self.assertEqual(exit_code, 0) -class TestExt4(infra.basetest.BRTest): +class TestExt4(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_EXT2=y diff --git a/support/testing/tests/fs/test_iso9660.py b/support/testing/tests/fs/test_iso9660.py index 68f4840852..77255ac93b 100644 --- a/support/testing/tests/fs/test_iso9660.py +++ b/support/testing/tests/fs/test_iso9660.py @@ -1,6 +1,7 @@ import os import infra.basetest +import infra.runtimetest BASIC_CONFIG = \ """ @@ -47,7 +48,7 @@ def test_touch_file(emulator): # Grub 2 -class TestIso9660Grub2External(infra.basetest.BRTest): +class TestIso9660Grub2External(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y @@ -67,7 +68,7 @@ class TestIso9660Grub2External(infra.basetest.BRTest): self.assertEqual(exit_code, 1) -class TestIso9660Grub2ExternalCompress(infra.basetest.BRTest): +class TestIso9660Grub2ExternalCompress(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y @@ -88,7 +89,7 @@ class TestIso9660Grub2ExternalCompress(infra.basetest.BRTest): self.assertEqual(exit_code, 1) -class TestIso9660Grub2Internal(infra.basetest.BRTest): +class TestIso9660Grub2Internal(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y @@ -111,7 +112,7 @@ class TestIso9660Grub2Internal(infra.basetest.BRTest): # Syslinux -class TestIso9660SyslinuxExternal(infra.basetest.BRTest): +class TestIso9660SyslinuxExternal(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y @@ -130,7 +131,7 @@ class TestIso9660SyslinuxExternal(infra.basetest.BRTest): self.assertEqual(exit_code, 1) -class TestIso9660SyslinuxExternalCompress(infra.basetest.BRTest): +class TestIso9660SyslinuxExternalCompress(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y @@ -150,7 +151,7 @@ class TestIso9660SyslinuxExternalCompress(infra.basetest.BRTest): self.assertEqual(exit_code, 1) -class TestIso9660SyslinuxInternal(infra.basetest.BRTest): +class TestIso9660SyslinuxInternal(infra.runtimetest.RuntimeTestBase): config = BASIC_CONFIG + \ """ BR2_TARGET_ROOTFS_ISO9660=y diff --git a/support/testing/tests/fs/test_jffs2.py b/support/testing/tests/fs/test_jffs2.py index 2ff5099180..8f73cf1f06 100644 --- a/support/testing/tests/fs/test_jffs2.py +++ b/support/testing/tests/fs/test_jffs2.py @@ -2,6 +2,7 @@ import os import subprocess import infra.basetest +import infra.runtimetest def jffs2dump_find_file(files_list, fname): @@ -12,7 +13,7 @@ def jffs2dump_find_file(files_list, fname): return False -class TestJffs2(infra.basetest.BRTest): +class TestJffs2(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_JFFS2=y diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py index 066c054342..f80149f9d9 100644 --- a/support/testing/tests/fs/test_squashfs.py +++ b/support/testing/tests/fs/test_squashfs.py @@ -2,9 +2,10 @@ import os import subprocess import infra.basetest +import infra.runtimetest -class TestSquashfs(infra.basetest.BRTest): +class TestSquashfs(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_SQUASHFS=y diff --git a/support/testing/tests/fs/test_ubi.py b/support/testing/tests/fs/test_ubi.py index 015d82f769..c724f4f740 100644 --- a/support/testing/tests/fs/test_ubi.py +++ b/support/testing/tests/fs/test_ubi.py @@ -2,9 +2,10 @@ import subprocess import os import infra.basetest +import infra.runtimetest -class TestUbi(infra.basetest.BRTest): +class TestUbi(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_UBIFS=y diff --git a/support/testing/tests/fs/test_yaffs2.py b/support/testing/tests/fs/test_yaffs2.py index b60e90e660..c7c8c1f724 100644 --- a/support/testing/tests/fs/test_yaffs2.py +++ b/support/testing/tests/fs/test_yaffs2.py @@ -1,9 +1,10 @@ import os import infra.basetest +import infra.runtimetest -class TestYaffs2(infra.basetest.BRTest): +class TestYaffs2(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ infra.basetest.MINIMAL_CONFIG + \ """ diff --git a/support/testing/tests/init/base.py b/support/testing/tests/init/base.py index 75cfbe9c59..1b736af657 100644 --- a/support/testing/tests/init/base.py +++ b/support/testing/tests/init/base.py @@ -1,9 +1,10 @@ import os import subprocess import infra.basetest +import infra.runtimetest -class InitSystemBase(infra.basetest.BRTest): +class InitSystemBase(infra.runtimetest.RuntimeTestBase): def start_emulator(self, fs_type, kernel=None, dtb=None, init=None): img = os.path.join(self.builddir, "images", "rootfs.{}".format(fs_type)) diff --git a/support/testing/tests/package/test_dropbear.py b/support/testing/tests/package/test_dropbear.py index 8f7f1fee82..8f7f30e3af 100644 --- a/support/testing/tests/package/test_dropbear.py +++ b/support/testing/tests/package/test_dropbear.py @@ -1,9 +1,10 @@ import os import infra.basetest +import infra.runtimetest -class TestDropbear(infra.basetest.BRTest): +class TestDropbear(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_GENERIC_ROOT_PASSWD="testpwd" diff --git a/support/testing/tests/package/test_python.py b/support/testing/tests/package/test_python.py index 26cf49947b..787364c719 100644 --- a/support/testing/tests/package/test_python.py +++ b/support/testing/tests/package/test_python.py @@ -1,9 +1,10 @@ import os import infra.basetest +import infra.runtimetest -class TestPythonBase(infra.basetest.BRTest): +class TestPythonBase(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_TARGET_ROOTFS_CPIO=y diff --git a/support/testing/tests/package/test_rust.py b/support/testing/tests/package/test_rust.py index 2dc814f99d..df445f1186 100644 --- a/support/testing/tests/package/test_rust.py +++ b/support/testing/tests/package/test_rust.py @@ -4,9 +4,10 @@ import subprocess import shutil import infra.basetest +import infra.runtimetest -class TestRustBase(infra.basetest.BRTest): +class TestRustBase(infra.runtimetest.RuntimeTestBase): target = 'armv7-unknown-linux-gnueabihf' crate = 'hello-world' diff --git a/support/testing/tests/package/test_syslog_ng.py b/support/testing/tests/package/test_syslog_ng.py index 0155ef14e4..df6ce8b8d0 100644 --- a/support/testing/tests/package/test_syslog_ng.py +++ b/support/testing/tests/package/test_syslog_ng.py @@ -1,9 +1,10 @@ import os import infra.basetest +import infra.runtimetest -class TestSyslogNg(infra.basetest.BRTest): +class TestSyslogNg(infra.runtimetest.RuntimeTestBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py index 881d2b00db..b72e19f740 100644 --- a/support/testing/tests/toolchain/test_external.py +++ b/support/testing/tests/toolchain/test_external.py @@ -1,5 +1,6 @@ import os import infra +import infra.runtimetest BASIC_CONFIG = \ """ @@ -17,7 +18,7 @@ def has_broken_links(path): return False -class TestExternalToolchain(infra.basetest.BRTest): +class TestExternalToolchain(infra.runtimetest.RuntimeTestBase): def common_check(self): # Check for broken symlinks for d in ["lib", "usr/lib"]: From patchwork Sat May 12 02:58:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912354 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dwshb8f8"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrd714Tz9s19 for ; Sat, 12 May 2018 12:59:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B1B68838B; Sat, 12 May 2018 02:59:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W4ignmGGtC+A; Sat, 12 May 2018 02:59:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id F29E3848A1; Sat, 12 May 2018 02:59:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8276A1C29B1 for ; Sat, 12 May 2018 02:59:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7F5F488524 for ; Sat, 12 May 2018 02:59:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fQQ9gSWRzpc4 for ; Sat, 12 May 2018 02:59:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8B4A0884B4 for ; Sat, 12 May 2018 02:59:02 +0000 (UTC) Received: by mail-qt0-f195.google.com with SMTP id j42-v6so9575247qtj.12 for ; Fri, 11 May 2018 19:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=jHuv6YegYkgPk8ZiGwUT8LZ3GE3pLtnQXJIm6/JtAH0=; b=dwshb8f8+noNGf+RQy112z+PiN4JP08585QElU+sXHcrwuVlIfyj8ee3TbiLmcsdYh g+NOBMXqltKD0CkoonQ3apQgVivKmsnAjRMKt7/nXyiVz8auxBDlqKm1gD5Gb2KSZtMS sEo6az5GSSwlEzJNMp4k6wIv+bvScCkG13tyiGmkTjTJ0WMcCNMDuQF5hGz6irEDu4Jn AeuXBzbXbJY2nGdZTt9PuGwa7p2/KIOp6eTQ1wP57hr7DPqlzQpLWqVg3g8v9s4OIGl6 TQnYxdvrpYTTan4oj/DxtgGvLfguk3hfAvZ1oxJJQQgwnWOtKbnKWGrVdYtlICPJcd5c EXAA== 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:in-reply-to :references:in-reply-to:references; bh=jHuv6YegYkgPk8ZiGwUT8LZ3GE3pLtnQXJIm6/JtAH0=; b=J3zPbDvWOXSyFP1pnavj5QazCBddUCMAMkCqbB6WdAQ09o/76sNS0p+0OX9FLN5Xbv 5mQOc1vjcLQk5nmMdiLzvZm6Ca9aiMxDGIWb9fOABdlhlTq4dWkmuEiSTID96EPqOISa Wx817Tlqw+ah7eGHh+nkKfWfGEmiYJWDROWnDZSc76Shklz24Tlg0oJpVZtO0FP58i7U wRDBMdfJdh3ZIZLJTXk33xAgPrTWHbiKq/gnvY1tEFMR5Ksda1YyUI8Zo8M4qDe/IaWx G9v1xAkmcAigOaQVBllOEkNx4D6eK0af7tcV1Xj+ImvkqI7wHmKj/y13FzpEmTzUIxvS rcPA== X-Gm-Message-State: ALKqPwf0u/bzQxsV8J+oTH7VkuitSTmrlarPOwMGKV/zFAEabmrZZx0G veRa5mpbGmsBuMQGwVIj0ubm8A== X-Google-Smtp-Source: AB8JxZp9K+0/p8qCSde9sQA7IuZD7f1c7IKMAeOVWuhUwppm39j+rRpRVsBQgbEfNhh+SOi3VmvoeA== X-Received: by 2002:ac8:5192:: with SMTP id c18-v6mr530728qtn.80.1526093941545; Fri, 11 May 2018 19:59:01 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.58.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:01 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:26 -0300 Message-Id: <20180512025833.22998-4-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 03/10] testing/infra/basetest: support br2-external X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski This change will be needed when adding a common class to test the git download infra. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Changes v4 -> v5: - no changes Changes v3 -> v4: - allow the use of multiple br2-external trees, simplifying the code Changes v2 -> v3: - new patch - search for "support for BR2_EXTERNAL directly in BRTest" in http://patchwork.ozlabs.org/patch/806161/ --- support/testing/infra/basetest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index 4773312585..67076701e7 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -29,6 +29,7 @@ MINIMAL_CONFIG = \ class BRTest(unittest.TestCase): config = None + br2_external = list() downloaddir = None outputdir = None logtofile = True @@ -55,7 +56,7 @@ class BRTest(unittest.TestCase): self.b.delete() if not self.b.is_finished(): - self.b.configure() + self.b.configure(["BR2_EXTERNAL={}".format(":".join(self.br2_external))]) def tearDown(self): self.show_msg("Cleaning up") From patchwork Sat May 12 02:58:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912355 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="auMGrA+3"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrh41XBz9s19 for ; Sat, 12 May 2018 12:59:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 040DF885CA; Sat, 12 May 2018 02:59:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8q1TlF-u6Uom; Sat, 12 May 2018 02:59:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id BC241848A1; Sat, 12 May 2018 02:59:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 92EC61C29B1 for ; Sat, 12 May 2018 02:59:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8F67E207AE for ; Sat, 12 May 2018 02:59:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KG9rmreY7Vax for ; Sat, 12 May 2018 02:59:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) by silver.osuosl.org (Postfix) with ESMTPS id D1A081FEED for ; Sat, 12 May 2018 02:59:05 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id f13-v6so9578523qtp.10 for ; Fri, 11 May 2018 19:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=/eHn1C3SMz/ddhNSgChoOCdk/F54TBb1XOxHeY3L5P0=; b=auMGrA+3ku5agkmRFgg014KVaHWpwXg4KAw00Ju7djTAqbWUtr7TnywT8YNRmMe859 nqFpV+Z7yCZVED3CQxIQagu17wP/HLHD+81MK4MpLwfRfEIrWJIINg27hs6fFAe91H9I jxBaR/2As7FVuB7UWPmStEFX5buTxSKFaorDURjxT+YnxJ/dw3+F7joEk0DwNaPt89Dx 1GL23PottrZ5ONvceyBR+vvTDJc62SrbsCAFA8M4xU7iBqwvaGuIVPM88x/9B49p+zbd dH0zY0qjOnAjSZK0c1IlhspGpo454uPxW4In6X0LObk+QvEiUpgi9o19/EQ7KHBsCru/ zr6w== 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:in-reply-to :references:in-reply-to:references; bh=/eHn1C3SMz/ddhNSgChoOCdk/F54TBb1XOxHeY3L5P0=; b=XwfGCEFZbTEluhWAJPUrrfbn0f5BV/a/6jxRWsLUC4BA5U2fDDJV6pQZdk8f+AS65z YjlQ1sGsB1FerpNG7T0dnzv75yo7Ttm5/SJRyJ7PdXlx9QgvD8f2Ah7Ws+CTjJQFuIYj 8RXe4ielt60cEunN/LKqwUnA//sajNEQcNWNLTXoG20Y909gd9YtKLacf0iglwvIapA7 wXQ+UjtolPoQAKf4sz/ECrnIFo0jO4a4folnP40W0CHHDfZJDv9eXlRdH1KlZkRVZkDO JK/A8+3akxQ2KZoss1kROvScJmp3JJ2HTBZYBYv2GPYVl8cZmLw0W9UXB5a7J63OzMgT JXfw== X-Gm-Message-State: ALKqPwd2hIxAW2QIHwVDAHbSlWir6CBq8lHVuYol4ISg60SP4jO5JCoS OJ+KfSnIhiwG7mK01mMW/Op9oA== X-Google-Smtp-Source: AB8JxZpIAEuG/pc6uiXT2PHaqRKUolfokmo4CEl1cJUoH0S8vATBFKKLj27VYJa5DscoZ3MVVYxTww== X-Received: by 2002:a0c:9944:: with SMTP id i4-v6mr901220qvd.192.1526093944603; Fri, 11 May 2018 19:59:04 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:04 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:27 -0300 Message-Id: <20180512025833.22998-5-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 04/10] testing/tests/download: add git hash test X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Add one test case to ensure the hash is checked for git packages: - correct hash; - wrong hash; - no hash file. Add required infra: - a GitRemote class, that can start a git server in the host machine to emulate a remote git server under the control of the test; - a new base class, called GitTestBase, that inherits from BRTest and must be subclassed by all git test cases. Its setUp() method takes care of configuring the build with a br2-external, avoiding to hit http://sources.buildroot.net by using an empty BR2_BACKUP_SITE. It also avoids downloading not pre-installed dependencies (i.e. lzip) every time by calling 'make dependencies' using the common dl directory, and it instantiates the GitRemote object. Besides the Python scripts, add some fixtures used during the tests: - a br2-external (git-hash) with one package for each part of the test case; - a static git bare repo (repo.git) to be served using GitRemote class. Neither the br2-external nor the check hash functionalities are the subject of these tests per se, so for simplicity limit the check to the error codes and don't look for the messages in the log. Thanks to Arnout for the hint about how to add a bare repo to test. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repo with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * a238b1d (HEAD -> master) initial Changes v4 -> v5: - no changes Changes v3 -> v4: - remove call to 'make dependencies'; - merge generic git base file to the main test case as the first was only used by the second; - use variable naming similar to builder; - move useful methods to the base class; - rename logfile to -gitremote (it will become handy when adding the http server on a later patch); - use more columns (our limit is now 132); - merge start to __init__ as it was called only there; - remove temp variable used only once (port_arg); - use a more future-proof string format for the port arg (it will become handy when adding the http server on a later patch); - use simpler code to raise exception if there is no free port; - fix the range for ports to use; - br2_external is now a list; Changes v2 -> v3: - renumber 5 -> 6; - rebase after removing patch 3 "allow to override logfile" from the series and adding new patches 4 "split runtime test from BRTest" and 5 "support br2-external"; - merge part of old patch 4 (very minimal GitTestBase) to old patch 5 (Arnout Vandecappelle); - merge and tweak part of commit log from old patch 4; - move GITREMOTE_PORT_NUMBER to external.mk (Arnout Vandecappelle); - use dosctrings; - start git remote from __init__ (Arnout Vandecappelle), but I kept a separate method and call start(); - remove dead code (Arnout Vandecappelle); - use the same git repo for all tests (Arnout Vandecappelle); - rename the file to test_git and merge the 3 test cases in one, since the feature "check hash for git packages" is only OK if all work well and also because the test does not take too much time; - update commit log accordingly. Changes v1 -> v2 (patch 4): - new patch Changes v1 -> v2 (patch 5): - use git daemon + git:// instead of ssh (Arnout); - remove __main__ handling since the test infra already does that; - use the logging support from test infra; - this patch is part of series 1/3 of a new version of http://patchwork.ozlabs.org/patch/690097/ --- .gitlab-ci.yml | 1 + support/testing/tests/download/__init__.py | 0 .../download/br2-external/git-hash/Config.in | 0 .../br2-external/git-hash/external.desc | 1 + .../br2-external/git-hash/external.mk | 4 ++ .../git-hash/package/bad/bad.hash | 1 + .../br2-external/git-hash/package/bad/bad.mk | 10 ++++ .../git-hash/package/good/good.hash | 1 + .../git-hash/package/good/good.mk | 10 ++++ .../git-hash/package/nohash/nohash.mk | 10 ++++ .../git-remote/repo.git/.gitattributes | 1 + .../tests/download/git-remote/repo.git/HEAD | 1 + .../tests/download/git-remote/repo.git/config | 4 ++ .../99/f2e3e1cb15f9b52fa29f66d380dda061d917ab | Bin 0 -> 49 bytes .../a2/38b1dfcd825d47d834af3c5223417c8411d90d | Bin 0 -> 152 bytes .../e7/9c5e8f964493290a409888d5413a737e8e5dd5 | Bin 0 -> 23 bytes .../git-remote/repo.git/refs/heads/master | 1 + support/testing/tests/download/gitremote.py | 44 ++++++++++++++++++ support/testing/tests/download/test_git.py | 43 +++++++++++++++++ 19 files changed, 132 insertions(+) create mode 100644 support/testing/tests/download/__init__.py create mode 100644 support/testing/tests/download/br2-external/git-hash/Config.in create mode 100644 support/testing/tests/download/br2-external/git-hash/external.desc create mode 100644 support/testing/tests/download/br2-external/git-hash/external.mk create mode 100644 support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash create mode 100644 support/testing/tests/download/br2-external/git-hash/package/bad/bad.mk create mode 100644 support/testing/tests/download/br2-external/git-hash/package/good/good.hash create mode 100644 support/testing/tests/download/br2-external/git-hash/package/good/good.mk create mode 100644 support/testing/tests/download/br2-external/git-hash/package/nohash/nohash.mk create mode 100644 support/testing/tests/download/git-remote/repo.git/.gitattributes create mode 100644 support/testing/tests/download/git-remote/repo.git/HEAD create mode 100644 support/testing/tests/download/git-remote/repo.git/config create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/a2/38b1dfcd825d47d834af3c5223417c8411d90d create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 create mode 100644 support/testing/tests/download/git-remote/repo.git/refs/heads/master create mode 100644 support/testing/tests/download/gitremote.py create mode 100644 support/testing/tests/download/test_git.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e80491cdde..27b0255343 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -263,6 +263,7 @@ tests.core.test_rootfs_overlay.TestRootfsOverlay: *runtime_test tests.core.test_timezone.TestGlibcAllTimezone: *runtime_test tests.core.test_timezone.TestGlibcNonDefaultLimitedTimezone: *runtime_test tests.core.test_timezone.TestNoTimezone: *runtime_test +tests.download.test_git.TestGitHash: *runtime_test tests.fs.test_ext.TestExt2: *runtime_test tests.fs.test_ext.TestExt2r1: *runtime_test tests.fs.test_ext.TestExt3: *runtime_test diff --git a/support/testing/tests/download/__init__.py b/support/testing/tests/download/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/support/testing/tests/download/br2-external/git-hash/Config.in b/support/testing/tests/download/br2-external/git-hash/Config.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/support/testing/tests/download/br2-external/git-hash/external.desc b/support/testing/tests/download/br2-external/git-hash/external.desc new file mode 100644 index 0000000000..41316c8b25 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/external.desc @@ -0,0 +1 @@ +name: GIT_HASH diff --git a/support/testing/tests/download/br2-external/git-hash/external.mk b/support/testing/tests/download/br2-external/git-hash/external.mk new file mode 100644 index 0000000000..4646dfe2b0 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/external.mk @@ -0,0 +1,4 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_GIT_HASH_PATH)/package/*/*.mk)) + +# Get the git server port number from the test infra +GITREMOTE_PORT_NUMBER ?= 9418 diff --git a/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash new file mode 100644 index 0000000000..b9e1baec84 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash @@ -0,0 +1 @@ +sha256 0000000000000000000000000000000000000000000000000000000000000000 bad-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz diff --git a/support/testing/tests/download/br2-external/git-hash/package/bad/bad.mk b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.mk new file mode 100644 index 0000000000..5497bd6bfe --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.mk @@ -0,0 +1,10 @@ +################################################################################ +# +# bad +# +################################################################################ + +BAD_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +BAD_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-hash/package/good/good.hash b/support/testing/tests/download/br2-external/git-hash/package/good/good.hash new file mode 100644 index 0000000000..9e92ab8ab9 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/package/good/good.hash @@ -0,0 +1 @@ +sha256 d00ae598e9e770d607621a86766030b42eaa58156cb8d482b043969da7963c23 good-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz diff --git a/support/testing/tests/download/br2-external/git-hash/package/good/good.mk b/support/testing/tests/download/br2-external/git-hash/package/good/good.mk new file mode 100644 index 0000000000..0f0eefd944 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/package/good/good.mk @@ -0,0 +1,10 @@ +################################################################################ +# +# good +# +################################################################################ + +GOOD_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +GOOD_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-hash/package/nohash/nohash.mk b/support/testing/tests/download/br2-external/git-hash/package/nohash/nohash.mk new file mode 100644 index 0000000000..1da19d88c6 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-hash/package/nohash/nohash.mk @@ -0,0 +1,10 @@ +################################################################################ +# +# nohash +# +################################################################################ + +NOHASH_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +NOHASH_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/git-remote/repo.git/.gitattributes b/support/testing/tests/download/git-remote/repo.git/.gitattributes new file mode 100644 index 0000000000..eb50c64a21 --- /dev/null +++ b/support/testing/tests/download/git-remote/repo.git/.gitattributes @@ -0,0 +1 @@ +objects/*/* binary diff --git a/support/testing/tests/download/git-remote/repo.git/HEAD b/support/testing/tests/download/git-remote/repo.git/HEAD new file mode 100644 index 0000000000..cb089cd89a --- /dev/null +++ b/support/testing/tests/download/git-remote/repo.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/support/testing/tests/download/git-remote/repo.git/config b/support/testing/tests/download/git-remote/repo.git/config new file mode 100644 index 0000000000..07d359d07c --- /dev/null +++ b/support/testing/tests/download/git-remote/repo.git/config @@ -0,0 +1,4 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true diff --git a/support/testing/tests/download/git-remote/repo.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab b/support/testing/tests/download/git-remote/repo.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab new file mode 100644 index 0000000000000000000000000000000000000000..9db72668cf9374b0b85a25a19f30084fd460072d GIT binary patch literal 49 zcmb starting git remote with '{}'\n".format(" ".join(cmd))) + self.daemon = pexpect.spawn(cmd[0], cmd[1:], logfile=self.logfile) + ret = self.daemon.expect(["Ready to rumble", + "Address already in use"]) + if ret == 0: + self.port = port + return + raise SystemError("Could not find a free port to run git remote") + + def stop(self): + if self.daemon is None: + return + self.daemon.terminate(force=True) diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py new file mode 100644 index 0000000000..14fc8e4da3 --- /dev/null +++ b/support/testing/tests/download/test_git.py @@ -0,0 +1,43 @@ +import os + +import infra +from gitremote import GitRemote + + +class GitTestBase(infra.basetest.BRTest): + config = \ + """ + BR2_BACKUP_SITE="" + """ + gitremotedir = infra.filepath("tests/download/git-remote") + gitremote = None + + def setUp(self): + super(GitTestBase, self).setUp() + self.gitremote = GitRemote(self.builddir, self.gitremotedir, self.logtofile) + + def tearDown(self): + self.show_msg("Cleaning up") + if self.gitremote: + self.gitremote.stop() + if self.b and not self.keepbuilds: + self.b.delete() + + def check_hash(self, package): + # store downloaded tarball inside the output dir so the test infra + # cleans it up at the end + env = {"BR2_DL_DIR": os.path.join(self.builddir, "dl"), + "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)} + self.b.build(["{}-dirclean".format(package), + "{}-source".format(package)], + env) + + +class TestGitHash(GitTestBase): + br2_external = [infra.filepath("tests/download/br2-external/git-hash")] + + def test_run(self): + with self.assertRaises(SystemError): + self.check_hash("bad") + self.check_hash("good") + self.check_hash("nohash") From patchwork Sat May 12 02:58:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912357 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ctbQGBtR"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrx0CL9z9s19 for ; Sat, 12 May 2018 12:59:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 584EE87610; Sat, 12 May 2018 02:59:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t2teTADwljH1; Sat, 12 May 2018 02:59:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 31A40884EB; Sat, 12 May 2018 02:59:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0F4711C29B1 for ; Sat, 12 May 2018 02:59:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0C1B38A2FD for ; Sat, 12 May 2018 02:59:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kBX-W8BKv0-9 for ; Sat, 12 May 2018 02:59:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id C24C18A2FC for ; Sat, 12 May 2018 02:59:08 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id d125-v6so5936402qkb.8 for ; Fri, 11 May 2018 19:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=lIQqQt58d+1EmyX2U7xctezHv6lm/Ay5/TdqdXLWwXI=; b=ctbQGBtRrlS3zc4BjC+Br+v0EpQu5Kr9C/QPLVS49N64xGsd8d9zFTR+0OnBHicEAk SZPce1l+A0fG7tGFgyL2iccNYt9tt/iFGh5QmaAe4z4sgdiQ8xDxvThgi2kCnq+p0i/C 6CO8+rlUbIqhslHEpozsrQTU5XnXswVaQzFp8C7/I4k5NLoXi3869awBdznLRzD2pdKs /WNJ/1Kg7P1XYwIuSEjkvmwSqWSZQnUmjeK04/pMZLO4VCZVu49yWI8VGSLgYIn8zJZO ykW5+JWBnOItFJVZnDHepAXAR62VZcUSaOOAKplWETl9nK+xMWnwJBulEqZ0UU9vU4s5 wmoQ== 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:in-reply-to :references:in-reply-to:references; bh=lIQqQt58d+1EmyX2U7xctezHv6lm/Ay5/TdqdXLWwXI=; b=ZbcP+SF2jnSuIgtPWwqP9n5Qp0KmQGmSQcBfPy9sRKpyNkOob7Iw3McCY3+fDvKLPN YP7ZhHxZQTCon/bZ/C52Zkm/bd241I1niBvrpPYbE+yTNWgwhDkfDHFBf3gjPheTCqjn d8sS+N4WnANxBahrf5z0snO9ATy87KadJrh4CfGGFA53msQMqOsxvksBkml0nLhcDdMH 6Hq7HpDHGTVa7TNeolmFpwHMhguMqCsFpmZn5j1nMN7senO9dlCK56ITYAyTFSSkLWom 0zCIpf0u7pbs6tzo3JXpRUA5wgFnH5tcof1eSp1LfUOEBDfq9bRqtm6z+NpqZ3GNIgo7 yU/w== X-Gm-Message-State: ALKqPwecWHDfHlCynqh5cYt7szqjkZHZtQqIzCmI3Ru+ko3h8gGMuuck mWuL9m7ZHkTj8Z8ioXWF0p1HXA== X-Google-Smtp-Source: AB8JxZoCYYD/NR3bFXPXC+9g6ORBuNBCyYPaBvTJo1eSFcbZhb0cl2WEu95iKFPdck8z4b57jSCMzQ== X-Received: by 2002:a37:1395:: with SMTP id 21-v6mr454175qkt.253.1526093947612; Fri, 11 May 2018 19:59:07 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:07 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:28 -0300 Message-Id: <20180512025833.22998-6-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 05/10] testing/tests/download: test case for git refs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski All upcoming tests for git refs will rely on the return code of make to determine whether a git ref can be downloaded or not and also to determine whether the downloaded content is correct (all of this taking advantage of the check-hash mechanism already in place for git packages). So to avoid false results i.e. in the case the check-hash mechanism become broken in the master branch, add some sanity checks before the actual test of download git refs. Add the minimum test case for git refs containing only sanity checks. Reuse the commit in the static repo. Add a br2-external with two packages to check that: - trying to download an invalid sha1 generates an error; - downloading a valid sha1 that contains unexpected content generates an error. In order to ease the maintenance and review, each upcoming patch adding checks to this test case will add at same time the commits to the static repo, the equivalent packages to the br2-external and code to the test case. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repo with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * a238b1d (HEAD -> master) initial Changes v4 -> v5: - no changes Changes v3 -> v4: - move useful methods to the git base class; - br2_external is now a list; Changes v2 -> v3: - rewrite from v2, using an static repo; - separate on this patch the bare minimum static repo (actually reuse from previous commit), the next patches on the series will gradually add new commits to the static repo together to the equivalent packages and call to check_download. This approach allows better maintenance, even during the review of the series, because a patch can be more easily reworked/discarded/reordered; Changes v1 -> v2: - rename the main test file to testgit (Arnout). Actually I broke it down to a common gitbase and the two test_git_refs and test_git_hash (this last one is new, in the previous patch); - remove some weird/wrong TODO I had in v1 code (Arnout); - use the same structure for test cases as used in the test infra; - raise an exception when the download fails (Arnout). I did not add code for this since I let the builder class to raise it; - I reimplemented git_util as gitrepo. Arnout suggested to use it as module and I first implemented that way locally, but then I created test cases for submodules and I realized now I have a reason to use a class (see next patch); - move package (now called foo) to a BR2_EXTERNAL (Arnout); - override BR2_DL_DIR when calling make (Arnout); - the test infra uses O= so I don't need to; - instead of removing the files in the dl/ folder, use a different dir as dl/ dir since now each repo has a different name; - open the tarball to check its contents (Arnout). I create a fresh clone of the repo before the test to compare against; - this patch is not checking for the actual sha1 anymore, it can be done later. But the check for the contents should cover most cases; - my old argument to not test only the support/download/dl-wrapper is not valid anymore since I mimic the logic from the scripts to know the name of the tarball. But I still think calling make ...-source has better maintenance. And also the previous patch (test for hash of packages with git method) can use the same base class; - this patch is part of series 1/3 of a new version of http://patchwork.ozlabs.org/patch/690097/ --- .gitlab-ci.yml | 1 + .../download/br2-external/git-refs/Config.in | 0 .../br2-external/git-refs/external.desc | 1 + .../br2-external/git-refs/external.mk | 4 ++++ .../git-wrong-content/git-wrong-content.hash | 2 ++ .../git-wrong-content/git-wrong-content.mk | 11 +++++++++++ .../package/git-wrong-sha1/git-wrong-sha1.mk | 11 +++++++++++ support/testing/tests/download/test_git.py | 19 +++++++++++++++++++ 8 files changed, 49 insertions(+) create mode 100644 support/testing/tests/download/br2-external/git-refs/Config.in create mode 100644 support/testing/tests/download/br2-external/git-refs/external.desc create mode 100644 support/testing/tests/download/br2-external/git-refs/external.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-wrong-sha1/git-wrong-sha1.mk diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27b0255343..61ccfdfd2d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -264,6 +264,7 @@ tests.core.test_timezone.TestGlibcAllTimezone: *runtime_test tests.core.test_timezone.TestGlibcNonDefaultLimitedTimezone: *runtime_test tests.core.test_timezone.TestNoTimezone: *runtime_test tests.download.test_git.TestGitHash: *runtime_test +tests.download.test_git.TestGitRefs: *runtime_test tests.fs.test_ext.TestExt2: *runtime_test tests.fs.test_ext.TestExt2r1: *runtime_test tests.fs.test_ext.TestExt3: *runtime_test diff --git a/support/testing/tests/download/br2-external/git-refs/Config.in b/support/testing/tests/download/br2-external/git-refs/Config.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/support/testing/tests/download/br2-external/git-refs/external.desc b/support/testing/tests/download/br2-external/git-refs/external.desc new file mode 100644 index 0000000000..69f40d46c6 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/external.desc @@ -0,0 +1 @@ +name: GIT_REFS diff --git a/support/testing/tests/download/br2-external/git-refs/external.mk b/support/testing/tests/download/br2-external/git-refs/external.mk new file mode 100644 index 0000000000..ab38c27eb7 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/external.mk @@ -0,0 +1,4 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_GIT_REFS_PATH)/package/*/*.mk)) + +# Get the git server port number from the test infra +GITREMOTE_PORT_NUMBER ?= 9418 diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash new file mode 100644 index 0000000000..47b2b8b7d7 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash @@ -0,0 +1,2 @@ + sha256 04715901977503d1df650e0959f4d31d8e7b105e2ac99a2182e0652b8f13baa1 git-wrong-content-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz + sha256 0000000000000000000000000000000000000000000000000000000000000000 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.mk b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.mk new file mode 100644 index 0000000000..786224dad9 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-wrong-content +# +################################################################################ + +GIT_WRONG_CONTENT_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +GIT_WRONG_CONTENT_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_WRONG_CONTENT_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-wrong-sha1/git-wrong-sha1.mk b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-sha1/git-wrong-sha1.mk new file mode 100644 index 0000000000..f9d0d2226c --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-sha1/git-wrong-sha1.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-wrong-sha1 +# +################################################################################ + +GIT_WRONG_SHA1_VERSION = 0000000000000000000000000000000000000000 +GIT_WRONG_SHA1_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_WRONG_SHA1_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py index 14fc8e4da3..fdfc858233 100644 --- a/support/testing/tests/download/test_git.py +++ b/support/testing/tests/download/test_git.py @@ -32,6 +32,15 @@ class GitTestBase(infra.basetest.BRTest): "{}-source".format(package)], env) + def check_download(self, package): + # store downloaded tarball inside the output dir so the test infra + # cleans it up at the end + env = {"BR2_DL_DIR": os.path.join(self.builddir, "dl"), + "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)} + self.b.build(["{}-dirclean".format(package), + "{}-legal-info".format(package)], + env) + class TestGitHash(GitTestBase): br2_external = [infra.filepath("tests/download/br2-external/git-hash")] @@ -41,3 +50,13 @@ class TestGitHash(GitTestBase): self.check_hash("bad") self.check_hash("good") self.check_hash("nohash") + + +class TestGitRefs(GitTestBase): + br2_external = [infra.filepath("tests/download/br2-external/git-refs")] + + def test_run(self): + with self.assertRaises(SystemError): + self.check_download("git-wrong-content") + with self.assertRaises(SystemError): + self.check_download("git-wrong-sha1") From patchwork Sat May 12 02:58:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912359 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="k9M1dDhb"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWs30sMgz9s19 for ; Sat, 12 May 2018 12:59:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BB01030167; Sat, 12 May 2018 02:59:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HL5AvAwhnB-G; Sat, 12 May 2018 02:59:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2F9F522647; Sat, 12 May 2018 02:59:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CDE401CF106 for ; Sat, 12 May 2018 02:59:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C6BD588623 for ; Sat, 12 May 2018 02:59:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vx99oWyUR7u4 for ; Sat, 12 May 2018 02:59:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id F0B0A87610 for ; Sat, 12 May 2018 02:59:11 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id s83-v6so817226qke.7 for ; Fri, 11 May 2018 19:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=0Io39j+CefyfwugyDbb2KmKnzdeKYKuonIQsAQbuqcE=; b=k9M1dDhbgjYywyNQEh7E1ZZZLoJPUDFAkXpGaRT/448/EYEMDOT9EOIhTipqHeNXVs sMb1ut9HQiTuxMLjEn4BsLOkimKwkz//gjB1qH1PxZNaA6dR2vz9NeJUYtYer6h7yGzC +WtRU4gOuAF7HTPSbg/o4EXIEXtBCukPw2r+hxT07cQmXJ9XosTlek9jf/nBy9IU4LAI 4fQiMVRwubMNM7mz7PmOHLgJQ5bjbZSr7vBE0T8BSYZa7w7VY5l8HDWMDC06EN4COj8K eBQi7xoLJo9n1l9ARme50pkNXl4BbATLvIjkmbFXIOSHxd7nSbFk1cvcHQmCbWrxB3N3 RibQ== 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:in-reply-to :references:in-reply-to:references; bh=0Io39j+CefyfwugyDbb2KmKnzdeKYKuonIQsAQbuqcE=; b=Bzgr8hcqbqygViVxW/HHq7DSuUMFFT3WPfXPgh9XNI/FlX0VWnBWhrzbRuwpqA5Y3W k9VLv2oziB+u8EWm9Swzo1UumlPLEbkyUu/1tfZLpU+kLr1bNlMdC4CfddoY6sQWMtvV bbgkSGDuEYJfLcJRrJkqg+1ewCdWGBDivSIl9vGOn62Sl5DDeoeOlBfwZKzpiWPMmGBc PbQGw+rv1h8bRQVMiR8K9NLnwChj0bPDUK4XbSaArg1GhA7uHtRHxQmm5TotOHGsVZsb sM1mQIpYXnC9wUaK21djOK7r+XtqucPCMOBBP4t0M1qEdDNxdtHF7leI28UJTW63QdY7 vvfw== X-Gm-Message-State: ALKqPwexf/yyYgVgI2v5JLnBaO+dbGMgnemWnDmmRulb3LMfggY/fsER kgvORo3wPXzTPHRs2hcIvXAnEg== X-Google-Smtp-Source: AB8JxZryzLVN+s+QLGMqSgC9DEzQK+9Hzy1EeCciyAHk3ClnKQpF9wJbL9ncqnXv0qpsp9xR7bU4wQ== X-Received: by 2002:a37:9285:: with SMTP id u127-v6mr474209qkd.261.1526093950670; Fri, 11 May 2018 19:59:10 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:10 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:29 -0300 Message-Id: <20180512025833.22998-7-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 06/10] testing/tests/download: test git branch X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add a branch to the static repo and check on the git refs test case the download of a git package: - with a sha1 reachable by a branch name, but not pointed by it, as version. This is the most common use case for git refs in the tree; - with a partial sha1 of a commit reachable by a branch as version; - with a sha1 of the commit head of a branch as version; - with a partial sha1 of the commit head of a branch as version; Enforce the download always occurs by removing the BR2_DL_DIR used for the tarballs generated by the git download infra. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repo with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * 68c197d (mybranch) branch2 * 3174063 branch1 * a238b1d (HEAD -> master) initial Changes v4 -> v5: - do not test a named branch, Buildroot does not support it; Changes v3 -> v4: - no functional changes; - fix old comment on the code; Changes v2 -> v3: - complete rewrite using a static repo; --- .../git-partial-sha1-branch-head.hash | 2 ++ .../git-partial-sha1-branch-head.mk | 11 +++++++++++ .../git-partial-sha1-reachable-by-branch.hash | 2 ++ .../git-partial-sha1-reachable-by-branch.mk | 11 +++++++++++ .../git-sha1-branch-head.hash | 2 ++ .../git-sha1-branch-head/git-sha1-branch-head.mk | 11 +++++++++++ .../git-sha1-reachable-by-branch.hash | 2 ++ .../git-sha1-reachable-by-branch.mk | 11 +++++++++++ .../11/93ff46343f4f6a0522e2b28b871e905178c1f0 | Bin 0 -> 23 bytes .../31/7406308d9259e2231bd0d6ddad3de3832bce08 | Bin 0 -> 182 bytes .../34/d1da713bf7de1c535e1d7d3ca985afd84bc7e5 | Bin 0 -> 23 bytes .../68/c197d0879d485f4f6cee85544722b79e68e59f | Bin 0 -> 184 bytes .../b2/4b387624edc78d0292a127c43cad9ba97c6232 | Bin 0 -> 49 bytes .../e2/cfe068f7e5bf4de32ffe1241da53abce9fa89e | Bin 0 -> 49 bytes .../git-remote/repo.git/refs/heads/mybranch | 1 + support/testing/tests/download/test_git.py | 11 ++++++++++- 16 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.mk create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/11/93ff46343f4f6a0522e2b28b871e905178c1f0 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/31/7406308d9259e2231bd0d6ddad3de3832bce08 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/34/d1da713bf7de1c535e1d7d3ca985afd84bc7e5 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/68/c197d0879d485f4f6cee85544722b79e68e59f create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/b2/4b387624edc78d0292a127c43cad9ba97c6232 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/e2/cfe068f7e5bf4de32ffe1241da53abce9fa89e create mode 100644 support/testing/tests/download/git-remote/repo.git/refs/heads/mybranch diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash new file mode 100644 index 0000000000..648bcceca0 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash @@ -0,0 +1,2 @@ +sha256 70b76187369e47db69dac02c5696e63b35199cd20490fa473d289dd377774613 git-partial-sha1-branch-head-68c197d0879d485f4f6c.tar.gz +sha256 2c1126513651b0d346a4e6d1bb75ac1c9999217e18026302d27bea47b06c7fb2 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.mk b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.mk new file mode 100644 index 0000000000..6d4177c5bf --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-partial-sha1-branch-head +# +################################################################################ + +GIT_PARTIAL_SHA1_BRANCH_HEAD_VERSION = 68c197d0879d485f4f6c +GIT_PARTIAL_SHA1_BRANCH_HEAD_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_PARTIAL_SHA1_BRANCH_HEAD_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash new file mode 100644 index 0000000000..d064362e2c --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash @@ -0,0 +1,2 @@ +sha256 9db079b9e215799d59975db7b2b26671eff1932ee6cf1075296f2ace3e2cb746 git-partial-sha1-reachable-by-branch-317406308d9259e2231b.tar.gz +sha256 fabbc65c442bacb5e69b7adfea6d14fbbfc1327134322efd12771dc84387d507 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.mk b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.mk new file mode 100644 index 0000000000..2f65b5c9a9 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-partial-sha1-reachable-by-branch +# +################################################################################ + +GIT_PARTIAL_SHA1_REACHABLE_BY_BRANCH_VERSION = 317406308d9259e2231b +GIT_PARTIAL_SHA1_REACHABLE_BY_BRANCH_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_PARTIAL_SHA1_REACHABLE_BY_BRANCH_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash new file mode 100644 index 0000000000..3e8f76d31a --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash @@ -0,0 +1,2 @@ +sha256 a21a2507b6d94ad484e49e3a9ae698f672a57469aab8e1779da77df7c9d4d337 git-sha1-branch-head-68c197d0879d485f4f6cee85544722b79e68e59f.tar.gz +sha256 2c1126513651b0d346a4e6d1bb75ac1c9999217e18026302d27bea47b06c7fb2 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.mk b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.mk new file mode 100644 index 0000000000..d3ecaa8593 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-sha1-branch-head +# +################################################################################ + +GIT_SHA1_BRANCH_HEAD_VERSION = 68c197d0879d485f4f6cee85544722b79e68e59f +GIT_SHA1_BRANCH_HEAD_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SHA1_BRANCH_HEAD_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash new file mode 100644 index 0000000000..f8d7b5dc48 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash @@ -0,0 +1,2 @@ +sha256 8909e76d898e651af0bc23fae4103b87888bfe77448d71aaf1fbec3da97a3ce2 git-sha1-reachable-by-branch-317406308d9259e2231bd0d6ddad3de3832bce08.tar.gz +sha256 fabbc65c442bacb5e69b7adfea6d14fbbfc1327134322efd12771dc84387d507 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.mk b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.mk new file mode 100644 index 0000000000..badf9e13ca --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-sha1-reachable-by-branch +# +################################################################################ + +GIT_SHA1_REACHABLE_BY_BRANCH_VERSION = 317406308d9259e2231bd0d6ddad3de3832bce08 +GIT_SHA1_REACHABLE_BY_BRANCH_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SHA1_REACHABLE_BY_BRANCH_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/git-remote/repo.git/objects/11/93ff46343f4f6a0522e2b28b871e905178c1f0 b/support/testing/tests/download/git-remote/repo.git/objects/11/93ff46343f4f6a0522e2b28b871e905178c1f0 new file mode 100644 index 0000000000000000000000000000000000000000..3541cd14f0bf5f3a172f868c7ec730dcc255ebd2 GIT binary patch literal 23 fcmbAT(SQY{RanuOb literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/31/7406308d9259e2231bd0d6ddad3de3832bce08 b/support/testing/tests/download/git-remote/repo.git/objects/31/7406308d9259e2231bd0d6ddad3de3832bce08 new file mode 100644 index 0000000000000000000000000000000000000000..c2c986572a7dec5f263e461155a09124d0f05844 GIT binary patch literal 182 zcmV;n07?IN0j#-;9k=lnv036+FLBVg-+p;}q4*8`RGo_IA)Vnl;DdW7doD k#;AurrYHYXPL%;0UaV55dfu3pF0z#G*T2lF9~m)jQ^MU{p#T5? literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/34/d1da713bf7de1c535e1d7d3ca985afd84bc7e5 b/support/testing/tests/download/git-remote/repo.git/objects/34/d1da713bf7de1c535e1d7d3ca985afd84bc7e5 new file mode 100644 index 0000000000000000000000000000000000000000..29f2d4fd004afa03b43e3148207e258e7aa9fc41 GIT binary patch literal 23 fcmbAT3SQY^Qam@(V literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/68/c197d0879d485f4f6cee85544722b79e68e59f b/support/testing/tests/download/git-remote/repo.git/objects/68/c197d0879d485f4f6cee85544722b79e68e59f new file mode 100644 index 0000000000000000000000000000000000000000..3e421bb97a40ab93592d94107f3a1258a99b76fa GIT binary patch literal 184 zcmV;p07w6L0j;n literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/b2/4b387624edc78d0292a127c43cad9ba97c6232 b/support/testing/tests/download/git-remote/repo.git/objects/b2/4b387624edc78d0292a127c43cad9ba97c6232 new file mode 100644 index 0000000000000000000000000000000000000000..20491e3f176096db13c0b0c7857406e1c4119619 GIT binary patch literal 49 zcmV-10M7q-0V^p=O;s>9VlXr?Ff%bxNXyJgWiYvTtI+!UJ(=J**;<>Gt?O@iAAbq} H3k46<$LbTr literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/e2/cfe068f7e5bf4de32ffe1241da53abce9fa89e b/support/testing/tests/download/git-remote/repo.git/objects/e2/cfe068f7e5bf4de32ffe1241da53abce9fa89e new file mode 100644 index 0000000000000000000000000000000000000000..57be6485778c7f743a82f71ef718103cecfd4f35 GIT binary patch literal 49 zcmb X-Patchwork-Id: 912356 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z4ZHn1Sj"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWrr1CCkz9s19 for ; Sat, 12 May 2018 12:59:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 80E518A348; Sat, 12 May 2018 02:59:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3RSxRa6Xy+Rn; Sat, 12 May 2018 02:59:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E4F238A2FD; Sat, 12 May 2018 02:59:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 49B121C29B1 for ; Sat, 12 May 2018 02:59:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 44789207AE for ; Sat, 12 May 2018 02:59:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p7V5GZqTfHHa for ; Sat, 12 May 2018 02:59:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by silver.osuosl.org (Postfix) with ESMTPS id DF6351FEED for ; Sat, 12 May 2018 02:59:15 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id l132-v6so5941816qke.3 for ; Fri, 11 May 2018 19:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=a/zMtYDDHK+Gc95yQlJNmMPBZXSpjQ8xd7R9KnAo39U=; b=Z4ZHn1SjhEz4lLopMjL2b6vhdaZF6acYnnR5d/xFQSvlAqhSKNgCMimQDAjGh9W+pz CP5ZsT5ljiYTNPoW5+XiMxYkSlFr2M6ilF8Nv4qFxmljuOPJ8jvAimPdDVTHLrkQJUy+ 200vpcnmbXLT9MYffgTqrPrLhHTtWxtSqhyat2yJJ0XlnaQwmWxso/MZSbQrmlWmCR7F hwLsDyCy+XXGLUWheBaeCBq4eZykHcPlkLt7+4nqBwk+Cuu6bgU0lBIGW8d481o0j++T rmxsk2JS2rINQh9/twfoomd8/B1WGFy9K96SnAUJjbHMcToQbvRDdr/hyQxgyjYpKfOS BGtA== 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:in-reply-to :references:in-reply-to:references; bh=a/zMtYDDHK+Gc95yQlJNmMPBZXSpjQ8xd7R9KnAo39U=; b=NITi6UT+FX66k/VvDKD2sIOH4v402seYOOozmIs04eUrMnJAzqd0/Jdb5jRqob/GjW J9eml4wB3zulKpjM9ePr+azilXSUttveU7Y+50PAf4qKiCPWpiUdSj2QD92CSrvIyXYx feGpcL2GFzguBp37vhXjtCfR5TYm7xwwDalkTsaBzt7swhZv2Oo2G6lCNZgxdtCM0duT HKb8n5e6WJ4aD4SL+Rw+MvoCVUv89JFFdXenMSRzHKIfVDZsgb+mr0m2BAAvp1QNvVDw c4+j1z1rEpXLVVryzlUeyjrB55zNEBAVaSxaW4Qj4ERNA7gE1M22iz695BpfayWUmwRq GluA== X-Gm-Message-State: ALKqPwdJBFWcq3YWGZT6aAyfzwzpudoPLAGUxZyptpFpeyyILMx6Cxq7 ZaU/0uMN7pF0BgHLvcRBwdIrIA== X-Google-Smtp-Source: AB8JxZpjjLU9gFBifReBWNW3dniEVSs+Xd6P4zWJ1PS8WiM0npa2kCRxEmnicuLPB/kw+tEF2kYigQ== X-Received: by 2002:a37:8e86:: with SMTP id q128-v6mr521878qkd.76.1526093954202; Fri, 11 May 2018 19:59:14 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:13 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:30 -0300 Message-Id: <20180512025833.22998-8-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 07/10] testing/tests/download: test git submodules X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Add two submodules as static repos, add a branch to the main static repo and check on the git refs test case the download of a git package: - repo with submodule but without support in the package; - repo with recursive submodules with support in the package. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repos with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * 2fa37f6 (submodule) sub0-2 * a9dbc1e sub0-1 | * 68c197d (mybranch) branch2 | * 3174063 branch1 |/ * a238b1d (HEAD -> master) initial $ git -C support/testing/tests/download/git-remote/refs-sub1.git \ log --all --decorate --graph --oneline --decorate * 1df823c (submodule) sub1-2 * f8001e5 sub1-1 * cb545fa (HEAD) initial $ git -C support/testing/tests/download/git-remote/refs-sub2.git \ log --all --decorate --graph --oneline --decorate * e83f6f8 (submodule) sub2-2 * cd4d62f sub2-1 * 32d61ba (HEAD) initial In this layout: - sub0-1 adds refs-sub1.git as submodule to refs.git pointing to sub1-1 commit; - sub1-1 adds refs-sub2.git as submodule to refs-sub1.git pointing to sub2-1 commit. Changes v4 -> v5: - no changes Changes v3 -> v4: - add hash for submodule enabled tarball; Changes v2 -> v3: - complete rewrite using a static repo; Changes v1 -> v2: - rewrite using new git test infra; - this patch is part of series 1/3 of a new version of http://patchwork.ozlabs.org/patch/690097/ --- .../git-submodule-disabled.hash | 2 ++ .../git-submodule-disabled.mk | 11 +++++++ .../git-submodule-enabled.hash | 4 +++ .../git-submodule-enabled.mk | 28 ++++++++++++++++++ .../git-remote/refs-sub1.git/.gitattributes | 1 + .../download/git-remote/refs-sub1.git/HEAD | 1 + .../download/git-remote/refs-sub1.git/config | 4 +++ .../07/cabc655213bdf7087d8dd50fda95124e935570 | Bin 0 -> 22 bytes .../1d/f823cb8a6d1866148ae50a8009762a9c4c777f | Bin 0 -> 180 bytes .../7d/52f458bdb0f9f5a4beb46fa82824421b8b988e | Bin 0 -> 65 bytes .../99/f2e3e1cb15f9b52fa29f66d380dda061d917ab | Bin 0 -> 49 bytes .../a1/30af1626bbadd64841b2cbcb6ac4ed0638ba1a | Bin 0 -> 122 bytes .../bc/c81ba6e5bd8bf52c95688ae8d3e697e131fa23 | Bin 0 -> 22 bytes .../cb/545facf77bbc5f24f95b6d503c338d10b7b717 | Bin 0 -> 151 bytes .../dd/130f6f4629514adaf2e03407f3ed9344eb6cd6 | Bin 0 -> 122 bytes .../e7/9c5e8f964493290a409888d5413a737e8e5dd5 | Bin 0 -> 23 bytes .../f8/001e5780100962a5e30a25cbc4c9609cfc7bf3 | Bin 0 -> 184 bytes .../refs-sub1.git/refs/heads/submodule | 1 + .../git-remote/refs-sub2.git/.gitattributes | 1 + .../download/git-remote/refs-sub2.git/HEAD | 1 + .../download/git-remote/refs-sub2.git/config | 4 +++ .../0a/846af45c3e455789435f49f80d70e86b65b9d7 | Bin 0 -> 22 bytes .../0b/32ebd8fc52cec991f18c94be980e85a8341585 | Bin 0 -> 22 bytes .../32/d61bae693af7879da63b89a60d3ae67f851e56 | Bin 0 -> 151 bytes .../3e/9b0a5198c64cea9c00f820433411e3b4d50c1c | Bin 0 -> 48 bytes .../85/8f666af75b7c0dfba6b8be7eac5f196e7a1221 | Bin 0 -> 49 bytes .../99/f2e3e1cb15f9b52fa29f66d380dda061d917ab | Bin 0 -> 49 bytes .../cd/4d62ff218ab7b4a04f5bfdf800ace087af3ceb | Bin 0 -> 184 bytes .../e7/9c5e8f964493290a409888d5413a737e8e5dd5 | Bin 0 -> 23 bytes .../e8/3f6f805bd016b90acafc8702c52d778eb57310 | Bin 0 -> 182 bytes .../refs-sub2.git/refs/heads/submodule | 1 + .../0b/d8ceb961c3b2b210f64a67d57f4b5cd669d343 | Bin 0 -> 22 bytes .../25/59d83bfe937fc0412d96ed664663c9e8a99055 | Bin 0 -> 22 bytes .../2f/a37f6885d7eb746df75eccaddbacf3ac82799d | Bin 0 -> 180 bytes .../8b/8a7e885a041da72b1ee9a47c5b9300b172a9e7 | Bin 0 -> 65 bytes .../a9/dbc1e23c45e8e1b88c0448763f54d714eb6f8f | Bin 0 -> 183 bytes .../d4/e2941d18a63535400476324ddeb7f40164be41 | Bin 0 -> 121 bytes .../fe/74231105841041d5f441e70399d37f0e600aa5 | Bin 0 -> 121 bytes .../git-remote/repo.git/refs/heads/submodule | 1 + support/testing/tests/download/test_git.py | 2 ++ 40 files changed, 62 insertions(+) create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.mk create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/.gitattributes create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/HEAD create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/config create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/07/cabc655213bdf7087d8dd50fda95124e935570 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/1d/f823cb8a6d1866148ae50a8009762a9c4c777f create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/7d/52f458bdb0f9f5a4beb46fa82824421b8b988e create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/a1/30af1626bbadd64841b2cbcb6ac4ed0638ba1a create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/bc/c81ba6e5bd8bf52c95688ae8d3e697e131fa23 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/cb/545facf77bbc5f24f95b6d503c338d10b7b717 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/dd/130f6f4629514adaf2e03407f3ed9344eb6cd6 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/objects/f8/001e5780100962a5e30a25cbc4c9609cfc7bf3 create mode 100644 support/testing/tests/download/git-remote/refs-sub1.git/refs/heads/submodule create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/.gitattributes create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/HEAD create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/config create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/0a/846af45c3e455789435f49f80d70e86b65b9d7 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/0b/32ebd8fc52cec991f18c94be980e85a8341585 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/32/d61bae693af7879da63b89a60d3ae67f851e56 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/3e/9b0a5198c64cea9c00f820433411e3b4d50c1c create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/85/8f666af75b7c0dfba6b8be7eac5f196e7a1221 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/cd/4d62ff218ab7b4a04f5bfdf800ace087af3ceb create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/objects/e8/3f6f805bd016b90acafc8702c52d778eb57310 create mode 100644 support/testing/tests/download/git-remote/refs-sub2.git/refs/heads/submodule create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/0b/d8ceb961c3b2b210f64a67d57f4b5cd669d343 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/25/59d83bfe937fc0412d96ed664663c9e8a99055 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/2f/a37f6885d7eb746df75eccaddbacf3ac82799d create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/8b/8a7e885a041da72b1ee9a47c5b9300b172a9e7 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/a9/dbc1e23c45e8e1b88c0448763f54d714eb6f8f create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/d4/e2941d18a63535400476324ddeb7f40164be41 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/fe/74231105841041d5f441e70399d37f0e600aa5 create mode 100644 support/testing/tests/download/git-remote/repo.git/refs/heads/submodule diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash new file mode 100644 index 0000000000..3bd0a44693 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash @@ -0,0 +1,2 @@ +sha256 f9d46ff8a1a344c6c31fa4211220f3085c446abd31626232540703158276f22c git-submodule-disabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f.tar.gz +sha256 ba8b6ddc4726bfb6a05045ebfd8c43263c968ad1bc601bd46a25bc055008eddc file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.mk b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.mk new file mode 100644 index 0000000000..7a35b3b51a --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-submodule-disabled +# +################################################################################ + +GIT_SUBMODULE_DISABLED_VERSION = a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f +GIT_SUBMODULE_DISABLED_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SUBMODULE_DISABLED_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash new file mode 100644 index 0000000000..089eed2365 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash @@ -0,0 +1,4 @@ +sha256 139a34c3c844c844dee74b6746418cfa75fbcc4205794ac8c0b3cd7d55a76792 git-submodule-enabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f.tar.gz +sha256 ba8b6ddc4726bfb6a05045ebfd8c43263c968ad1bc601bd46a25bc055008eddc file +sha256 5219dcb50c7753bcdd72bc68a7b48af33ac2e42c5c61de78a9dd81589c4d50b6 refs-sub1/file +sha256 b93c1fa9014d25a17fee36771d26ae023f043da656315ffe8947c30ad1ba141f refs-sub1/refs-sub2/file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.mk b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.mk new file mode 100644 index 0000000000..019dd076e3 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.mk @@ -0,0 +1,28 @@ +################################################################################ +# +# git-submodule-enabled +# +################################################################################ + +GIT_SUBMODULE_ENABLED_VERSION = a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f +GIT_SUBMODULE_ENABLED_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SUBMODULE_ENABLED_GIT_SUBMODULES = YES +GIT_SUBMODULE_ENABLED_LICENSE_FILES = \ + file \ + refs-sub1/file \ + refs-sub1/refs-sub2/file + +# Some versions of git client fill the .git file for the second level submodule +# using the absolute path to the main .git directory, which in the case of the +# buildroot download helper is always different since it uses a temporary +# directory. This version of git have the issue: +# - 2.7.4 included in Ubuntu 16.04; +# The same does not occur using newer versions of git: +# - 2.11.0 included in Debian 9; +# - 2.14.2 latest at the time of writing; +# In order to allow running this test case locally in many systems, do not check +# for the hash of the tarball, but instead check the hash of each meaningful +# file included in the tarball. +BR_NO_CHECK_HASH_FOR += $(GIT_SUBMODULE_ENABLED_SOURCE) + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/.gitattributes b/support/testing/tests/download/git-remote/refs-sub1.git/.gitattributes new file mode 100644 index 0000000000..eb50c64a21 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub1.git/.gitattributes @@ -0,0 +1 @@ +objects/*/* binary diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/HEAD b/support/testing/tests/download/git-remote/refs-sub1.git/HEAD new file mode 100644 index 0000000000..4e92c1f200 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub1.git/HEAD @@ -0,0 +1 @@ +cb545facf77bbc5f24f95b6d503c338d10b7b717 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/config b/support/testing/tests/download/git-remote/refs-sub1.git/config new file mode 100644 index 0000000000..07d359d07c --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub1.git/config @@ -0,0 +1,4 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/07/cabc655213bdf7087d8dd50fda95124e935570 b/support/testing/tests/download/git-remote/refs-sub1.git/objects/07/cabc655213bdf7087d8dd50fda95124e935570 new file mode 100644 index 0000000000000000000000000000000000000000..cbf5085af8cdca19c43017c92369ddc8002f1a3d GIT binary patch literal 22 dcmbUJ21Qop+W=aH2UY+8 literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/1d/f823cb8a6d1866148ae50a8009762a9c4c777f b/support/testing/tests/download/git-remote/refs-sub1.git/objects/1d/f823cb8a6d1866148ae50a8009762a9c4c777f new file mode 100644 index 0000000000000000000000000000000000000000..04055b899ecbdc3bceb2d7936757f360e90544a5 GIT binary patch literal 180 zcmV;l089UP0j-Wf4#FT106p^xK2WpJg47t}2fXMDb{9~h6hrag?``72yYV{7OomI& zsmWfORjVOLR6Sr+R$C(U-VSb1q?wp3@(?`O-VrJk53FHoGCBYi%*KHN7_CMVmVh>k zG4N<%AvQY_fi>fV64+lcAx>o iLYL_l{*)8*lT@dLIH$`Ld{<)Z=(YXjRlEVZ`fTHP_gG8- literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/7d/52f458bdb0f9f5a4beb46fa82824421b8b988e b/support/testing/tests/download/git-remote/refs-sub1.git/objects/7d/52f458bdb0f9f5a4beb46fa82824421b8b988e new file mode 100644 index 0000000000000000000000000000000000000000..2b78a01965068cc6f7c89402eea4e7f9a03ba807 GIT binary patch literal 65 zcmV-H0KWft0ZYosPf{>5V~8#;P0GzrDa}b$P%27IE7k?_jg(@!I13U>G8AkT;9^{y XrA0YF0X;o^xR_pgW(gMne83k7uwXDWFfcPQQP4}zEXmDJDa}bOW~dGN60vu~&#z1NZOLDu zq2eUnJ);k*EG;u9m4W@#p41@Wz27-%d$01}nkwWsIkdpg%m4@!ic-^xb&E@rj2O=P cCjD3J+P-ChfArrU3~L^=ueW&(03qxzkxyhgmjD0& literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/bc/c81ba6e5bd8bf52c95688ae8d3e697e131fa23 b/support/testing/tests/download/git-remote/refs-sub1.git/objects/bc/c81ba6e5bd8bf52c95688ae8d3e697e131fa23 new file mode 100644 index 0000000000000000000000000000000000000000..7d2a9d55c1a92dfa2122308cc05a4a5b96d70d8f GIT binary patch literal 22 dcmbB}CKEMC~ literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/dd/130f6f4629514adaf2e03407f3ed9344eb6cd6 b/support/testing/tests/download/git-remote/refs-sub1.git/objects/dd/130f6f4629514adaf2e03407f3ed9344eb6cd6 new file mode 100644 index 0000000000000000000000000000000000000000..37037d3920820ae2dab7e40d0c1df612af6f7a94 GIT binary patch literal 122 zcmV-=0EPc}0V^p=O;s>7uwXDWFfcPQQP4}zEXmDJDa}bOW~dGN60vu~&#z1NZOLDu zq2eUnJ);k*EG;u9m0`~b>19v%c7N5Gn$h**^0Vm=4Sy*cni&9rLQ!g3v2Jl`k`cpM c-=zPFUE8-T@Q?ocgJI2s_VqTe0l@My>J95W4gdfE literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 b/support/testing/tests/download/git-remote/refs-sub1.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 new file mode 100644 index 0000000000000000000000000000000000000000..df2037a2d2d30afb20e31cd558c92c2edabe7cf6 GIT binary patch literal 23 fcmbeEHo=7RuBigTc zdbzh&r$+0a<|suo8w3gBg5A7viIdm@=pYIf-q5*1A#+gQX_S5HOx}4(Sz;v0UaXVN zQ(zC65mz=qk)nwzUFSz1`dD)s-1U1Jv+lWHKC6BicRaKQzMWgDUx(b=t2Q21@L>hi m3s?Yk)7$hc|CCdgE1AV8b*ksR@X|#V`g#7#tNI184{X$IS6W&C literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub1.git/refs/heads/submodule b/support/testing/tests/download/git-remote/refs-sub1.git/refs/heads/submodule new file mode 100644 index 0000000000..bf97dc4185 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub1.git/refs/heads/submodule @@ -0,0 +1 @@ +1df823cb8a6d1866148ae50a8009762a9c4c777f diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/.gitattributes b/support/testing/tests/download/git-remote/refs-sub2.git/.gitattributes new file mode 100644 index 0000000000..eb50c64a21 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub2.git/.gitattributes @@ -0,0 +1 @@ +objects/*/* binary diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/HEAD b/support/testing/tests/download/git-remote/refs-sub2.git/HEAD new file mode 100644 index 0000000000..bbf19a4bb4 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub2.git/HEAD @@ -0,0 +1 @@ +32d61bae693af7879da63b89a60d3ae67f851e56 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/config b/support/testing/tests/download/git-remote/refs-sub2.git/config new file mode 100644 index 0000000000..07d359d07c --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub2.git/config @@ -0,0 +1,4 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/objects/0a/846af45c3e455789435f49f80d70e86b65b9d7 b/support/testing/tests/download/git-remote/refs-sub2.git/objects/0a/846af45c3e455789435f49f80d70e86b65b9d7 new file mode 100644 index 0000000000000000000000000000000000000000..aaa29dbd8a5a74a24f51a8522b695a7474349f3c GIT binary patch literal 22 dcmbnh7 FU@NX0KJNek literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/objects/3e/9b0a5198c64cea9c00f820433411e3b4d50c1c b/support/testing/tests/download/git-remote/refs-sub2.git/objects/3e/9b0a5198c64cea9c00f820433411e3b4d50c1c new file mode 100644 index 0000000000000000000000000000000000000000..b1fb722c53d827847c6d13029e601a5434b84ac4 GIT binary patch literal 48 zcmV-00MGw;0V^p=O;s>9VlXr?Ff%bxNXyJgW#DSb`VwR38s6y~@A-qb;6--o&g%g8 GZVq_HQWiM? literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/objects/85/8f666af75b7c0dfba6b8be7eac5f196e7a1221 b/support/testing/tests/download/git-remote/refs-sub2.git/objects/85/8f666af75b7c0dfba6b8be7eac5f196e7a1221 new file mode 100644 index 0000000000000000000000000000000000000000..10f24a087ff08320b8fc5922db728472bd276e9a GIT binary patch literal 49 zcmb3 literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab b/support/testing/tests/download/git-remote/refs-sub2.git/objects/99/f2e3e1cb15f9b52fa29f66d380dda061d917ab new file mode 100644 index 0000000000000000000000000000000000000000..9db72668cf9374b0b85a25a19f30084fd460072d GIT binary patch literal 49 zcmbnpQHpgm$pR@75A3{t50g_7*#(Vx@k>bP zbo2ooB)#*Jy;W?Tz~{KNF5e1aPffmJA7!Ps-HSZ+A3WAyyj&}mk0Z5umdb($>r7bW m1T%oxb&nqWPj_N_#(7dgyqD|BX=*u7@$=;`t>O#gcx)*r3s*J( literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 b/support/testing/tests/download/git-remote/refs-sub2.git/objects/e7/9c5e8f964493290a409888d5413a737e8e5dd5 new file mode 100644 index 0000000000000000000000000000000000000000..df2037a2d2d30afb20e31cd558c92c2edabe7cf6 GIT binary patch literal 23 fcmbfy8RY^ z{@h!u)9yV!%^_kFCJiBwM&y{GC{y6X5`{9VdkzxGdGE{*4cVs6Wi7$0dY6bJuLP?i zYtaNiSs+EyeHJ!!na4itXU#N9w;wcS-Eu#ls(l^*xNA3jKQyY}yWHEGbqEPCphLTW k2QXK?PEUDI&YUmo7jMj0J#12zuDbB=%RR5=4+?N@DHiEdA^-pY literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/refs-sub2.git/refs/heads/submodule b/support/testing/tests/download/git-remote/refs-sub2.git/refs/heads/submodule new file mode 100644 index 0000000000..39dc53f019 --- /dev/null +++ b/support/testing/tests/download/git-remote/refs-sub2.git/refs/heads/submodule @@ -0,0 +1 @@ +e83f6f805bd016b90acafc8702c52d778eb57310 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/0b/d8ceb961c3b2b210f64a67d57f4b5cd669d343 b/support/testing/tests/download/git-remote/repo.git/objects/0b/d8ceb961c3b2b210f64a67d57f4b5cd669d343 new file mode 100644 index 0000000000000000000000000000000000000000..ef7fbd4154aea755d8ee2684e420700467e9245c GIT binary patch literal 22 dcmbfX_pTQVgXFZ*LP9?v2|?W-`9y zoEleBZ(1ed0ZDFA1Yzu;w9*KG;8n@fvydbGOYBD68F&+@j z>O_rU6i9A}CNjIUTdDkc8ET5e-2otN7bXAz literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/a9/dbc1e23c45e8e1b88c0448763f54d714eb6f8f b/support/testing/tests/download/git-remote/repo.git/objects/a9/dbc1e23c45e8e1b88c0448763f54d714eb6f8f new file mode 100644 index 0000000000000000000000000000000000000000..2cbdce1f95493b284df1f8ca3ca953a5fb813072 GIT binary patch literal 183 zcmV;o07(CM0jRu$&;~&-~u5KipxZpJlJ^_>ocTx0A{CtxuHtpv)kOZ{w$R{aqq=Y5Kr@lr^^Nx#*Anz+HXf*Qs*3>|(2*8XW|19*ox$ l7yz~DHa*fm<<#}Iz=TR2%V|wAwVbErzJKLa{Q7uwXDWFfcPQQP4}zEXmDJDa}bOX6Wv!>xg2JU9K(na!F0} zWQL7JE1yG^rDf)%GN?x0u>Lo>{(z(Iw6|$)$tPc|oDgbgW&i{VMX71Uy2YhQh73O# b=2AU<WBpF}NR{H!

7uwXDWFfcPQQP4}zEXmDJDa}bOX6Wv!>xg2JU9K(na!F0} zWQL7JE1yG^rDf)%GH~BGw=?nZrcDChywb1Md&gYMyzFdfW&i{VMX71Uy2YhQh73O# b=2AU<WBwy!O?8)rGE literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/refs/heads/submodule b/support/testing/tests/download/git-remote/repo.git/refs/heads/submodule new file mode 100644 index 0000000000..e9f4f32c30 --- /dev/null +++ b/support/testing/tests/download/git-remote/repo.git/refs/heads/submodule @@ -0,0 +1 @@ +2fa37f6885d7eb746df75eccaddbacf3ac82799d diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py index 279d0ed8eb..803a50d054 100644 --- a/support/testing/tests/download/test_git.py +++ b/support/testing/tests/download/test_git.py @@ -69,3 +69,5 @@ class TestGitRefs(GitTestBase): self.check_download("git-partial-sha1-reachable-by-branch") self.check_download("git-sha1-branch-head") self.check_download("git-sha1-reachable-by-branch") + self.check_download("git-submodule-disabled") + self.check_download("git-submodule-enabled") From patchwork Sat May 12 02:58:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912358 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IffjIp7L"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWs06dKdz9s19 for ; Sat, 12 May 2018 12:59:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 14B038A34E; Sat, 12 May 2018 02:59:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5Dvvj1HB1F7W; Sat, 12 May 2018 02:59:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6E5848A346; Sat, 12 May 2018 02:59:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E461B1CF141 for ; Sat, 12 May 2018 02:59:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DE2DE88623 for ; Sat, 12 May 2018 02:59:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2SS-qORwFaHC for ; Sat, 12 May 2018 02:59:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com [209.85.220.172]) by whitealder.osuosl.org (Postfix) with ESMTPS id DEA588845F for ; Sat, 12 May 2018 02:59:18 +0000 (UTC) Received: by mail-qk0-f172.google.com with SMTP id c64-v6so5914660qkf.12 for ; Fri, 11 May 2018 19:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=z2Ycp+vm+60BRfhGJ7dec/dwGdoWbOvEmubXGYYA2ho=; b=IffjIp7LYpbPkfYu8CW1oSN06lbEUiVijnhGnbk4HwmN2hQVmEmvhwiAUiVD30OKiZ wU0uQaNpigRAh+6FX0CEjzKw54i4kJIwrWwANde9QPRgkO4ppm1LKidept1tHoRemxjY OnDGURWuvGJVuRr2cuBPrJg3+QQTpSYI9UejLiJMHQs9rxdu74k4hYduXgBcD9iToqRy hwEjC4kandwVgkRbo2EGDKMm0P6gT9RNClqizwNvdArcU9ejP/L2smnbBKbV452hNEyn aVyS7DUySrvriMudcdyxEjdnwdwFXzSpwropAkWC24qPrhMjVxkobGojkyNARxgMT28v cMrQ== 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:in-reply-to :references:in-reply-to:references; bh=z2Ycp+vm+60BRfhGJ7dec/dwGdoWbOvEmubXGYYA2ho=; b=SNp3b5tfXREL3KTNmTz8C8mpd6f/BGzDqQqtrHtl3Aa4HuZi06qjg0C5guLbSXDA9y 4F3LMmgLYDrYur57e5F7zguKxgNyEgH3CIqQ5ydTi2d18SA2peHvLbJxtRUzwSZ6NRwa shmJTLzUfhJRsEiZ+zDEO83tk2NnsmRAbjjLE9Z1o7BODkWIBLIfayxiIx23xl7Q11jY uoSDQpLxeZ9FqeQcDiXIvXaPTGGvZOeogM1tza63rUys4jKS4jSg2OOmVtwqus1cmD2b U1AoZll3SDBYGbV863n3Aq2OnyXtogj8AiCuScrM8RmwEjcBbKE79mlIXo7b+zOO3tpG DxZw== X-Gm-Message-State: ALKqPwdfGAuq2jyxiHJMKdKiEJ837uuh3C41LBOiA+cARhPs4Ug58gNJ GB30fci85B7n3ZSf46322Dwy9w== X-Google-Smtp-Source: AB8JxZphXa9YoGrb3EWasBrv+IYh3NfpAbuxtp4+4MNcNnBnsXC5Yb94qtrabUvCC6vgOdg+D4teVA== X-Received: by 2002:a37:8943:: with SMTP id l64-v6mr499262qkd.195.1526093957530; Fri, 11 May 2018 19:59:17 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:16 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:31 -0300 Message-Id: <20180512025833.22998-9-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 08/10] testing/tests/download: test git tag X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Add a tag to the static repo and check on the git refs test case the download of a git package: - with the name of a tag as version; - with the sha1 of a tag itself as version; - with the partial sha1 of a tag itself as version; - with the sha1 of a commit pointed by a tag as version; - with the partial sha1 of a commit pointed by a tag as version; - with the sha1 of a commit reachable only by a tag as version; - with the partial sha1 of a commit reachable only by a tag as version. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repo with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * 2fa37f6 (submodule) sub0-2 * a9dbc1e sub0-1 | * 68c197d (mybranch) branch2 | * 3174063 branch1 |/ | * 516c9c5 (tag: mytag) tag2 | * 46bae5b tag1 |/ * a238b1d (HEAD -> master) initial Changes v4 -> v5: - no changes Changes v1 -> v4: - not included on v2 or v3; - rewrite from v1 using new git test infra with static repo; --- .../git-partial-sha1-reachable-by-tag.hash | 2 ++ .../git-partial-sha1-reachable-by-tag.mk | 11 +++++++++++ .../git-partial-sha1-tag-itself.hash | 2 ++ .../git-partial-sha1-tag-itself.mk | 11 +++++++++++ .../git-partial-sha1-tag-points-to.hash | 2 ++ .../git-partial-sha1-tag-points-to.mk | 11 +++++++++++ .../git-sha1-reachable-by-tag.hash | 2 ++ .../git-sha1-reachable-by-tag.mk | 11 +++++++++++ .../git-sha1-tag-itself/git-sha1-tag-itself.hash | 2 ++ .../git-sha1-tag-itself/git-sha1-tag-itself.mk | 11 +++++++++++ .../git-sha1-tag-points-to.hash | 2 ++ .../git-sha1-tag-points-to.mk | 11 +++++++++++ .../git-refs/package/git-tag/git-tag.hash | 2 ++ .../git-refs/package/git-tag/git-tag.mk | 11 +++++++++++ .../2b/0e0d98a49c97da6a618ab36337e2058eb733a2 | Bin 0 -> 137 bytes .../46/bae5b639e5a18e2cc4dc508f080d566baeff59 | Bin 0 -> 182 bytes .../51/6c9c5f64ec66534d4d069c2e408d9ae4dce023 | Bin 0 -> 182 bytes .../92/ef85be57d627f280d8ce3724452ac21c9a6452 | Bin 0 -> 20 bytes .../cf/0f4f85d7a1237e377a2d25b996518a877ea001 | Bin 0 -> 49 bytes .../e2/2695cbf976fed1f543ad7486a531c0af473482 | Bin 0 -> 49 bytes .../f6/476b879f65e956d7dedd5b08736369e9a24acc | Bin 0 -> 20 bytes .../download/git-remote/repo.git/refs/tags/mytag | 1 + support/testing/tests/download/test_git.py | 7 +++++++ 23 files changed, 99 insertions(+) create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.mk create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.mk create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/2b/0e0d98a49c97da6a618ab36337e2058eb733a2 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/46/bae5b639e5a18e2cc4dc508f080d566baeff59 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/51/6c9c5f64ec66534d4d069c2e408d9ae4dce023 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/92/ef85be57d627f280d8ce3724452ac21c9a6452 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/cf/0f4f85d7a1237e377a2d25b996518a877ea001 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/e2/2695cbf976fed1f543ad7486a531c0af473482 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/f6/476b879f65e956d7dedd5b08736369e9a24acc create mode 100644 support/testing/tests/download/git-remote/repo.git/refs/tags/mytag diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash new file mode 100644 index 0000000000..7696086690 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash @@ -0,0 +1,2 @@ +sha256 f2ef9772f13a9ef9a2c7cde0795e179defb12320d1747fc8d2408748ef5844c2 git-partial-sha1-reachable-by-tag-46bae5b639e5a18e2cc4.tar.gz +sha256 2de87d77a2f226813f2d9bda906e970e4195605cdba6680443c0c04d89c532b6 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.mk b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.mk new file mode 100644 index 0000000000..05aa659dd2 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-partial-sha1-reachable-by-tag +# +################################################################################ + +GIT_PARTIAL_SHA1_REACHABLE_BY_TAG_VERSION = 46bae5b639e5a18e2cc4 +GIT_PARTIAL_SHA1_REACHABLE_BY_TAG_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_PARTIAL_SHA1_REACHABLE_BY_TAG_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash new file mode 100644 index 0000000000..e627caf91e --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash @@ -0,0 +1,2 @@ +sha256 721143b41b8e56cfd9025833f1602e900a490627db2504e5b4907baa23e0019e git-partial-sha1-tag-itself-2b0e0d98a49c97da6a61.tar.gz +sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.mk b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.mk new file mode 100644 index 0000000000..515492397e --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-partial-sha1-tag-itself +# +################################################################################ + +GIT_PARTIAL_SHA1_TAG_ITSELF_VERSION = 2b0e0d98a49c97da6a61 +GIT_PARTIAL_SHA1_TAG_ITSELF_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_PARTIAL_SHA1_TAG_ITSELF_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash new file mode 100644 index 0000000000..f957a0e23c --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash @@ -0,0 +1,2 @@ +sha256 0fbf7fe935f962ceaafcf8e0ffd25dd2a83752c3f0fd055a942a53f8c9235fa7 git-partial-sha1-tag-points-to-516c9c5f64ec66534d4d.tar.gz +sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.mk b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.mk new file mode 100644 index 0000000000..c810e81175 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-partial-sha1-tag-points-to +# +################################################################################ + +GIT_PARTIAL_SHA1_TAG_POINTS_TO_VERSION = 516c9c5f64ec66534d4d +GIT_PARTIAL_SHA1_TAG_POINTS_TO_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_PARTIAL_SHA1_TAG_POINTS_TO_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash new file mode 100644 index 0000000000..0eb0ca0917 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash @@ -0,0 +1,2 @@ +sha256 9b20256a3058221a8e91031f11700d9945ea84e8f328fa8e42e1cb9f7a30e3b2 git-sha1-reachable-by-tag-46bae5b639e5a18e2cc4dc508f080d566baeff59.tar.gz +sha256 2de87d77a2f226813f2d9bda906e970e4195605cdba6680443c0c04d89c532b6 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.mk b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.mk new file mode 100644 index 0000000000..b5fde7b586 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-sha1-reachable-by-tag +# +################################################################################ + +GIT_SHA1_REACHABLE_BY_TAG_VERSION = 46bae5b639e5a18e2cc4dc508f080d566baeff59 +GIT_SHA1_REACHABLE_BY_TAG_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SHA1_REACHABLE_BY_TAG_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash new file mode 100644 index 0000000000..48c1348538 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash @@ -0,0 +1,2 @@ +sha256 7d301c1a1054d6aee49193ca9e938f4da561ff73fb01719662865aa38bdc4361 git-sha1-tag-itself-2b0e0d98a49c97da6a618ab36337e2058eb733a2.tar.gz +sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.mk b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.mk new file mode 100644 index 0000000000..8914496653 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-sha1-tag-itself +# +################################################################################ + +GIT_SHA1_TAG_ITSELF_VERSION = 2b0e0d98a49c97da6a618ab36337e2058eb733a2 +GIT_SHA1_TAG_ITSELF_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SHA1_TAG_ITSELF_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash new file mode 100644 index 0000000000..3dcafc2094 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash @@ -0,0 +1,2 @@ +sha256 c1f9f5734529a31140a71c031534460811f001b4db37d26833f386358150ab47 git-sha1-tag-points-to-516c9c5f64ec66534d4d069c2e408d9ae4dce023.tar.gz +sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.mk b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.mk new file mode 100644 index 0000000000..adaae7329c --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-sha1-tag-points-to +# +################################################################################ + +GIT_SHA1_TAG_POINTS_TO_VERSION = 516c9c5f64ec66534d4d069c2e408d9ae4dce023 +GIT_SHA1_TAG_POINTS_TO_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SHA1_TAG_POINTS_TO_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash new file mode 100644 index 0000000000..1cd0b15f27 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash @@ -0,0 +1,2 @@ +sha256 85dcb5bcf9bed496688d0eb01c7a3ce05c5b46b984cc1e9e76a6dbefd976e6b3 git-tag-mytag.tar.gz +sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.mk b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.mk new file mode 100644 index 0000000000..6960ceb2cb --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-tag +# +################################################################################ + +GIT_TAG_VERSION = mytag +GIT_TAG_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_TAG_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/git-remote/repo.git/objects/2b/0e0d98a49c97da6a618ab36337e2058eb733a2 b/support/testing/tests/download/git-remote/repo.git/objects/2b/0e0d98a49c97da6a618ab36337e2058eb733a2 new file mode 100644 index 0000000000000000000000000000000000000000..39c913094a3f2d8d9d84cda13a89306bc577f982 GIT binary patch literal 137 zcmV;40CxX)0Y#2W4gw(%1zmHBzJQY+enMi57jWYZuxSY@gF!ZPdoi;C>?b~>q)Xk7kywIiBT%i*Ea*zQgRo4G|D>mM~NF;Gldo_ rTte%4q564dIJQkrwS8p7vHLZetG9^(b!0>2 zGJ%RkMU}xn=29RDyv_GM;VL klvPUH^&UO>pYFuO%?NR>+s=9Er7Y{$^IuBEH_8ueWztGniU0rr literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/92/ef85be57d627f280d8ce3724452ac21c9a6452 b/support/testing/tests/download/git-remote/repo.git/objects/92/ef85be57d627f280d8ce3724452ac21c9a6452 new file mode 100644 index 0000000000000000000000000000000000000000..1f2474ba3209802c0f297f390eb517b4419621f9 GIT binary patch literal 20 bcmb9VlXr?Ff%bxNXyJgWtjB7bzk^3^-m2q&Y7#YY8{f9l@bI1 H7n%=ExH=M# literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/objects/e2/2695cbf976fed1f543ad7486a531c0af473482 b/support/testing/tests/download/git-remote/repo.git/objects/e2/2695cbf976fed1f543ad7486a531c0af473482 new file mode 100644 index 0000000000000000000000000000000000000000..15d80c78fac8655d4dfe4b8b543076c8bd26408e GIT binary patch literal 49 zcmb X-Patchwork-Id: 912360 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C0jiAaxB"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWs60Y18z9s19 for ; Sat, 12 May 2018 12:59:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 565FB2F45F; Sat, 12 May 2018 02:59:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cXbU7WreoyEw; Sat, 12 May 2018 02:59:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D0F7E2FFFF; Sat, 12 May 2018 02:59:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F3FBD1CF17E for ; Sat, 12 May 2018 02:59:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EFC498845F for ; Sat, 12 May 2018 02:59:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ce28lZx1NhBR for ; Sat, 12 May 2018 02:59:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id 74F0285045 for ; Sat, 12 May 2018 02:59:21 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id s70-v6so5920956qks.13 for ; Fri, 11 May 2018 19:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=MfX0yhWWZ92Pb9GiRGMcg57UHKzhZOWn5kY7dovFFQA=; b=C0jiAaxBjgNFZgDdscBiL99mSQPLhDuIBPoa23QHqgOFyTnwzjMBvJN96ldX2//Nj6 9vXej4pVgve2zHtKy4YyE3y78N88iwGePnFDIP6RUL/oj4usWIXiMtf/yiEcd2xNZVkN xwNaovgUbDVEofiKH5Xfxe/gN90HVmMQMGGNJeG2VRgu/WyJeYSQqRDlJ+xVmqBbvkn8 Sb27BAgKVjGb+gSnjaQ2ulclRBeA0wDQtz4GYHt50QOaLrOyWdRdRawyTzF58Bg8vM/3 7JuontiIgUYkrDvpp/zlFH1MU1W41hhwv11VqviOyeoL2tqNzxlw/Q+2GG4/e8MtcNKN DNBw== 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:in-reply-to :references:in-reply-to:references; bh=MfX0yhWWZ92Pb9GiRGMcg57UHKzhZOWn5kY7dovFFQA=; b=uHNMc4BWx992PDAR4N+8T4pQeS/w+y4mJ60xNSv5LX30I4cyLDJ3YkpL8vgB9p4oQS ZD8YowsnGhv42m/hT82PKG13SxSY/gB6QlfACI0Ni2sPXrmw+qZw4Oc5MIikktm/ZXJd BVxKLEBPPf5SV3AMaOowBeWKanCGyW7yzeUQdab1rebLC+8sFAxpQcZV0ptAzLRsAUBb wX/zLATkh4uphe5rFWehaFgCnIg/0Ch/JsR3pbwSUR0Sk9nRsBkPyT+LINuxeC1X/GQg aKDAvwym+9vdWcJyX63woSyWyPorJ5K82z0KarhhM288417ltotacCPoahdkuq1UEAuE xitg== X-Gm-Message-State: ALKqPwfwh8UFq6CyGIJ7I7tWwq2SVcHA853BcdIX2/MNvoqqIIGYOxnk pD4e+X6dYKl1xuadEWqSE20efg== X-Google-Smtp-Source: AB8JxZpkdrPB4QLjDIQUgVRZBsz+60HeC348QMKkyZ3gnVSK05iPVGRt/Axc3GVfTETbkrKBDYkGPw== X-Received: by 2002:a37:b884:: with SMTP id i126-v6mr445835qkf.191.1526093960389; Fri, 11 May 2018 19:59:20 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:19 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:32 -0300 Message-Id: <20180512025833.22998-10-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 09/10] testing/tests/download: test git special ref X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski , Thomas Petazzoni , Luca Ceresoli , "Yann E . MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Add a special ref to the static repo and check on the git refs test case the download of a git package: - with the name of a special ref as version; Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle --- Layout of static repo with the series applied until this patch: $ git -C support/testing/tests/download/git-remote/repo.git \ log --all --decorate --graph --oneline --decorate * 2fa37f6 (submodule) sub0-2 * a9dbc1e sub0-1 | * b72ff60 (refs/changes/01/1/2) specialref |/ | * 68c197d (mybranch) branch2 | * 3174063 branch1 |/ | * 516c9c5 (tag: mytag) tag2 | * 46bae5b tag1 |/ * a238b1d (HEAD -> master) initial Changes v4 -> v5: - no changes Changes v1 -> v4: - not included on v2 or v3; - rewrite from v1 using new git test infra with static repo; --- .../package/git-special-ref/git-special-ref.hash | 2 ++ .../package/git-special-ref/git-special-ref.mk | 11 +++++++++++ .../17/c409592968d17600ff9912e96fdd461bb72e74 | Bin 0 -> 48 bytes .../53/122a7b0454b33c6d9e159c10657173db77899e | Bin 0 -> 27 bytes .../b7/2ff6078f62522a87f5cae5e9f34dedf5ec3885 | Bin 0 -> 186 bytes .../git-remote/repo.git/refs/changes/01/1/2 | 1 + support/testing/tests/download/test_git.py | 1 + 7 files changed, 15 insertions(+) create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.hash create mode 100644 support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.mk create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/17/c409592968d17600ff9912e96fdd461bb72e74 create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/53/122a7b0454b33c6d9e159c10657173db77899e create mode 100644 support/testing/tests/download/git-remote/repo.git/objects/b7/2ff6078f62522a87f5cae5e9f34dedf5ec3885 create mode 100644 support/testing/tests/download/git-remote/repo.git/refs/changes/01/1/2 diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.hash b/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.hash new file mode 100644 index 0000000000..13e21aaeca --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.hash @@ -0,0 +1,2 @@ +sha256 c639b15260d098d94b8802cae812453c9f878ffd5f80cca6d87c58c01eed5c5a git-special-ref-refs_changes_01_1_2.tar.gz +sha256 b252b594be4679764e2e06cfea77a3e50638dd445af9b472b0f298c43b134518 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.mk b/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.mk new file mode 100644 index 0000000000..e7561bafca --- /dev/null +++ b/support/testing/tests/download/br2-external/git-refs/package/git-special-ref/git-special-ref.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# git-special-ref +# +################################################################################ + +GIT_SPECIAL_REF_VERSION = refs/changes/01/1/2 +GIT_SPECIAL_REF_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +GIT_SPECIAL_REF_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/git-remote/repo.git/objects/17/c409592968d17600ff9912e96fdd461bb72e74 b/support/testing/tests/download/git-remote/repo.git/objects/17/c409592968d17600ff9912e96fdd461bb72e74 new file mode 100644 index 0000000000000000000000000000000000000000..8c19de6455168ac65c81d70219e01eb2431c069e GIT binary patch literal 48 zcmbpD)l54sSDN4Q9^DeyfQkL!O@h`vX8x-PgzB#pAi~s-t literal 0 HcmV?d00001 diff --git a/support/testing/tests/download/git-remote/repo.git/refs/changes/01/1/2 b/support/testing/tests/download/git-remote/repo.git/refs/changes/01/1/2 new file mode 100644 index 0000000000..7066394dd0 --- /dev/null +++ b/support/testing/tests/download/git-remote/repo.git/refs/changes/01/1/2 @@ -0,0 +1 @@ +b72ff6078f62522a87f5cae5e9f34dedf5ec3885 diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py index ce3655121c..162c03623b 100644 --- a/support/testing/tests/download/test_git.py +++ b/support/testing/tests/download/test_git.py @@ -75,6 +75,7 @@ class TestGitRefs(GitTestBase): self.check_download("git-sha1-reachable-by-tag") self.check_download("git-sha1-tag-itself") self.check_download("git-sha1-tag-points-to") + self.check_download("git-special-ref") self.check_download("git-submodule-disabled") self.check_download("git-submodule-enabled") self.check_download("git-tag") From patchwork Sat May 12 02:58:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 912361 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fRWTrE3Q"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jWsH6VFXz9s19 for ; Sat, 12 May 2018 12:59:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 26BC62FB96; Sat, 12 May 2018 02:59:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FMVgCpN6SnBa; Sat, 12 May 2018 02:59:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1F22E22647; Sat, 12 May 2018 02:59:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 74ACF1C29B1 for ; Sat, 12 May 2018 02:59:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 711048851C for ; Sat, 12 May 2018 02:59:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TIt1mZcKZocO for ; Sat, 12 May 2018 02:59:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 61CC58855A for ; Sat, 12 May 2018 02:59:24 +0000 (UTC) Received: by mail-qk0-f173.google.com with SMTP id z75-v6so5937669qkb.6 for ; Fri, 11 May 2018 19:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=xYZqML0gCeR5FFv3KQD4WHfweT1P334IceRU4X5QJGQ=; b=fRWTrE3QX0fjjauWcdB9NoDpNRum7CbEsRc52CtJS8ZMQSH6ylxQ/mYXm4nfb38JQ4 St4kLgTXDxwxHfG8GTRYH7BKHkn7/IVmXL4YLhKO60ZKXIbjUbcVCNmp6AeKjaFzlefW l6P/snSwGgkw01DUCl0/BkjgJhJ5DrKYcNzb5GJzUHPx8gY5gPkcmuQd9KI3W8yW4mKI NaAoXijoYOIfbMij0mbqdUDTbXCzasPAThomI36TG8Hf9yP6j+2Q1s/1mBVkN+H6VZzS h3PnLL/uvdap+d3SXK6g8Vux0CrmPEa4H2z6Dh+ySt5sPSz14Ucirn+3306jYr4Dckfb 9+6g== 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:in-reply-to :references:in-reply-to:references; bh=xYZqML0gCeR5FFv3KQD4WHfweT1P334IceRU4X5QJGQ=; b=CE6DNJFu9cyqPZ99C0LP+GdzOw8ncJYxID4F9Tw+UAlQjfn1IO9FM2lXrnyYP1MFBQ qnAxApXTWxJGZGZ528QJgH3mlY6Y4Swc4F8OADsEJycXjiq9euVeQY0vIpYhdDkjU4hR 9Jf0S1QQ/R5y5s208iavuc//cvX0ljw70aKZzBBFV1Jhl9JaFH77R6q6lmCNHpxxDpkT D4w0bUfs01R0JVeEt5CEd34EP6mkoEPPKNs7rffTQA/qQHMVISdIF5oN/eQtVUSb3quw nLZP1i8LvJiXiNxaarHICZIJQzBg6LwvrrTekO34oY3JpSh/iBZC+v0CT9kAtZom4LdA RQ8A== X-Gm-Message-State: ALKqPwfqrZAm7qkyP5B4JDchfs9u+eXHRIj3yXgDDe0NNMwNiCMQzXBg LoD8pZ3NTld3HjiQk9zv5Dxtdg== X-Google-Smtp-Source: AB8JxZomfxSKIC5R/R11j+1KK2LqEqkFedgQV3Is3qxexhb/v9lAS1x+0X/3ZKJZtL+MFWyBfuQK4A== X-Received: by 2002:a37:1f14:: with SMTP id f20-v6mr457260qkf.391.1526093963223; Fri, 11 May 2018 19:59:23 -0700 (PDT) Received: from ultri5.home ([189.114.97.193]) by smtp.gmail.com with ESMTPSA id l38-v6sm3832914qta.86.2018.05.11.19.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 19:59:22 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 11 May 2018 23:58:33 -0300 Message-Id: <20180512025833.22998-11-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512025833.22998-1-ricardo.martincoski@gmail.com> References: <20180512025833.22998-1-ricardo.martincoski@gmail.com> In-Reply-To: <20180429143349.24010-1-ricardo.martincoski@gmail.com> References: <20180429143349.24010-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v5 10/10] support/testing: test extra download with site method git X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luca Ceresoli , Thomas Petazzoni , Ricardo Martincoski , "Yann E . MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add one test case to ensure the use of extra download works for git packages: - an extra download is correctly downloaded using wget after the main download finished using the git backend; - when the main download using the git backend fails, the build fails; - when the extra download using wget fails, the build fails. Reuse the commit in the static repo. Add required infra and fixture: - a HttpServer class, that starts a http server in the host machine to emulate a remote http server under the control of the test; - a file to be served by the http server; - a br2-external (git-extra-download) with one package for each part of the test case. Since the HttpServer is similar to GitRemote, extract the commonalities to a new base class called Server. Signed-off-by: Ricardo Martincoski Cc: Luca Ceresoli Cc: Thomas Petazzoni Cc: Yann E. MORIN --- Changes v4 -> v5: - no changes Changes v3 -> v4: - new patch I use docker only with the Buildroot image for the test infra. Sorry, I give up for now on trying to run apache on the docker image. As a midground solution between: - adding more files to http://autobuild.buildroot.net/artefacts/ that won't scale well if we need different files for different test cases; - installing a full web server to the docker image auto-loading as root when the container is started as user and allowing the test infra to copy files to the served path as user; and inspired by this article: https://www.pcsuggest.com/best-lightweight-web-server-linux/ I created this patch using SimpleHTTPServer being started by the test infra as a user. I know it is weird to use pexpect to fork a server written in Python, but it has these advantages: - theoretically replacing SimpleHTTPServer with a similar solution (say the busybox httpd) in the future would require only small changes to the test infra code; - SimpleHTTPServer is already on the docker image, busybox isn't, so no need to change the Dockerfile, generate the image, publish it and update the docker image tag on .gitlab-ci.yml; - the log file generated by the server is handled in the same way as other log files generated by the test infra; --- .gitlab-ci.yml | 1 + support/testing/infra/server.py | 39 +++++++++++++++++ .../br2-external/git-extra-download/Config.in | 0 .../git-extra-download/external.desc | 1 + .../git-extra-download/external.mk | 6 +++ .../package/extra-fails/extra-fails.hash | 3 ++ .../package/extra-fails/extra-fails.mk | 12 ++++++ .../package/main-fails/main-fails.hash | 3 ++ .../package/main-fails/main-fails.mk | 12 ++++++ .../git-extra-download/package/ok/ok.hash | 3 ++ .../git-extra-download/package/ok/ok.mk | 12 ++++++ support/testing/tests/download/gitremote.py | 43 +++---------------- .../testing/tests/download/http-server/extra | 1 + support/testing/tests/download/httpserver.py | 14 ++++++ support/testing/tests/download/test_git.py | 21 +++++++++ 15 files changed, 135 insertions(+), 36 deletions(-) create mode 100644 support/testing/infra/server.py create mode 100644 support/testing/tests/download/br2-external/git-extra-download/Config.in create mode 100644 support/testing/tests/download/br2-external/git-extra-download/external.desc create mode 100644 support/testing/tests/download/br2-external/git-extra-download/external.mk create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.hash create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.mk create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.hash create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.mk create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.hash create mode 100644 support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.mk create mode 100644 support/testing/tests/download/http-server/extra create mode 100644 support/testing/tests/download/httpserver.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61ccfdfd2d..53f7c72ac3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -263,6 +263,7 @@ tests.core.test_rootfs_overlay.TestRootfsOverlay: *runtime_test tests.core.test_timezone.TestGlibcAllTimezone: *runtime_test tests.core.test_timezone.TestGlibcNonDefaultLimitedTimezone: *runtime_test tests.core.test_timezone.TestNoTimezone: *runtime_test +tests.download.test_git.TestGitExtraDownload: *runtime_test tests.download.test_git.TestGitHash: *runtime_test tests.download.test_git.TestGitRefs: *runtime_test tests.fs.test_ext.TestExt2: *runtime_test diff --git a/support/testing/infra/server.py b/support/testing/infra/server.py new file mode 100644 index 0000000000..0fbffdf846 --- /dev/null +++ b/support/testing/infra/server.py @@ -0,0 +1,39 @@ +# subprocess does not kill the child daemon when a test case fails by raising +# an exception. So use pexpect instead. +import pexpect + +import infra + + +class Server(object): + def __init__(self, builddir, serveddir, logtofile, daemon_cmd, port_arg, port_initial, port_last, good_msg, bad_msg): + """ + Start a local server. + + In order to support test cases in parallel, select the port the + server will listen to in runtime. Since there is no reliable way + to allocate the port prior to starting the server (another + process in the host machine can use the port between it is + selected from a list and it is really allocated to the server) + try to start the server in a port and in the case it is already + in use, try the next one in the allowed range. + """ + self.name = self.__class__.__name__.lower() + self.daemon = None + self.port = None + self.logfile = infra.open_log_file(builddir, self.name, logtofile) + + for port in range(port_initial, port_last + 1): + cmd = daemon_cmd + [port_arg.format(port=port)] + self.logfile.write("> starting {} with 'cd {} && {}'\n".format(self.name, serveddir, " ".join(cmd))) + self.daemon = pexpect.spawn(cmd[0], cmd[1:], logfile=self.logfile, cwd=serveddir) + ret = self.daemon.expect(good_msg + bad_msg) + if ret < len(good_msg): + self.port = port + return + raise SystemError("Could not find a free port to run {}".format(self.name)) + + def stop(self): + if self.daemon is None: + return + self.daemon.terminate(force=True) diff --git a/support/testing/tests/download/br2-external/git-extra-download/Config.in b/support/testing/tests/download/br2-external/git-extra-download/Config.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/support/testing/tests/download/br2-external/git-extra-download/external.desc b/support/testing/tests/download/br2-external/git-extra-download/external.desc new file mode 100644 index 0000000000..6ebd5a534d --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/external.desc @@ -0,0 +1 @@ +name: GIT_EXTRA_DOWNLOAD diff --git a/support/testing/tests/download/br2-external/git-extra-download/external.mk b/support/testing/tests/download/br2-external/git-extra-download/external.mk new file mode 100644 index 0000000000..c6080f571b --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/external.mk @@ -0,0 +1,6 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_GIT_EXTRA_DOWNLOAD_PATH)/package/*/*.mk)) + +# Get the git server port number from the test infra +GITREMOTE_PORT_NUMBER ?= 9418 +# Get the http server port number from the test infra +HTTP_SERVER_PORT_NUMBER ?= 8000 diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.hash b/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.hash new file mode 100644 index 0000000000..89b1b1f682 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.hash @@ -0,0 +1,3 @@ +sha256 1e6bc73fabdcce8857361e36e3c812c4ee42d8ffa30d56492bc56f8fcad7eb90 extra-fails-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz +sha256 b9e68e1bea3e5b19ca6b2f98b73a54b73daafaa250484902e09982e07a12e733 notfound +sha256 da68f54607d5f5644954096ce1597c006c5bb9f2497e07441bf064b81003ef8a file diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.mk b/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.mk new file mode 100644 index 0000000000..dcf3ebe7a6 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/extra-fails/extra-fails.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# extra-fails +# +################################################################################ + +EXTRA_FAILS_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +EXTRA_FAILS_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +EXTRA_FAILS_EXTRA_DOWNLOADS = http://localhost:$(HTTP_SERVER_PORT_NUMBER)/notfound +EXTRA_FAILS_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.hash b/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.hash new file mode 100644 index 0000000000..ad81243751 --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.hash @@ -0,0 +1,3 @@ +sha256 cd6851ef519a83345e4547f376b33d6bbd622d4ccbb234af9997c43854c602de main-fails-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz +sha256 b9e68e1bea3e5b19ca6b2f98b73a54b73daafaa250484902e09982e07a12e733 extra +sha256 da68f54607d5f5644954096ce1597c006c5bb9f2497e07441bf064b81003ef8a file diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.mk b/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.mk new file mode 100644 index 0000000000..022bb37cbb --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/main-fails/main-fails.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# main-fails +# +################################################################################ + +MAIN_FAILS_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +MAIN_FAILS_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/notfound.git +MAIN_FAILS_EXTRA_DOWNLOADS = http://localhost:$(HTTP_SERVER_PORT_NUMBER)/extra +MAIN_FAILS_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.hash b/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.hash new file mode 100644 index 0000000000..366940754b --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.hash @@ -0,0 +1,3 @@ +sha256 737b4fd21506dbaa34cedc93c53c1ebb1f950db2c7644572bb006ae9297961da ok-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz +sha256 b9e68e1bea3e5b19ca6b2f98b73a54b73daafaa250484902e09982e07a12e733 extra +sha256 da68f54607d5f5644954096ce1597c006c5bb9f2497e07441bf064b81003ef8a file diff --git a/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.mk b/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.mk new file mode 100644 index 0000000000..ce102cb0de --- /dev/null +++ b/support/testing/tests/download/br2-external/git-extra-download/package/ok/ok.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# ok +# +################################################################################ + +OK_VERSION = a238b1dfcd825d47d834af3c5223417c8411d90d +OK_SITE = git://localhost:$(GITREMOTE_PORT_NUMBER)/repo.git +OK_EXTRA_DOWNLOADS = http://localhost:$(HTTP_SERVER_PORT_NUMBER)/extra +OK_LICENSE_FILES = file + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/gitremote.py b/support/testing/tests/download/gitremote.py index 60bc49fbf8..9766b19ce0 100644 --- a/support/testing/tests/download/gitremote.py +++ b/support/testing/tests/download/gitremote.py @@ -1,44 +1,15 @@ -# subprocess does not kill the child daemon when a test case fails by raising -# an exception. So use pexpect instead. -import pexpect - -import infra +from infra.server import Server GIT_REMOTE_PORT_INITIAL = 9418 GIT_REMOTE_PORT_LAST = GIT_REMOTE_PORT_INITIAL + 99 -class GitRemote(object): +class GitRemote(Server): def __init__(self, builddir, serveddir, logtofile): - """ - Start a local git server. - - In order to support test cases in parallel, select the port the - server will listen to in runtime. Since there is no reliable way - to allocate the port prior to starting the server (another - process in the host machine can use the port between it is - selected from a list and it is really allocated to the server) - try to start the server in a port and in the case it is already - in use, try the next one in the allowed range. - """ - self.daemon = None - self.port = None - self.logfile = infra.open_log_file(builddir, "gitremote", logtofile) - daemon_cmd = ["git", "daemon", "--reuseaddr", "--verbose", "--listen=localhost", "--export-all", "--base-path={}".format(serveddir)] - for port in range(GIT_REMOTE_PORT_INITIAL, GIT_REMOTE_PORT_LAST + 1): - cmd = daemon_cmd + ["--port={port}".format(port=port)] - self.logfile.write("> starting git remote with '{}'\n".format(" ".join(cmd))) - self.daemon = pexpect.spawn(cmd[0], cmd[1:], logfile=self.logfile) - ret = self.daemon.expect(["Ready to rumble", - "Address already in use"]) - if ret == 0: - self.port = port - return - raise SystemError("Could not find a free port to run git remote") - - def stop(self): - if self.daemon is None: - return - self.daemon.terminate(force=True) + super(GitRemote, self).__init__( + builddir, serveddir, logtofile, + daemon_cmd, "--port={port}", GIT_REMOTE_PORT_INITIAL, GIT_REMOTE_PORT_LAST, + ["Ready to rumble"], + ["Address already in use"]) diff --git a/support/testing/tests/download/http-server/extra b/support/testing/tests/download/http-server/extra new file mode 100644 index 0000000000..8e27be7d61 --- /dev/null +++ b/support/testing/tests/download/http-server/extra @@ -0,0 +1 @@ +text diff --git a/support/testing/tests/download/httpserver.py b/support/testing/tests/download/httpserver.py new file mode 100644 index 0000000000..9f4f947304 --- /dev/null +++ b/support/testing/tests/download/httpserver.py @@ -0,0 +1,14 @@ +from infra.server import Server + +HTTP_SERVER_PORT_INITIAL = 8000 +HTTP_SERVER_PORT_LAST = HTTP_SERVER_PORT_INITIAL + 99 + + +class HttpServer(Server): + def __init__(self, builddir, serveddir, logtofile): + daemon_cmd = ["python", "-m", "SimpleHTTPServer"] + super(HttpServer, self).__init__( + builddir, serveddir, logtofile, + daemon_cmd, "{port}", HTTP_SERVER_PORT_INITIAL, HTTP_SERVER_PORT_LAST, + ["Serving HTTP"], + ["Address already in use"]) diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py index 162c03623b..e0abc3fa65 100644 --- a/support/testing/tests/download/test_git.py +++ b/support/testing/tests/download/test_git.py @@ -3,6 +3,7 @@ import shutil import infra from gitremote import GitRemote +from httpserver import HttpServer class GitTestBase(infra.basetest.BRTest): @@ -12,13 +13,19 @@ class GitTestBase(infra.basetest.BRTest): """ gitremotedir = infra.filepath("tests/download/git-remote") gitremote = None + httpserverdir = None + httpserver = None def setUp(self): super(GitTestBase, self).setUp() self.gitremote = GitRemote(self.builddir, self.gitremotedir, self.logtofile) + if self.httpserverdir: + self.httpserver = HttpServer(self.builddir, self.httpserverdir, self.logtofile) def tearDown(self): self.show_msg("Cleaning up") + if self.httpserver: + self.httpserver.stop() if self.gitremote: self.gitremote.stop() if self.b and not self.keepbuilds: @@ -42,11 +49,25 @@ class GitTestBase(infra.basetest.BRTest): shutil.rmtree(dl_dir) env = {"BR2_DL_DIR": dl_dir, "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)} + if self.httpserver: + env["HTTP_SERVER_PORT_NUMBER"] = str(self.httpserver.port) self.b.build(["{}-dirclean".format(package), "{}-legal-info".format(package)], env) +class TestGitExtraDownload(GitTestBase): + br2_external = [infra.filepath("tests/download/br2-external/git-extra-download")] + httpserverdir = infra.filepath("tests/download/http-server") + + def test_run(self): + with self.assertRaises(SystemError): + self.check_download("extra-fails") + with self.assertRaises(SystemError): + self.check_download("main-fails") + self.check_download("ok") + + class TestGitHash(GitTestBase): br2_external = [infra.filepath("tests/download/br2-external/git-hash")]