From nobody Thu Feb 09 16:11:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PCMLM2RLDz3pl9K; Thu, 9 Feb 2023 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCMLL6dBMz4HrC; Thu, 9 Feb 2023 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqTM5rmGfZskrQlgG78Poj7Zbu1zDhspliQir7jmFd4=; b=xG7Enm7sZsWZpgzcHVBnsnBosRbvE/E6AlNu6QioVAwj0UibC/teNxxOaSYWsff7ESfqt0 V3TZhl+vqvqJlTS08twwj06k2CrOGQCQlsdZd4DmqjD5+do0uTEtu5P4XQ8q9t2Xqp8DhM 8UrsvLt58JRgfcJJH1m31rZQQapH9GSSO5E+zOOxBBrRSOkjKmzZ0cRELYlZoKk2Tv6mR2 hjFKUE8MfeSGwRxv1ClAyKCYCOxhkrJdkBCgN7h8aeJJJjIdFr6zxaUN7ZI+znQzrZdSS5 pXbhmDo8dDBWCOUGFZadCiPmDUD9dkTAbQwebta2X+XutKMRXIhaRRsFivKckA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqTM5rmGfZskrQlgG78Poj7Zbu1zDhspliQir7jmFd4=; b=WYGxmOlRDnb1IIQUtQJvWaRIuG+TR+ih7ANagnhVRUS3IP+gMPkNk6gHvn9C4CrcwrZZbt 1BF7GlQXTNSV1AOb1/1bNUggs8HGLSq3u0U1G8/k3rUfesNfIiwHAWETgZIhXkUC0FcxuG /OAXXxnjeY/327vhrlZykM079A68J66/nkzriYIZ4KsjymKiq1wPzyajtxg3NRPv24V5mP 9HKFHOMIwEVpqT/s6pZcuwwS/8eGloxH61rd9b0fiE6v+2hEBvYA/Wm6g/sRp0sYVEqwtI gbmZ4nm6IsHJUrFOWR6UdgEUk0yiIPgegXspppcgjf7/fyboueusMLjFUzcqJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959082; a=rsa-sha256; cv=none; b=M2QHF9neVubFenho4B0FiM37DVu2Pf1lsSZieBklm8mNi3GQZJMKAhyx7dYtC8R3bGufvz rVJEqaRUueSyUCpg4R+Ft/vAuISL6CSKh9VyjOJz8uEw15k7SYb2X5+YZJTBH6Fy8J6h4B 8Btu1QI5OvcFFrEM3UVUuQNwVI01x/l3h/ZoCNHVc0klqxuACi/qHPJKWqUoCuVzX3QF49 MldL1JtyapHrCwH5T/6AhzvG+mxIntBgbo4BBg2sxB1HmOcR929fuRdZXNiLCp9RciDjbq Xf4Rw0fAE/ZdqHWhT5BuNMw5HghKMUE1Z7Mq6S0A1nCWpgS7C2EIYG09Mw4Cqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLL5l8PzkFd; Thu, 9 Feb 2023 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBM9S005402; Thu, 9 Feb 2023 16:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBMlX005401; Thu, 9 Feb 2023 16:11:22 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:22 GMT Message-Id: <202302091611.319GBMlX005401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a28a4cb5e909 - stable/13 - atf_pytest_wrapper: fix pytest output truncation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 commit a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 Author: Jose Luis Duran AuthorDate: 2022-12-28 17:28:59 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:45:28 +0000 atf_pytest_wrapper: fix pytest output truncation Pass `-vv` to pytest in order to always get the full output. While here, enforce the modeline. Differential Revision: https://reviews.freebsd.org/D37894 MFC after: 2 weeks (cherry picked from commit 058ac3e8063366dafa634d9107642e12b038bf09) --- .../atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp | 55 +++++++++++----------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp index 7f6e886a16d9..78b045b9775f 100644 --- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp +++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp @@ -65,7 +65,7 @@ class Handler { // * without schebang args // atf_wrap /path/to/script -l // Running test: - // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname + // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname void Parse(int argc, char **argv) { if (flag_debug) { PrintVector("IN", ToVector(argc, argv)); @@ -89,34 +89,34 @@ class Handler { // The next argument is a script name. Copy and keep argc/argv the same // Show usage for empty args if (argc == 0) { - Usage("Must provide a test case name", true); + Usage("Must provide a test case name", true); } script_path = std::string(argv[0]); int c; while ((c = getopt(argc, argv, "lr:s:v:")) != -1) { switch (c) { - case 'l': - flag_list = true; - break; - case 's': - src_dir = std::string(optarg); - break; - case 'r': - dst_file = std::string(optarg); - break; - case 'v': - { - std::string kv = std::string(optarg); - size_t splitter = kv.find("="); - if (splitter == std::string::npos) { - Usage("Unknown variable: " + kv, true); - } - kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); - } - break; - default: - Usage("Unknown option -" + std::string(1, static_cast(c)), true); + case 'l': + flag_list = true; + break; + case 's': + src_dir = std::string(optarg); + break; + case 'r': + dst_file = std::string(optarg); + break; + case 'v': + { + std::string kv = std::string(optarg); + size_t splitter = kv.find("="); + if (splitter == std::string::npos) { + Usage("Unknown variable: " + kv, true); + } + kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); + } + break; + default: + Usage("Unknown option -" + std::string(1, static_cast(c)), true); } } argc -= optind; @@ -138,7 +138,8 @@ class Handler { } std::vector BuildArgs() { - std::vector args = {"pytest", "-p", "no:cacheprovider", "-s", "--atf"}; + std::vector args = {"pytest", "-vv", "-p", + "no:cacheprovider", "-s", "--atf"}; if (flag_list) { args.push_back("--co"); @@ -179,7 +180,7 @@ class Handler { // Pass ATF kv pairs as env variables to avoid dealing with // pytest parser for (auto [k, v]: kv_map) { - setenv((kAtfVar + k).c_str(), v.c_str(), 1); + setenv((kAtfVar + k).c_str(), v.c_str(), 1); } } @@ -190,7 +191,7 @@ class Handler { // allocate array with final NULL char **arr = new char*[args.size() + 1](); for (unsigned long i = 0; i < args.size(); i++) { - // work around 'char *const *' + // work around 'char *const *' arr[i] = strdup(args[i].c_str()); } return execvp(binary.c_str(), arr) == 0; @@ -204,7 +205,7 @@ class Handler { "not_found__" << std::endl; } else { std::cout << "execvp(" << kPytestName << ") failed: " << - std::strerror(errno) << std::endl; + std::strerror(errno) << std::endl; } }