From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kCwqBVNVsWIzNQAAbAwnHQ (envelope-from ) for ; Tue, 21 Jun 2022 07:21:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id migmBFNVsWIt9gAAG6o9tA (envelope-from ) for ; Tue, 21 Jun 2022 07:21:23 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 837751221F for ; Tue, 21 Jun 2022 07:21:22 +0200 (CEST) Received: from localhost ([::1]:39072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3WKH-0003YI-Cz for larch@yhetil.org; Tue, 21 Jun 2022 01:21:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3WJy-0003Xb-U9 for guix-patches@gnu.org; Tue, 21 Jun 2022 01:21:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3WJy-0000bh-KO for guix-patches@gnu.org; Tue, 21 Jun 2022 01:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3WJy-0006bS-CY for guix-patches@gnu.org; Tue, 21 Jun 2022 01:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56119] [PATCH] gnu: Add phoronix-test-suite. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Jun 2022 05:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56119 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56119@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165578882225304 (code B ref -1); Tue, 21 Jun 2022 05:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jun 2022 05:20:22 +0000 Received: from localhost ([127.0.0.1]:58928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3WJC-0006Zv-Vf for submit@debbugs.gnu.org; Tue, 21 Jun 2022 01:20:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:46532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3WJ9-0006Zj-C1 for submit@debbugs.gnu.org; Tue, 21 Jun 2022 01:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3WJ8-0003Rb-8K for guix-patches@gnu.org; Tue, 21 Jun 2022 01:20:11 -0400 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:38707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3WJ5-0000IJ-G0 for guix-patches@gnu.org; Tue, 21 Jun 2022 01:20:10 -0400 Received: by mail-qv1-xf2e.google.com with SMTP id p31so18825149qvp.5 for ; Mon, 20 Jun 2022 22:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HzSogctKVwhUeelN29UnlvpcANSx3ZWqaXwyHuUrVLA=; b=Gr2MHytQAdkp48ZeAeIuHqid7mpS7LcaR+EICTXSeQvcHi4vIhoqfnd2T3Ahd3KxAD sxEunuH7sxOR69PhrH1zb6cFqfA75CCnwt3QKbXnO+Fiv65mMasEKykOI8kM2y5O5zKp RaokKpa1+l9uwLi0E1TcSatmNHXJCuBqK5smzBAk/98UFxzv/9BeZNwc56MsSCbhBGXJ iNfT4oiWDNj4jJHQ5FrEy1C4gnLoB/lqHtuO2yEvuSASxj/pzuveGbtyrhaYlFolfxqr qdhyGrJzC5q4eJBAg8wLmTS1W3/EtoMpEf3LteP9wM5PTmgwyUDGI4kJ/vmaN50Bfdki hdrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HzSogctKVwhUeelN29UnlvpcANSx3ZWqaXwyHuUrVLA=; b=NvTobTnsmvJ5XDjrkzRGsfs9lrbwHDj5diMhAcVev4XpO5HcpHPKP2u8PsYivc21PV AiAIYlt0U5KOnOHXWrXnp/HxavQFZRjtbn160A82h/OlPztVXZvuZLUZft78eWY31xLn +n7Xc0V5+S/H8yYUD+pIaeM4brlRG1+xfr49aYHOOCvfaFl4/AqYq0I3fjFDB1d/Zc3U 4+7jU8r/5ZcJ3wz+4HbwyK4RXABPORhn+Na/XM8aXo71k/poj2y1NY52XvSDJLbdrHzT TrRMWUGcIWsgBm3D7WUXu/C9aLi5H2S6+K7rRDCYuBh4DMOKajT4SaAkQqYaA9DbPF+8 eQEg== X-Gm-Message-State: AJIora+JTHoqLN3iQi0qV8zX26bxakcvYzlq0urvsErApQQzdBukjrps dxcwikx8X4RXzl+YL1ALxeaL/+ex7LYL+w== X-Google-Smtp-Source: AGRyM1uDf81DrwID+k+77oPosreFWDnvSmvBay5G6rx25+TrfiunpVMhiWiqt9Sg6niXov3AuR7DOA== X-Received: by 2002:a05:622a:14c9:b0:306:723a:2766 with SMTP id u9-20020a05622a14c900b00306723a2766mr22619999qtx.147.1655788805640; Mon, 20 Jun 2022 22:20:05 -0700 (PDT) Received: from localhost.localdomain (dsl-10-131-230.b2b2c.ca. [72.10.131.230]) by smtp.gmail.com with ESMTPSA id r14-20020a05620a298e00b006a6d60a39d0sm14961525qkp.5.2022.06.20.22.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 22:20:05 -0700 (PDT) From: Maxim Cournoyer Date: Tue, 21 Jun 2022 01:20:00 -0400 Message-Id: <20220621052000.1163-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655788882; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=HzSogctKVwhUeelN29UnlvpcANSx3ZWqaXwyHuUrVLA=; b=axYWBySBxxybR4qHWxTqVvYYsNYz9Dr9IQBs8ctGfebARTbChOQWik3TzZY7mfSQG5d8NH xkwCxlAc7Fkj44kClq+OvdoO9Z5eMAb3DkB0DQcDx5WGhpDvhqrAGqOp4yMkxOOqveJgT2 ByOcQYgVPSNej31j8A7g1aNDm4kMsGOVFkSYqMkcv1ouGOXriBCIFfrscOW/ri1/lBFKAa KNnPR7X7gQ5E4qB4TqtbhMsqrplfnUZXFdwtBINyAYznXQqJbArTdOaKG2oZPCD+nTERWs yWE8bRptz6PMabOgL7IFNbQGznFiXu53i/Ze2bEQgBRWriOesFV9/VskmfbZCA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655788882; a=rsa-sha256; cv=none; b=arWan3bFjomhtle+8q9F5spIHTTtrEG1h2wCJomyB1U9K5Kwpz3evr56xZ/SOOCmRhafT9 ljj1FiifZjZ4JZZxPQcd89Dv63KEXLVYKNXroaSsK423FKXAv4njU6ydbC9Lmivc3V1cXU vaFilmVjNMwz/gfRkkWNdRm7j0VhdEDXk2mCMrvuZBX32sLcVM06R//54Oav0HmJ5caEuj W5xv3Mqm/5Q1RnbUvEn7eRzXqi5rtM1A9D/vna6HGuuImP5VkJaDIJlekbWLt6sBrMgtfE O/Ac1B4ZEcvwK8Lxsi+4RwHy1+udNdJYlnp5cbt09mlpF+c9DcVgUrCKoQ/0SQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Gr2MHytQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Gr2MHytQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 837751221F X-Spam-Score: 5.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: N/4Y2SlvJeAI * gnu/packages/patches/phoronix-test-suite-fsdg.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/benchmark.scm (phoronix-test-suite): New variable. (gcc-toolchain*): Likewise. --- gnu/local.mk | 1 + gnu/packages/benchmark.scm | 73 +++- .../patches/phoronix-test-suite-fsdg.patch | 311 ++++++++++++++++++ 3 files changed, 384 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/phoronix-test-suite-fsdg.patch diff --git a/gnu/local.mk b/gnu/local.mk index 197c8679eb..8b545b58f8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1624,6 +1624,7 @@ dist_patch_DATA = \ %D%/packages/patches/perl-reproducible-build-date.patch \ %D%/packages/patches/perl-www-curl-fix-struct-void.patch \ %D%/packages/patches/perl-www-curl-remove-symbol.patch \ + %D%/packages/patches/phoronix-test-suite-fsdg.patch \ %D%/packages/patches/php-bug-74093-test.patch \ %D%/packages/patches/php-openssl_x509_checkpurpose_basic.patch \ %D%/packages/patches/picard-fix-id3-rename-test.patch \ diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index b167c6de6e..26e7a1867d 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -39,18 +39,20 @@ (define-module (gnu packages benchmark) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) - #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages databases) #:use-module (gnu packages docbook) + #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages linux) #:use-module (gnu packages lua) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) #:use-module (gnu packages opencl) #:use-module (gnu packages perl) + #:use-module (gnu packages php) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-science) @@ -60,6 +62,11 @@ (define-module (gnu packages benchmark) #:use-module (gnu packages xml) #:use-module (ice-9 match)) +;; Lazily resolve the gcc-toolchain to avoid a circular dependency. +(define gcc-toolchain* + (delay (module-ref (resolve-interface '(gnu packages commencement)) + 'gcc-toolchain))) + (define-public fio (package (name "fio") @@ -263,6 +270,70 @@ (define-public bonnie++ file metadata operations that can be performed per second.") (license license:gpl2))) ;GPL 2 only, see copyright.txt +(define-public phoronix-test-suite + (package + (name "phoronix-test-suite") + (version "10.8.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://phoronix-test-suite.com/releases/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "105shk78jy46nwj6vnlmgp3y3lv9klar3dmcgasy4bslm4l2wx2b")) + (patches (search-patches "phoronix-test-suite-fsdg.patch")))) + (arguments + (list + #:tests? #f ;no test suite + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda _ + (invoke "./install-sh" #$output "--free-software-only"))) + (add-after 'install 'wrap-binary + (lambda _ + (let ((pts (string-append #$output "/bin/phoronix-test-suite"))) + (wrap-program pts + (list "PATH" 'prefix + (list (string-append #$(this-package-input "bash") + "/bin") + (string-append #$(this-package-input "coreutils") + "/bin") + (string-append #$(this-package-input "gzip") + "/bin") + (string-append #$(this-package-input "make") + "/bin") + (string-append #$(this-package-input "php") + "/bin") + (string-append #$(this-package-input "sed") + "/bin") + (string-append #$(this-package-input "tar") + "/bin") + (string-append #$(this-package-input "which") + "/bin")))))))))) + (build-system gnu-build-system) + (native-inputs (list python which)) + ;; Wrap the most basic build tools needed by Phoronix Test Suite to build + ;; simple tests such as 'fio'. + (inputs (list bash coreutils gnu-make gzip php sed tar which)) + ;; Phoronix Test Suite builds and caches the benchmarking tools itself; + ;; the user is required to manually install extra libraries depending on + ;; the selected test; but at least a working C/C++ toolchain is assumed to + ;; be available. + (propagated-inputs (list (force gcc-toolchain*))) + (home-page "https://www.phoronix-test-suite.com/") + (synopsis "Automated testing/benchmarking software") + (description + "The Phoronix Test Suite is a comprehensive testing and benchmarking platform +that provides an extensible framework for which new tests can be easily added. +It can carry out both qualitative and quantitative benchmarks in a clean, +reproducible, and easy-to-use manner, making it easy to compare one particular +setup against another one.") + (license license:gpl3+))) + (define-public python-locust (package (name "python-locust") diff --git a/gnu/packages/patches/phoronix-test-suite-fsdg.patch b/gnu/packages/patches/phoronix-test-suite-fsdg.patch new file mode 100644 index 0000000000..a06a6bcdc8 --- /dev/null +++ b/gnu/packages/patches/phoronix-test-suite-fsdg.patch @@ -0,0 +1,311 @@ +Submitted upstream at https://github.com/phoronix-test-suite/phoronix-test-suite/pull/642. + +diff --git a/delete-nonfree-metadata b/delete-nonfree-metadata +new file mode 100755 +index 000000000..5e98f0ab2 +--- /dev/null ++++ b/delete-nonfree-metadata +@@ -0,0 +1,198 @@ ++#!/usr/bin/env python3 ++ ++# Copyright (C) 2022, Maxim Cournoyer ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Commentary: ++# ++# This script prunes the 'ob-cache' test metadata cache from any ++# nonfree test. This is useful for users who concerned with running ++# only free software or distributions complying with the Free Software ++# Distribution Guidelines (GNU FSDG, ++# https://www.gnu.org/distros/free-system-distribution-guidelines.html). ++import argparse ++import json ++import logging ++import pathlib ++import pprint ++import re ++import shutil ++import xml.etree.ElementTree as ET ++ ++ ++logger = logging.getLogger(__name__) ++logging.basicConfig(level='INFO', format='%(levelname)s: %(message)s') ++ ++ ++DEFAULT_ROOT_DIR = pathlib.Path(__file__).parent.resolve() ++# Global cache used to keep the test/suite definition licenses, keyed ++# by their test name key (e.g., 'caffe'). ++TEST_DEFINITION_LICENSES = {} ++ ++ ++def get_test_definitions(root_dir=DEFAULT_ROOT_DIR): ++ """Return the list of all test definition XML files.""" ++ return sorted(pathlib.Path(root_dir).glob('**/test-definition.xml')) ++ ++ ++def get_suite_definitions(root_dir=DEFAULT_ROOT_DIR): ++ return sorted(pathlib.Path(root_dir).glob('**/suite-definition.xml')) ++ ++ ++def get_index_files(root_dir=DEFAULT_ROOT_DIR): ++ return sorted(pathlib.Path(root_dir).glob('**/*.index')) ++ ++ ++def sanitize_index_files(index_files, nonfree_test_names): ++ """Remove non free test entries from `index_files`.""" ++ for index_file in index_files: ++ with index_file.open() as f: ++ index = json.load(f) ++ filtered_tests = {k: v for k, v in index['tests'].items() ++ if k not in nonfree_test_names} ++ index['tests'] = filtered_tests ++ if index['suites']: ++ filtered_suites = {k: v for k, v in index['suites'].items() ++ if k not in nonfree_test_names} ++ index['suites'] = filtered_suites ++ ++ # Set the cached date to a distant time in the future so that it ++ index['main']['generated'] = 2**31 - 1 # 2038 Epochalypse on 32 bit ++ ++ with index_file.open('w') as f: ++ json.dump(index, f) ++ ++ ++def get_test_definition_license(test_definition_file, ++ root_dir=DEFAULT_ROOT_DIR): ++ """Return the licenses from `test_definition_file`, or None.""" ++ name = get_name_from_definition_file(test_definition_file) ++ if name in TEST_DEFINITION_LICENSES: ++ return TEST_DEFINITION_LICENSES[name] ++ ++ root = ET.parse(test_definition_file) ++ try: ++ license = next(root.iter('License')).text ++ except StopIteration: ++ # No license field; check if it extends another test. ++ try: ++ extended_test = next(root.iter('Extends')).text # e.g. 'pts/caffe' ++ extended_name = extended_test.split('/')[-1] ++ if extended_name in TEST_DEFINITION_LICENSES: ++ license = TEST_DEFINITION_LICENSES[extended_name] ++ else: ++ extended_definition_file = sorted( ++ pathlib.Path(root_dir).glob( ++ '**/test-profiles/' + extended_test ++ + '-*/test-definition.xml'))[-1] ++ license = get_test_definition_license(extended_definition_file, ++ root_dir) ++ except StopIteration: ++ logger.warning('could not find license for %s', ++ test_definition_file) ++ return None ++ ++ TEST_DEFINITION_LICENSES[name] = license ++ return license ++ ++ ++def is_test_definition_free(test_definition_file): ++ """True if `test_definition_file` has its license tag set to 'Free'.""" ++ license = get_test_definition_license(test_definition_file) ++ return license == 'Free' ++ ++ ++def is_suite_definition_free(suite_definition_file, nonfree_test_names): ++ """True if `suite_definition_file` is free. ++ ++ The suite definition is considered free when it doesn't reference ++ any test part of `nonfree_test_names`. ++ """ ++ root = ET.parse(suite_definition_file) ++ for test in root.iter('Test'): ++ test_name = test.text ++ name = test_name.split('/')[-1] # strip any prefix ++ if name in nonfree_test_names: ++ return False ++ ++ return True ++ ++ ++def get_name_from_definition_file(definition_file): ++ """Return the parent directory name of a definition file. ++ ++ The version information in stripped from the name.""" ++ parent_dir_name = pathlib.Path(definition_file).parent.name ++ # Strip the version from the name. ++ return re.search(r'^(.*)-', parent_dir_name).group(1) ++ ++ ++def get_default_user_config_file(root_dir): ++ return next(pathlib.Path(root_dir).glob('**/user-config-defaults.xml')) ++ ++ ++def disallow_refreshing_repositories(user_config_file): ++ """Set the 'AllowRefreshingRepositoryLists' option to FALSE.""" ++ config = ET.parse(user_config_file) ++ for option in config.iter('AllowRefreshingRepositoryLists'): ++ option.text = 'FALSE' ++ config.write(user_config_file) ++ ++ ++def main(root_dir): ++ # Gather data. ++ test_definitions = get_test_definitions(root_dir) ++ suite_definitions = get_suite_definitions(root_dir) ++ nonfree_test_definitions = [d for d in test_definitions ++ if not is_test_definition_free(d)] ++ nonfree_test_names = [get_name_from_definition_file(t) ++ for t in nonfree_test_definitions] ++ nonfree_suite_definitions = [ ++ s for s in suite_definitions ++ if not is_suite_definition_free(s, nonfree_test_names)] ++ nonfree_suite_names = [get_name_from_definition_file(s) ++ for s in nonfree_suite_definitions] ++ nonfree_definitions = nonfree_test_definitions + nonfree_suite_definitions ++ nonfree_definition_names = sorted(set(nonfree_test_names ++ + nonfree_suite_names)) ++ ++ # Delete nonfree definitions. ++ for nonfree_definition in nonfree_definitions: ++ shutil.rmtree(nonfree_definition.parent) ++ ++ # Delete nonfree entries in index files. ++ indexes = get_index_files(root_dir) ++ sanitize_index_files(indexes, nonfree_definition_names) ++ ++ logger.info('The following nonfree test suites were deleted:\n%s', ++ pprint.pformat([str(d) for d in nonfree_definitions])) ++ ++ # This is necessary to avoid downloading the ++ # OpenBenchmarking-provided tests metadata which includes all the ++ # tests, including teh proprietary ones. ++ user_config_file = get_default_user_config_file(root_dir) ++ disallow_refreshing_repositories(user_config_file) ++ logger.info('Disabled test metadata updates in default user config') ++ ++ ++if __name__ == '__main__': ++ parser = argparse.ArgumentParser( ++ description='Remove nonfree cached metadata') ++ parser.add_argument('--root-dir', type=str, ++ help='the Phoronix Test Suite root directory', ++ default=DEFAULT_ROOT_DIR) ++ args = parser.parse_args() ++ ++ main(args.root_dir) +diff --git a/documentation/phoronix-test-suite.md b/documentation/phoronix-test-suite.md +index c2e04ae4e..0c71ecf37 100644 +--- a/documentation/phoronix-test-suite.md ++++ b/documentation/phoronix-test-suite.md +@@ -817,7 +817,18 @@ The Phoronix Test Suite can be simply extracted from the downloaded *.tar.gz* or + + + ### Generic Installation +-Running *install-sh* from the root directory of the Phoronix Test Suite will install the software for system-wide access. By default the *phoronix-test-suite* executable is in */usr/bin/* , the Phoronix Test Suite files in */usr/share/phoronix-test-suite/* , and the documentation in / *usr/share/doc/phoronix-test-suite/* . Root access is required. The default installation prefix is /usr/ but can be adjusted as the first argument (example: *install-sh /home/user/* to install the Phoronix Test Suite in your home directory). ++Running *install-sh* from the root directory of the Phoronix Test ++Suite will install the software for system-wide access. By default the ++*phoronix-test-suite* executable is in */usr/bin/* , the Phoronix Test ++Suite files in */usr/share/phoronix-test-suite/* , and the ++documentation in / *usr/share/doc/phoronix-test-suite/* . Root access ++is required. The default installation prefix is /usr/ but can be ++adjusted as the first argument (example: *install-sh /home/user/* to ++install the Phoronix Test Suite in your home directory). Use the ++`--free-software-only` option of the `install-sh` script if you'd like ++to be offered only test profiles and suites relying on free software ++only. Note that this option disables the automatic fetching of new ++tests definitions from OpenBenchmarking.org. + + + ### Debian/Ubuntu Installation +@@ -937,6 +948,11 @@ If this option is set to *TRUE* , the system logs (i.e. dmesg, lspci, lsusb, Xor + #### AllowResultUploadsToOpenBenchmarking + This option defines whether to allow/support result uploads to OpenBenchmarking.org. If set to *FALSE* , the user will not be prompted to allow uploading of test results to the public site. + ++#### AllowRefreshingRepositoryLists ++This option defines whether to allow refreshing the test profiles ++(metadata) content from OpenBenchmarking.org. If set to *FALSE* , ++only the locally available test profiles will be used, and no updates ++will made to it. + + ## General Options + #### DefaultBrowser +diff --git a/install-sh b/install-sh +index f6228cde9..ff9bf9bd7 100755 +--- a/install-sh ++++ b/install-sh +@@ -1,4 +1,5 @@ + #!/bin/sh ++set -e + + # Phoronix Test Suite + # URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/ +@@ -28,6 +29,13 @@ else + INSTALL_PREFIX="$1" + fi + ++# XXX: Perhaps this should be the default? ++for arg in "$@"; do ++ if [ "$arg" = "--free-software-only" ]; then ++ FREE_SOFTWARE_ONLY=yes ++ fi ++done ++ + # Ensure the user is in the correct directory + if [ ! -f pts-core/phoronix-test-suite.php ] + then +@@ -114,6 +122,11 @@ else + + fi + ++# Post-installation process. ++if [ -n FREE_SOFTWARE_ONLY ]; then ++ ./delete-nonfree-metadata --root-dir="$DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/" ++fi ++ + echo -e "\nPhoronix Test Suite Installation Completed\n + Executable File: $INSTALL_PREFIX/bin/phoronix-test-suite + Documentation: $INSTALL_PREFIX/share/doc/phoronix-test-suite/ +@@ -124,4 +137,3 @@ then + echo "Installed to chroot: $DESTDIR" + echo "Please update your desktop and mime-database manually" + fi +- +diff --git a/pts-core/objects/pts_openbenchmarking.php b/pts-core/objects/pts_openbenchmarking.php +index 081f55c31..e9396ea36 100644 +--- a/pts-core/objects/pts_openbenchmarking.php ++++ b/pts-core/objects/pts_openbenchmarking.php +@@ -330,6 +330,11 @@ class pts_openbenchmarking + } + public static function refresh_repository_lists($repos = null, $force_refresh = false) + { ++ if(!pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AllowRefreshingRepositoryLists', true)) ++ { ++ return true; ++ } ++ + if($repos == null) + { + if($force_refresh == false) +diff --git a/pts-core/static/user-config-defaults.xml b/pts-core/static/user-config-defaults.xml +index 878c5137f..c9a67df5f 100644 +--- a/pts-core/static/user-config-defaults.xml ++++ b/pts-core/static/user-config-defaults.xml +@@ -6,6 +6,7 @@ + 3 + FALSE + TRUE ++ TRUE + + + -- 2.36.1