public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [Automated-testing] [PATCH 1/2] tst_test: Add support for device discovery
Date: Wed, 24 Jun 2020 11:05:23 +0200	[thread overview]
Message-ID: <20200624090523.GA29350@yuki.lan> (raw)
In-Reply-To: <574e52f4-8988-a562-57c5-274a86e6e8cb@xilinx.com>

Hi!
> > +++ b/device-discovery.sh
> > @@ -0,0 +1,5 @@
> > +#!/bin/sh
> > +
> > +if [ "$1" = "UART_RX-UART_TX" ]; then
> 
> I am not getting this condition and what exactly you want to tell by that.
> > +	echo "UART_RX=/dev/ttyUSB0 UART_TX=/dev/ttyUSB0"
> 
> In fpga world you can connect two uart inside chip and test different
> device drivers that's why at the end of day only user knows which uarts
> are connected to each other and none will be able to come up with
> universal device-deiscovery.sh script to cover all these cases.

That's the whole point of the patchset.

This is a script I've used for testing with a hardware loopback on the
USB-to-serial bridge, it's not supposed to be included in the end
result. I've kept it there so that people will get the idea how it
should look like.

Also script is passed which devices the test requests, so for i2c eeprom
the parameters would be different and the script would output, for each
present eeprom, a line with an address, bus, etc.

The whole point of the script is to do plug into a Lab CI so that the
information about test device, in this case UART loops, is exposed to
the test. In a real world situation it would either do a call to a
whatever is maintaining a lab hardware inventory, or be written down by
a user before these tests are executed.

> Not exactly sure how LTP handles this in general but I think it makes
> sense to extend your test (txt_test) parameters to pass TX/RX channel
> via parameters directly to test.
> 
> Something like this
> uart01_115200 uart01 -b 115200 -t /dev/ttyXX0 -r /dev/ttyXX1

You can pass them in an environment variables. If UART_TX and UART_RX
are set the device discovery is not attempted at all and the test just
uses these.

If they are not the script is executed and the test loops over the
result(s). It would be more complicated if the devices were passed over
command line parameters since we would have to re-execute the binary.

> IIRC RX and TX device could be the same which can mean that you want to
> use internal or external loopbacks.

The test works fine with external loopback. We will have to add a way
how to pass "enable loopback in MCR" to the test if we want to use that,
but that falls under the "Missing pieces" in the patch description.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2020-06-24  9:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 11:28 [LTP] [PATCH 0/2] [RFC] Device discovery & UART test Cyril Hrubis
2020-06-23 11:28 ` [LTP] [PATCH 1/2] tst_test: Add support for device discovery Cyril Hrubis
2020-06-24  8:41   ` [LTP] [Automated-testing] " Michal Simek
2020-06-24  9:05     ` Cyril Hrubis [this message]
2020-06-24  9:21       ` Michal Simek
2020-06-24  9:29         ` Cyril Hrubis
2020-06-24  9:57           ` Cixi Geng
2020-06-24 10:10             ` Cyril Hrubis
2020-06-24 10:53           ` Michal Simek
2020-06-24 18:16   ` [LTP] " Carlos Hernandez
2020-06-25 12:34     ` Cyril Hrubis
2020-06-23 11:28 ` [LTP] [PATCH 2/2] device_drivers/uart01: Add uart01 test Cyril Hrubis
2020-06-24  9:07   ` [LTP] [Automated-testing] " Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200624090523.GA29350@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox