From nobody Tue Jan 16 18:56:55 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 4TDytC4KwWz57q61 for ; Tue, 16 Jan 2024 18:57:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDytC2XD3z53Lv for ; Tue, 16 Jan 2024 18:57:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a2c67be31edso637065266b.0 for ; Tue, 16 Jan 2024 10:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705431426; x=1706036226; darn=freebsd.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=mFvIgEnw1hsi9yK48E0n66xc3OjLp1UJc9buD7GwPek=; b=UYUh952pndvx4IcUoV4W/4dlhxHPWZjAYBF0lXgrsh3EjdqryValmo5znAqcTuBdLG Hy1nK59vXqTfXe4ALq8bCYI1IvxSXCJMpaZEJguA6lVVNwzkcg0RKRmG1Yo8gzA2TQp1 dtpLdzzA2dPYyvKy375Fq4WxQzyjg5NaUVuon94RApK6CBe1A23c0bl38dio9Birlmvv s4YeHTb0Wzu/ih6S4O79DbRiqVC9L9OpKZwar308klcuTB1tsX+l3NoBwxkjqMUzSCIq m4YGM1VEV8mO+dy+HtyJM+ranjAK11tO/6bMF5nSDaOkJGzviVT9cUkmQ8wnOVPy/uhW y0aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705431426; x=1706036226; 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=mFvIgEnw1hsi9yK48E0n66xc3OjLp1UJc9buD7GwPek=; b=KRh6+2Tlafe39EuY7UhJbFxmsoKopWlfAkB7V88X+VG1vroA7XaujvJ0880dQhyu98 4r+uoJS4UJun6ltd9ER3l9Rp3c3NeKUsiwHHJmSw0bMMS+/OItS8isi3xSHmoDCk+Csd 6BYDpgAOhyz+8k8D2Nr5rWLNaJIt8jan7usXxPRCd7scSgY3HPVCZbwfaW06v9EYzAGj jkT9Qed2dMTDDbOapLGl5a+G8QKENCxOQhgH3RX3G+XvQS0F+gT1rByQGAwaUQF6vAwa 8bYIVaheCdTAY2kFB08okLhRqu7Ihjre1ufzQP3FxXC6ArDSnj92NvnqY1PtEOm0Evtn gd8Q== X-Gm-Message-State: AOJu0Yx2CyaSVdo9INC99wZ47iIIHwI8qD+WNLxkKx3GG0VIkRxuIZWS wx2nBJ9StKvDJb+nm/Hmk1TGMH8Avhjn+o9kJVaFtw/g2ZT9MA== X-Google-Smtp-Source: AGHT+IEwcD/4MKMKQJu37LcpnuG9K+qMWp5RkNfRV740ItTg9S9LjuAaltFzaayvFcqs4nApKFe++nrdLkZWg7D0CB0= X-Received: by 2002:a17:906:c41:b0:a2a:18ab:6387 with SMTP id t1-20020a1709060c4100b00a2a18ab6387mr2137392ejf.215.1705431426120; Tue, 16 Jan 2024 10:57:06 -0800 (PST) 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 References: <478cf238-ab2e-4185-a5eb-4230b5efe735@FreeBSD.org> In-Reply-To: <478cf238-ab2e-4185-a5eb-4230b5efe735@FreeBSD.org> From: Warner Losh Date: Tue, 16 Jan 2024 11:56:55 -0700 Message-ID: Subject: Re: orch(1) for tty testing To: Kyle Evans Cc: freebsd-arch@freebsd.org Content-Type: multipart/alternative; boundary="00000000000057cd63060f14b2e8" X-Rspamd-Queue-Id: 4TDytC2XD3z53Lv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --00000000000057cd63060f14b2e8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024 at 12:55=E2=80=AFPM Kyle Evans wr= ote: > 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? > Seems useful enough to include. For more than just testing... Warner --00000000000057cd63060f14b2e8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jan 15, 2024 at 12:55=E2=80= =AFPM Kyle Evans <kevans@freebsd.o= rg> wrote:
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.=C2=A0 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 th= e
near future for tty testing given how much it simplifies.=C2=A0 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.=C2=A0 It's pretty lightwei= ght;
the orch binary on my amd64 system clocks in at ~27K, and orch.lua at 13K.<= br>
Any objections to importing this new tool into /usr/tests or maybe even /usr/libexec?

Seems useful enough to in= clude.=C2=A0 For more than just testing...

Warner= =C2=A0
--00000000000057cd63060f14b2e8--