From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D26444111; Thu, 30 May 2024 17:41:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39121427D8; Thu, 30 May 2024 17:41:32 +0200 (CEST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mails.dpdk.org (Postfix) with ESMTP id 480D7427DC for ; Thu, 30 May 2024 17:41:31 +0200 (CEST) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52b4fcbf078so1328010e87.0 for ; Thu, 30 May 2024 08:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1717083690; x=1717688490; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FsdnIMrOVmqCoFU4yJiZEMATSMKzYbrb8EIGkvrqoio=; b=kD6UnAcumHSgSO+mqYOrx8gb9VO3sqj7noFwOEbPrlTwE7X1AFUD81FQNuKkPlJp1G 2ziY4S1uj1hYqvtCVBOvNEE4/wI++J0fdKITEbSoihq8wFsHTO163I/GXWVt2+I8aF9K P5rdJwbVHvAlzhKc74/i6sCh7TY5ucZ3VowcitRu4wz9jqji9abCaYqIDice2RvhmUql Ye1b8VD7btvYttRaYD9CdpKRCiF9Jj4PKyfcWqxr5T4wyo7K8x2bGDKcHON/JrKhAT5L uqDd/ONLEKy1rXd4ImZEbjXzTlGHhZXWwOuChdR5J+QML2jtHAuyOjE/tqklu36yluLV HXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717083690; x=1717688490; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FsdnIMrOVmqCoFU4yJiZEMATSMKzYbrb8EIGkvrqoio=; b=lCJCw2opMUDnZe16a/AZcaYqfmvrCejBqr13sT8DbuLt8r7yRfDtubLas9dC1iOJHu SCQHtePi4NGyPVtkefoB77rH+mp4k7uMEyGN6TW2kt0ML5lSYDgM4FN3k/JkvAti1gyS 4TYDidbe6r1PuoxWU04YIyYlQuMiq+qbZMtGAQIL442FgJarfvoxjlX7BxqkwjjRAKgd VwrEHPIrhCb0FmdEJDvqrxvSfpyxxyRYRT0LjQL24z/U+qvXTRBaeI6tOZH1rqNCm+fe od9bmsfxm9/1W9gEyGmGedCoOqKyiF5aXebodTTqKHqpZUnwTHB/OXXLwzOSpjte9l7v yAjw== X-Gm-Message-State: AOJu0YwcsyafKaWCSbL6c1iAVDRKeBowfoM1BHM5PyO4y5NP9R/ghw2k koHjYUFz+VrPh98cq4mrhPFvMPull0lD5d4XxZS7x+DH/ysM0b6E/gjZLF5i75QScBZNPLrF+nh cKznplvD8KT2O15KXLIeOOi0loAHHFFncte1O2A== X-Google-Smtp-Source: AGHT+IE7DsfNuvniiJf0JQ3m5nKKwkYgTNyO51ETqGz+MCBrdToK18gyAeNmNxv9l4Am0qLHUfvrMzweNYw7ODaTacM= X-Received: by 2002:ac2:4c05:0:b0:52b:8342:e0fc with SMTP id 2adb3069b0e04-52b8342e17bmr420986e87.54.1717083690562; Thu, 30 May 2024 08:41:30 -0700 (PDT) MIME-Version: 1.0 References: <20240122182611.1904974-1-luca.vizzarro@arm.com> <20240514121023.1957025-1-luca.vizzarro@arm.com> <20240514121023.1957025-3-luca.vizzarro@arm.com> In-Reply-To: <20240514121023.1957025-3-luca.vizzarro@arm.com> From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Thu, 30 May 2024 17:41:19 +0200 Message-ID: Subject: Re: [PATCH v5 2/3] dts: constrain DPDK source argument To: Luca Vizzarro Cc: dev@dpdk.org, Jeremy Spewock , Paul Szczepanek Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > diff --git a/doc/guides/tools/dts.rst b/doc/guides/tools/dts.rst > index 6993443389..f64ab7f732 100644 > --- a/doc/guides/tools/dts.rst > +++ b/doc/guides/tools/dts.rst > @@ -215,41 +215,38 @@ DTS is run with ``main.py`` located in the ``dts`` directory after entering Poet > .. code-block:: console > > (dts-py3.10) $ ./main.py --help > - usage: main.py [-h] [--config-file FILE_PATH] [--output-dir DIR_PATH] [-t SECONDS] [-v] [-s] [--tarball FILE_PATH] > + usage: main.py [-h] [--config-file FILE_PATH] [--output-dir DIR_PATH] [-t SECONDS] [-v] [-s] (--tarball FILE_PATH | --revision ID) > [--compile-timeout SECONDS] [--test-suite TEST_SUITE [TEST_CASES ...]] [--re-run N_TIMES] > > - Run DPDK test suites. All options may be specified with the environment variables provided in brackets. Command > - line arguments have higher priority. > + Run DPDK test suites. All options may be specified with the environment variables provided in brackets. Command line arguments have higher > + priority. > > options: > -h, --help show this help message and exit > --config-file FILE_PATH > - [DTS_CFG_FILE] The configuration file that describes the test cases, SUTs and targets. > - (default: conf.yaml) > + [DTS_CFG_FILE] The configuration file that describes the test cases, SUTs and targets. (default: > + /home/lucviz01/dpdk/dts/conf.yaml) The path has changed. > diff --git a/dts/framework/settings.py b/dts/framework/settings.py > index b19f274f9d..50d8929450 100644 > --- a/dts/framework/settings.py > +++ b/dts/framework/settings.py > @@ -84,7 +90,24 @@ > from typing import Callable, ParamSpec > > from .config import TestSuiteConfig > -from .utils import DPDKGitTarball > +from .exception import ConfigurationError > +from .utils import DPDKGitTarball, get_commit_id > + > + > +def _parse_tarball_path(file_path: str) -> Path: > + """Validate whether `file_path` is valid and return a Path object.""" > + path = Path(file_path) > + if not path.exists() or not path.is_file(): > + raise argparse.ArgumentTypeError("The file path provided is not a valid file") > + return path > + > + > +def _parse_revision_id(rev_id: str) -> str: > + """Validate revision ID and retrieve corresponding commit ID.""" > + try: > + return get_commit_id(rev_id) > + except ConfigurationError: > + raise argparse.ArgumentTypeError("The Git revision ID supplied is invalid or ambiguous") I made the comment about ordering in the other patch with these functions in mind, so let's not forget these.