From patchwork Sun Feb 12 14:53:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 726967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vLsC32ncSz9s7b for ; Mon, 13 Feb 2017 01:54:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MQntKcJA"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C17B187B74; Sun, 12 Feb 2017 14:54:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oWt6XZ0jwmMj; Sun, 12 Feb 2017 14:54:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A873B87B4A; Sun, 12 Feb 2017 14:53:32 +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 58E881C0300 for ; Sun, 12 Feb 2017 14:53:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 50D3626FCF for ; Sun, 12 Feb 2017 14:53:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nl1O9AmpZQRA for ; Sun, 12 Feb 2017 14:53:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by silver.osuosl.org (Postfix) with ESMTPS id 4BCCF26951 for ; Sun, 12 Feb 2017 14:53:22 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id 89so20482408wrr.1 for ; Sun, 12 Feb 2017 06:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=TsPAJWOGnMu4p1joVrcUzTfRf1iAI5HVbU5da6sJgY0=; b=MQntKcJA8PNbQbG/SrSWMSlXw4iUiLYYEuZtn9r4K/k5hsmk00w06eBPwG5prCgzwX 07cWaigrgNkhi9WpWsM6u027kYJfB4b15Ud6saCQYQB0FWwiutsKntHPZHP+rEwPF8Ef sss/tcNUbxWrKLa3eqkyalTFg6E9XryPMj3hEK8ESMs2eEmEtbzCTzdYATiKoTgrq10P 30WtxhXwqKaVOGmbk4arFb5kUXRu6obnlcqC0IR1FPbj7D4DocOj13msx6JqpZHljetX YLvyqPxnDxKQhG8iy6WskXJlzBWeySvqGTbTXhQCvy0+ozvsRC4XOaQCQwYXgfZaGK5/ ZM/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=TsPAJWOGnMu4p1joVrcUzTfRf1iAI5HVbU5da6sJgY0=; b=qSq2g9CyZcadGpqHMAjD77Lz/pyehjxjAXYWYPtJTYpE6lvzOois0fJMkLvQHjcZLp xlkRUb6DXIZO8rHntuJ5Gv/haEDRNdQefGC6KtC9/WiKHY2CxlhoLDWX+J6DW8IpD2ql XW6QuSD/2FeVa9uNNx9HN1jdrgZMUcx3Vur1ItdjVuZdHLGIt3imsFgUJzOw8eM+Huvq Vcw6fC+5NVe0lih9bbA0D8DkSMLUP7prqUuf9JfzjwfSYYkKcc+ZLlV85D7EkIoQZUCZ 0noggs2r2T48DRUiSnhpOl80b1jjOfa/CabNwekHsQm4S+aFqq9OeP6qXN6kmeELRyxx GnYg== X-Gm-Message-State: AMke39mQbUHhBm2faPPV9sUOsX1mrqfXYspFb1cAxFHyrhMuRc/iyBdZG4lgT0E79Z9KYw== X-Received: by 10.223.166.106 with SMTP id k97mr15982436wrc.170.1486911200820; Sun, 12 Feb 2017 06:53:20 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id 45sm7037690wrx.60.2017.02.12.06.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Feb 2017 06:53:20 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 12 Feb 2017 15:53:10 +0100 Message-Id: <4cf937974900e49494cdc92df604a64b6366dfee.1486911180.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Cc: Thomas Petazzoni , Luca Ceresoli , "Yann E. MORIN" Subject: [Buildroot] [PATCH 6/7 v4] support/test-pkg: add option to use an alternate list of toolchains X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" For now, testing a package requires network access. However, there are situations where everything is already cached locally (especially the toolchains tarballs) and network is not available (e.g. in the train, travelling back from FOSDEM...) Alternatively, one may also want to test against a subset of the default toolchains (e.g. the ones known to have a specific issue). Add an option to use an alternate URL, which can be remote or a path to a local file. Signed-off-by: "Yann E. MORIN" --- support/scripts/test-pkg | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/support/scripts/test-pkg b/support/scripts/test-pkg index a040ce1..9626c1a 100755 --- a/support/scripts/test-pkg +++ b/support/scripts/test-pkg @@ -5,16 +5,17 @@ TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-conf main() { local o O opts - local cfg dir pkg random toolchain + local cfg dir pkg random url toolchain local ret nb nb_skip nb_fail local -a toolchains - o='hc:d:p:r:' - O='help,config-snippet:build-dir:package:,random:' + o='hc:d:p:r:t:' + O='help,config-snippet:build-dir:package:,random:,toolchains:' opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")" eval set -- "${opts}" random=0 + url="${TOOLCHAINS_URL}" while [ ${#} -gt 0 ]; do case "${1}" in (-h|--help) @@ -32,6 +33,9 @@ main() { (-r|--random) random="${2}"; shift 2 ;; + (-t|--toolchains) + url="${2}"; shift 2 + ;; (--) shift; break ;; @@ -47,10 +51,16 @@ main() { dir="${HOME}/br-test-pkg" fi + # Transform local paths to URI to make curl happy and simplify + # our code path + case "${url}" in + (/*) url="file://${url}";; + esac + # Extract the URLs of the toolchains; drop internal toolchains # E.g.: http://server/path/to/name.config,arch,libc # --> http://server/path/to/name.config - toolchains=($(curl -s "${TOOLCHAINS_URL}" \ + toolchains=($(curl -s "${url}" \ |sed -r -e 's/,.*//; /internal/d;' \ |if [ ${random} -gt 0 ]; then \ sort -R |head -n ${random} @@ -87,6 +97,12 @@ build_one() { local pkg="${4}" local toolchain + # Transform local paths to URI to make curl happy and simplify + # our code path + case "${url}" in + (/*) url="file://${url}";; + esac + # Using basename(1) on a URL works nicely toolchain="$(basename "${url}" .config)" @@ -156,8 +172,22 @@ In case failures are noticed, you can fix the package and just re-run the same command again; it will re-run the test where it failed. If you did specify a package (with -p), the package build dir will be removed first. -The list of toolchains is retrieved from the Buildroot autobuilders, available -at ${TOOLCHAINS_URL}. +Unless specified with -t, the list of toolchains is retrieved from the +Buildroot autobuilders, available at: + ${TOOLCHAINS_URL} + +The list of toolchains should contain the URLs to all toolchains, one per +line, along with the architecture and C library used, separated by commas, +"URL,ARCH,LIBC" (only the first field, URL, is used by this script). For +example: + + https://server/path/to/toolchain-1.config,arm,glibc + /path/to/local-toolchain.config,i386,musl + +The URL for each toolchain should point to a .config file that contains +only the toolchain and architecture settings. URLs that contain the string +'internal' are skipped, on the assumption that the configuration would +build an internal toolchain (which takes a lot of time). Options: @@ -179,6 +209,11 @@ Options: Limit the tests to the N randomly selected toolchains, instead of building with all toolchains. + -t URL, --toolchains URL + Use the toolchains described at URL instead of the toolchains used + by the Buildroot autobuilders (see above). URL can be a path to a + local file. + Example: Testing libcec would require a config snippet that contains: