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 612AB45463; Fri, 14 Jun 2024 22:06:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2A4F40674; Fri, 14 Jun 2024 22:06:09 +0200 (CEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mails.dpdk.org (Postfix) with ESMTP id D91274060B for ; Fri, 14 Jun 2024 22:06:08 +0200 (CEST) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ec0644a2c3so1997001fa.3 for ; Fri, 14 Jun 2024 13:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718395568; x=1719000368; 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=JvwnM48Fn9IJ6egfQCpzVOIHGk7Rxy50+0OjKe/9qK8=; b=XnAwFdpDI9NYD0ihGu2hUdk93rVRwz5d/uw6gNGa7Z8HJ7uV2UqdFqRlwIThAGaN2j f7x/sBO195cfinpXPflL3+/JtkgixtIlmdQeVUmUCNqaBXev93N/Jgw1k9ubf57jqWTm ZvDjU3FyOYIj25w9owA8h+qk7IcVZi6myqZ1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718395568; x=1719000368; 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=JvwnM48Fn9IJ6egfQCpzVOIHGk7Rxy50+0OjKe/9qK8=; b=GEjWWjN/7JH56bnJeOaJ1NzgHb16gy3zL/uUXv/G+HKrpnIZK0mlo9S1utvE2lpDDG m6efMHeaHqjTDjyvtSVAQtQjOEoCURJIY8war3tBibOc7gYGGiiKb9k/kcc6XuQRY4Mz 0FXNIvYKWX9YbfrxcHVw6dU0nYBbOwCkV4zL27DFBvER2FOcJIzERbveent53LoOldJP cMUk9fU63P5T9++rRL8rbz3Y7ePuHwqhcFRJbjpzqzJ1Zpn1+CO3iNndHuqgIhH5rEmd UR+gD42FO3CMkmwp3l52tYbZXUzJbtnGpk7a7icnIrvIUkjbTNpmixGb5ZXu4nE+rp17 sioQ== X-Gm-Message-State: AOJu0Yx97hFLDZ1Zq8VioLRE7UDLq+3RAc0YE8JkwXjqDz90BVlh3V+c mJQrUD53sOruYKaVJC+Kthqr+flNLD+r4UmgbofEHK2trD9wfp/Q32L0DQW0xYyXxjA1KwZ3BUC /k6Fg3InGDbgWC2MR+Yr/tIm2V9+3igiShJQ83w== X-Google-Smtp-Source: AGHT+IH6L1guHWLMbBZ47wQPXXKI5AAumM6TJ06jr7GabmeuEeXXnZ0OdXf6DSLpt7HFtRUmFSCTs9EnJzCVv6nlflI= X-Received: by 2002:a2e:be05:0:b0:2eb:d5f1:d8b2 with SMTP id 38308e7fff4ca-2ec0e5a8d1amr25980891fa.3.1718395568166; Fri, 14 Jun 2024 13:06:08 -0700 (PDT) MIME-Version: 1.0 References: <20240412111136.3470304-1-luca.vizzarro@arm.com> <20240606213420.254260-1-luca.vizzarro@arm.com> <20240606213420.254260-2-luca.vizzarro@arm.com> In-Reply-To: <20240606213420.254260-2-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 14 Jun 2024 16:05:57 -0400 Message-ID: Subject: Re: [PATCH v5 1/5] dts: fix InteractiveShell command prompt filtering To: Luca Vizzarro Cc: dev@dpdk.org, Jeremy Spewock , =?UTF-8?Q?Juraj_Linke=C5=A1?= , Paul Szczepanek 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 Tested-by: Nicholas Pratte Reviewed-by: Nicholas Pratte On Thu, Jun 6, 2024 at 5:34=E2=80=AFPM Luca Vizzarro wrote: > > When sending a command using an instance of InteractiveShell the output > should filter out the trailing shell prompt when returning it. After > every command two shell prompts are summoned. One is consumed as it is > used as a delimiter for the command output. The second one is not > consumed and left for the next command to be sent. > > Given that the consumed prompt is merely a delimiter, this should not be > added to the returned output, as it may be mistakenly be interpreted as > the command's own output. > > Bugzilla ID: 1411 > Fixes: 88489c0501af ("dts: add smoke tests") > > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > --- > 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 074a541279..aa5d2d9be8 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 > self._logger.debug(f"Got output: {out}") > return out > > -- > 2.34.1 >