From nobody Wed Apr 27 11:42:22 2022 X-Original-To: dev-commits-ports-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 3FF3719927B2; Wed, 27 Apr 2022 11:42: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 4KpH0t5Bgvz4RZP; Wed, 27 Apr 2022 11:42:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651059742; 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=qlZ9sY0SA9L7NKjDtU97eYkPcgjLi3OcbubC5IybS08=; b=eduOgys5FlbmjP7jcYsl8NHAoM1l1lhXlhDTXOpdqCZio6ZZcsvat/1w3RYWzzCnMNSv4j 1SIp8pnHLd3+TaSAkZ+J1QcNFpmnagpXFyePb/Zj0mWNiT5zkTD/4GVdhjgwzfLxGCfE1N nThSvXiX2SewaPWTFvUtL94OUBM9GFuXyDJrHVjzXKCCVuvxvEqAi27n7cL8hFS7QXnkPc NuR06qQHqo1tdJKxdx0Z5717wcXMg40jbw1oWPEVYErZMMuSLVb/l3pptLVORWMwV9krKC /rbchqUnCDICHxPkiNennam+CLLbkIkerH2QnlbUH4rH3HtQkbGs15f6ap4NTg== 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 902B723265; Wed, 27 Apr 2022 11:42: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 23RBgMFP021579; Wed, 27 Apr 2022 11:42:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23RBgMFl021578; Wed, 27 Apr 2022 11:42:22 GMT (envelope-from git) Date: Wed, 27 Apr 2022 11:42:22 GMT Message-Id: <202204271142.23RBgMFl021578@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dmitry Marakasov Subject: git: d7176a1b200c - main - security/py-securesystemslib: switch to USES=pytest, fix tests List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: amdmi3 X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7176a1b200c18e8db3c4728de0c1cb5bb170b99 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651059742; 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=qlZ9sY0SA9L7NKjDtU97eYkPcgjLi3OcbubC5IybS08=; b=HLDyib5i5W7madEP79SIFdxv/Qak+6sW7ytRxrh1Fw9ph1ZrYSMCxFpyLDEs/LKYvS2bHw QiZsB/b95REuAz3e6NSRPq349eB0W2vGYFeWy8b3xaieqlvXkHWHnrp2eES2XW3bMYgoNP lPxthWc7CG+sP/uJ9KvL0hgR/NZFtYlX3PduwfHbTV2/cbzgEigy8mPdSrQqcW21dt1hnm 6Xj4/18D0fPf1VGa6/pNQzQqxbLFT+TS4qtoAc2qTne960K0sV2LM5CBxrHcMb7vsXmmSL JPB6vTd7+TIf2qG63rB/WF5rar+Plmao0YNIEc/z8XgX3vcdNNri2C+aHB+ixw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651059742; a=rsa-sha256; cv=none; b=e8dgsCrZBBqLkPw0d8YIc72qY/nEHiMrori7uKr2Cz9LT6ni2CLJCBzdzKhHJ6FZI8oI9J puG4F+ZdzN+WoPjg1N5K/0Oh7YzJUOgLy/aWopPJ+3vlZGM9igSH1Z8zSykw4e3kHrR3gF gLIXBSXbyanlBwJrlScjM4dPK4eDSWXVeElxAPQ1ajpFVZw2mslTXMV/p3TesvINR3UfaJ UqPrzUueHwgq9OkF2dkerAdGGiGMKFR09psw6keq/MlySbuT37WOyT1XDiMs9nEM1I0aCD nI8noBhkgvcXeGzuVtYBqTOoZG+qVcoIZl24n2Eg1X/DQLM/W/sh3Eqwjn0pkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by amdmi3: URL: https://cgit.FreeBSD.org/ports/commit/?id=d7176a1b200c18e8db3c4728de0c1cb5bb170b99 commit d7176a1b200c18e8db3c4728de0c1cb5bb170b99 Author: Dmitry Marakasov AuthorDate: 2022-04-26 14:40:31 +0000 Commit: Dmitry Marakasov CommitDate: 2022-04-27 11:42:12 +0000 security/py-securesystemslib: switch to USES=pytest, fix tests Reported by: reprise Approved by: portmgr blanket --- security/py-securesystemslib/Makefile | 8 ++--- .../files/patch-tests_test__process.py | 40 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/security/py-securesystemslib/Makefile b/security/py-securesystemslib/Makefile index 643d8ee8ef73..cbfc3e75a93a 100644 --- a/security/py-securesystemslib/Makefile +++ b/security/py-securesystemslib/Makefile @@ -13,14 +13,12 @@ LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}colorama>=0.3.9:devel/py-colorama@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}cryptography>=3.3.2:security/py-cryptography@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pynacl>1.2.0:security/py-pynacl@${PY_FLAVOR} -TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} +TEST_DEPENDS= ${LOCALBASE}/bin/gpg:security/gnupg -USES= python:3.7+ +USES= python:3.7+ pytest USE_PYTHON= autoplist distutils +PYTEST_ARGS= tests NO_ARCH= yes -do-test: - @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs tests - .include diff --git a/security/py-securesystemslib/files/patch-tests_test__process.py b/security/py-securesystemslib/files/patch-tests_test__process.py new file mode 100644 index 000000000000..1801210ce421 --- /dev/null +++ b/security/py-securesystemslib/files/patch-tests_test__process.py @@ -0,0 +1,40 @@ +https://github.com/secure-systems-lab/securesystemslib/pull/403 + +--- tests/test_process.py.orig 2022-02-10 09:48:17 UTC ++++ tests/test_process.py +@@ -39,7 +39,7 @@ class Test_Process(unittest.TestCase): + + stdin_file = open(path) + cmd = \ +- "python -c \"import sys; assert(sys.stdin.read() == '{}')\"" ++ sys.executable + " -c \"import sys; assert(sys.stdin.read() == '{}')\"" + + # input is used in favor of stdin + securesystemslib.process.run(cmd.format("use input kwarg"), +@@ -58,7 +58,7 @@ class Test_Process(unittest.TestCase): + def test_run_duplicate_streams(self): + """Test output as streams and as returned. """ + # Command that prints 'foo' to stdout and 'bar' to stderr. +- cmd = ("python -c \"" ++ cmd = (sys.executable + " -c \"" + "import sys;" + "sys.stdout.write('foo');" + "sys.stderr.write('bar');\"") +@@ -102,7 +102,7 @@ class Test_Process(unittest.TestCase): + + def test_run_cmd_arg_return_code(self): + """Test command arg as string and list using return code. """ +- cmd_str = ("python -c \"" ++ cmd_str = (sys.executable + " -c \"" + "import sys;" + "sys.exit(100)\"") + cmd_list = shlex.split(cmd_str) +@@ -118,7 +118,7 @@ class Test_Process(unittest.TestCase): + def test_run_duplicate_streams_timeout(self): + """Test raise TimeoutExpired. """ + with self.assertRaises(securesystemslib.process.subprocess.TimeoutExpired): +- securesystemslib.process.run_duplicate_streams("python --version", ++ securesystemslib.process.run_duplicate_streams(sys.executable + " --version", + timeout=-1) + +