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 1336843E6F; Tue, 16 Apr 2024 10:40:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91BDB402AE; Tue, 16 Apr 2024 10:40:44 +0200 (CEST) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mails.dpdk.org (Postfix) with ESMTP id 874FD4029E for ; Tue, 16 Apr 2024 10:40:43 +0200 (CEST) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5701de9e971so2493313a12.1 for ; Tue, 16 Apr 2024 01:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1713256843; x=1713861643; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nj4tgxrlkHAYOEKeclJpL/QxdHTCsMQlykn7mzJeBHs=; b=n0OszVGSSR3DAKkWZTIBuuOi3XWAdaQZaqc0a4lx39Kyr6s7VnTpk3HZWbQJEqBXC+ dfdr3CZP/nEFkPatTcRNzxu2jS4S8kSiXAo4b3meQ9PQckh665IhVq9RAL7V+PO06JUl LE2ccJiGuRIz4cJqisV7jjiIPMTpTBAwHUrENuLgFoEmpaPBFpOrA7llTbW24VqrIiJL 1TysBGqjIdXJ8CGXQXiBvgwrP6iXrOM/beWacJp0yoVsz0ZRqBD9OCm5/SxyKYy7W4FA jUx3lKSkrhRhA7felNSnUrbFrbk2nINzit4PLMddRrZwv39Ml40Bq0VZO1HMM0B0P8C9 ElJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713256843; x=1713861643; h=content-transfer-encoding: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=nj4tgxrlkHAYOEKeclJpL/QxdHTCsMQlykn7mzJeBHs=; b=M5XuDqa0F+WNqPITorWljLBzsf5Bh7gFwY2Skt3Y2dntWrLj4Uzh2O34RHtVgNNhw7 uvdTleaL+ik+u03s6BrxZPXgqVeNcIBojt8Sw4zlYF7LWyHSWDI37sr1PhmVi0OChm24 5KV5KgF/qv4vN1kuqbhmQyyedBwQ3Z6dKsCkrbzt6OQ8CJt8QjfoqxqSrzmH8jwubzYA XP2RGoaP7JByNDNScTf7nisONCVjVyFpLCXCIkI7gdffh4Q/GEivhBXiei0kKKhBS9rZ 1ZJ84qPtkNhArPtNxC3BL+L6GdpvxuhIJkqXML7qDIydwuE/OWyC0QNKWHCWckwiwcga gqGQ== X-Gm-Message-State: AOJu0YxPgrpITe0oi646rwfGCFcb0qS41y3YT6ymbAY1i0cxNIA/5jmb Qwt3UPmtYvMjkbwHebu3mldLKBMcV9hgaJVoIjmC/PU1JB0cXl1jse6bu+x6Ul8CJsLQapWhTev nMQbajb7m3mhqnVUIXrEXHJtb3+YLYarPNoazjw== X-Google-Smtp-Source: AGHT+IHKiI6WmKYTx3TIezrHsdvYBCcEZOcp8Lsdll0IJCEaCb28FM9nhdajHwc8oJYWvc6HjLkS8JdipErzYhijnZM= X-Received: by 2002:a17:906:1355:b0:a4e:4278:8a01 with SMTP id x21-20020a170906135500b00a4e42788a01mr7445480ejb.11.1713256843115; Tue, 16 Apr 2024 01:40:43 -0700 (PDT) MIME-Version: 1.0 References: <20240412111136.3470304-1-luca.vizzarro@arm.com> <20240412111136.3470304-2-luca.vizzarro@arm.com> In-Reply-To: <20240412111136.3470304-2-luca.vizzarro@arm.com> From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Tue, 16 Apr 2024 10:40:32 +0200 Message-ID: Subject: Re: [PATCH 1/5] dts: fix InteractiveShell command prompt filtering To: Luca Vizzarro Cc: dev@dpdk.org, Jeremy Spewock , Paul Szczepanek , Jack Bond-Preston Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Apr 12, 2024 at 1:11=E2=80=AFPM Luca Vizzarro wrote: > > When sending a command using an instance of InteractiveShell the output > is meant to filter out the leading shell prompt. The filtering logic is > present but the line is appended anyways. > I don't think that's what's happening here. The output collecting logic is "stop when we encounter a prompt, but not the prompt with the command we sent". We could change the comment though. > Bugzilla ID: 1411 > Fixes: 88489c0501af ("dts: add smoke tests") > > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > Reviewed-by: Jack Bond-Preston > --- > Cc: Jeremy Spewock > --- > dts/framework/remote_session/interactive_shell.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dts/framework/remote_session/interactive_shell.py b/dts/fram= ework/remote_session/interactive_shell.py > index 5cfe202e15..8a9bf96ea9 100644 > --- a/dts/framework/remote_session/interactive_shell.py > +++ b/dts/framework/remote_session/interactive_shell.py > @@ -132,11 +132,11 @@ def send_command(self, command: str, prompt: str | = None =3D None) -> str: > self._stdin.flush() > out: str =3D "" > for line in self._stdout: > - out +=3D line > if prompt in line and not line.rstrip().endswith( > command.rstrip() > ): # ignore line that sent command > break > + out +=3D line If we do this, we'll only filter out the last prompt, which may not be desirable, since the last prompt is there only because all of our interactive shells force an extra prompt with _command_extra_chars. One thing we could improve though is removing the distribution welcome message from logs, or at least separate it from the first command sent with the interactive shell. The second option will allow us to see clearly that an interactive session has been established, although we could just emit a shorter log (something like "Started a testpmd session" and then flush the welcome screen output). > self._logger.debug(f"Got output: {out}") > return out > > -- > 2.34.1 >