From nobody Mon Jan 15 19:54:54 2024 X-Original-To: freebsd-arch@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 4TDNCP3qXdz57RpT for ; Mon, 15 Jan 2024 19:54:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDNCP3Jtsz4fJj for ; Mon, 15 Jan 2024 19:54:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705348497; 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=3jSaCpDYGzBUe+TQxyciFU56G3Vt1fkWbHfKZr0My9Q=; b=VvoMVshEiY3VGKcuQWfY4XFCcQEY/eNQMQ3Gb2RuVGS3XGHmqgnnr6KJFxTNUTbYsdWob3 HJgd4j6T8lwFGQ3d0UqnVXfa+XuaoUSG8Y+ie2rvA2j+8bk7dxNg3QRWsdzGgauPhy8MwN 8MtIIh3K3fCqnA2/R8+80+Fd8B3n8kMS17gfCE8fv5J+H78UOdT79bMY3wfgmcSy7t9uFM i5TEOEIPaPFp05uKg3PfkyRAYk4ebrIbPNZxv+yo1ZCkm5Fml9NStgUZ4QhdrIsSLm/TbK C6XcOWUZqZGwtxnHlxsCgqk4qQ6V2HpbmNhaOtslWcsPuOsjpzvafgWTAo/qhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705348497; 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=3jSaCpDYGzBUe+TQxyciFU56G3Vt1fkWbHfKZr0My9Q=; b=JhC5fxLm+7SlZXpWb36WFWeWaL8NhWKxEk2BG79IK4xmCk/gf46md4vxA8LKsS69oTMhgq 4CyWTpqsKBbxZ/3mN4R3d+Z0agsL/jUZDsSxl3hBrJEniSclh8MAUf5eoAiAfU8x3BnA+/ 7NYEy6S7cd+P15IwGYUEj56sCAKYYCyI1F9jMFBgeEwmtpXwSP94La304Ri7WXMao/53wL dBlHJOxFk0N/OdzjHmSj+4xj5oJZSnuRUK5RKd7lMj1qjaiUtPDe5fXqwaPQ8U9/THut1r efAHSYRZEU7drZtZv8ahYqhYtq63pkbuf00Tw6vcYCetvPETjAPiVOPltYY7aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705348497; a=rsa-sha256; cv=none; b=ZnOFMk9YACovSjtbztdiyEnGQCJzlyPL8twkXTyXCnIVhunL+6lPQTLGcb4hRhtD5oqy2G hrqY57FRZP3HUFAIwAD5EPAjJkm2N698rlV3j2gx8Ne1PTu8IOUzvVccaMWa7ik1JDSI9r xIsWG4XXbvM2F75TKYmRv7qiBQk1e478wmeJYd3hA5irJOCmL1vc1Sji+5iBfXPpc99vC8 RtQUm/oY5ffyyTYbj5RQRYLWKqytA+rFDVRbyB1Uq0rqwZNknJ/b2GNcAOaS07XksQu8jT C49RgiZC1SaxJPn11V5zsugnyYa9bXm3KPOjfXTCWMynSx+7jf2RHttkz3+04Q== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TDNCP19V7zNTY for ; Mon, 15 Jan 2024 19:54:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <478cf238-ab2e-4185-a5eb-4230b5efe735@FreeBSD.org> Date: Mon, 15 Jan 2024 13:54:54 -0600 List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: freebsd-arch@freebsd.org From: Kyle Evans Subject: orch(1) for tty testing Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I wrote a tool for tty testing w/ lua scripts, inspired by expect(1) and with some similarities, but explicitly without the goal of trying to be compatible: https://git.kevans.dev/kevans/orch An example of its use is here: https://git.kevans.dev/kevans/tty-tests/src/branch/main/test_canon.orch Each spawn() creates a new pts(4) and allows us to drive I/O to the process with write/match statements. I have one or two tests written with it so far and the end result is, IMO, much less painful looking and less error prone than the equivalent in C. It still needs a bit of polish (e.g., improved diagnostics when a match fails), but I'd like to consider importing this somewhere for use in the near future for tty testing given how much it simplifies. I can push it to ports, but we have a private liblua in base so it could be built and banished off into, e.g., /usr/tests/sys/kern/tty/, to make my life just a tad easier re: getting these to run in CI. It's pretty lightweight; the orch binary on my amd64 system clocks in at ~27K, and orch.lua at 13K. Any objections to importing this new tool into /usr/tests or maybe even /usr/libexec? Thanks, Kyle Evans