Telnet.write() is too fast for some hardware targets

150 views
Skip to first unread message

Piotr Król

unread,
Jul 23, 2017, 6:05:19 PM7/23/17
to robotframe...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi all,
I'm trying to utilize Robot Framework to automate PXE boot testing.
I'm using RS232-USB adapter and ser2net set to 115200.

I spent couple hours trying to figure out what is wrong with my test:

```
Test1
Write Bare help\n
Read Until iPXE>
```

and it looks like the problem is that `Telnet.write()` function is to
fast that my hardware configuration cannot handle that. When I tried:

```
Test1
Write Bare h
Write Bare e
Write Bare l
Write Bare p
Write Bare \n
Read Until iPXE>
```

In output buffer I have just `h`, but adding `Sleep 0.1` in between
writes give me correct result.

I wonder if anyone faced similar issue. Most probably there is no
interest in having API for slow typing in Telnet. Obviously writing
anything with above manner would not be effective. Keeping fork of
robotframwork with modified write function also doesn't seem to be
good long term solution.

What would be recommended way of applying this workaround ?

Best Regards,
- --
Piotr Król
Embedded Systems Consultant
https://3mdeb.com | @3mdeb_com
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE4DCbLYWmfoRjKeNLsu5x6WeqnkwFAll0xQ4ACgkQsu5x6Weq
nkw74w/9HG5+E58iIhssPB57d0q/FfsdNJXg/QY/GcAhKdupU580DaurrQfLLYTY
6Kqp4ektZ0EPR+UARakdd2vls0j39umO5UgBBnueeU3ryylE8YIGWwDL0gat5gXh
Nz22VOy6OUOgaF+/5y1HgZB1Z5AB7UQHaIlF6XOfn3ScP5UhlTfPuHGVBlMDHOFX
F+VKZ4ciPIuaKQ6/J8KYvqgIcUxvI2JMz2pTPci4mQB70w+w5ZHcEKOkfbSfDSYT
S5HkmATMB1rJUnXIUdysv7SER+kUf0vStBDG/thRU2iQJ+9Qe6E+1BvApDuBG8YW
OlxrCOzKMGoU5FEo+fK/HWiRr4J2YeLUuOEnhC2593xji8JdiW079pKneg7iWN8P
oZzFnhvktr22eVz8jZ7brGWmqoEjdBMZPrThvLI6pVfjI3B8s+M1cDQnNgPMr5JS
Mzgd+0fwdhobboWsPD7pHpDfd6r/St/Hs0Ai/5OzVp8Jn84VQolmDaELUWAUVlt0
5gM7U0vZiknGIrM/wJtD0GY8ik6oC6YgP2xH6+zE4uedQub85BE+CByGKWMErB3E
sDx6aBr8FhrcQoY9uxZG/tcRqencmBYk6MYfijwyTLcAGCLZDfZ1BCm8WRp1qw0G
Mp5TcrXXP9nLsYEuI08C/iMtXl2w57Jq3YthO7ckGt2IgR634L0=
=Rdfp
-----END PGP SIGNATURE-----

Hélio Guilherme

unread,
Jul 23, 2017, 7:17:49 PM7/23/17
to robotframework-users
Must you connect at 115200 BAUD? If not you could slow down the communication, say at 9600 BAUD.
I don't know the libraries, but if they allow to change the speed after doing your text input, then you could go back to normal speed.

This is just my 2 cents (I never used telnet library).

My Favorite Open Source Projects
awsome-lists gretl meld robotframework wxPython
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.com/clientes/aff.php?aff=258


--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Pekka Klärck

unread,
Jul 29, 2017, 6:06:35 AM7/29/17
to piotr...@3mdeb.com, robotframework-users
Hello,

If you can find a way how the Telnet library could be enhanced to slow
down writing that could be considered. If you have more special needs,
it might be easiest for you to implement a custom library instead.
Robot's library uses Python's `telnetlib` internally and you could
easily it from your own library too.

Cheers,
.peke
> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Michal Smrž

unread,
Jul 31, 2017, 5:23:31 AM7/31/17
to robotframework-users
I agrree with custom library, but if you want to stick with robot syntax for portability, this should do the trick.

*** Settings ***
Library    String

*** Keywords ***
Slownet
    [Arguments]    ${data}    ${sleep_after_send}=${0.1}
    [Documentation]    One letter at time
    @{splitted}=    Split String To Characters    ${data}
    : FOR    ${char}    IN    @{splitted}
    \    Log    Sending ${char}
    \    Sleep    ${sleep_after_send}

*** Test Cases ***
Test
    Slownet     Send this slowly
   

 
Reply all
Reply to author
Forward
0 new messages