Command Line Automation

976 views
Skip to first unread message

kmr21

unread,
Jul 15, 2016, 6:31:41 AM7/15/16
to robotframework-users
Hi Everyone,

We are doing protocol testing of network equipment's which are predominantly CLI based. I went across RoBlogs, interacted with RF community in Slack and looked queries posted under this group as well.

I understand run keyword from OperatingSystem Library will do the needful. But I would need to verify the CLI output. Say "show ip interface brief" has all interface status to be up.

The run KW output variable has above CLI stored in it. Challenge I face is to list the interfaces and check their status is up / down. Report those status to program and proceed accordingly.

Thanks,
KMR21

Tatu Aalto

unread,
Jul 22, 2016, 2:17:59 AM7/22/16
to badr...@gmail.com, robotframework-users

Ugh

Command line automation is possible. I would be also looking to the Process library direction, but it depends heavily what kind of automation you are looking for. Do you have Robot Framework installed on the machine, where you run the commands, or do need to use telnet or SSH first to login in the machine. Do your command line actually displayed an UI where there are menus and stuff or are they more like command line commands, example dir or ls, which do not contain state.

All the above is possible, the Process and Telnet are standard libraries in Robot Framework. There is also a SSH[1] library available. Also looking to the remote library direction[2] could be useful.

The best answer which I can give you: try stuff out, fail fast and try something else.

-Tatu
[1] https://github.com/robotframework/SSHLibrary
[2] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#remote-library-interface


--
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.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Bryan Oakley

unread,
Jul 22, 2016, 8:24:11 AM7/22/16
to badr...@gmail.com, robotframework-users
The keywords for running a process can return stdout to the test case. The project "robotframework-lint" (rflint) is a command line tool with robot framework tests. For example, see: https://github.com/boakley/robotframework-lint/blob/master/tests/acceptance/smoke.robot


--
Message has been deleted

kmr21

unread,
Jul 26, 2016, 2:38:15 AM7/26/16
to robotframework-users, badr...@gmail.com
Hi Tatu Aalto, 

Thanks for responding and pointing Process and SSH Library. Robot Framework isn't installed on the machine. Got to telnet to machine. It doesn't have any UI but purely CLI - some thing like "ip config" in command prompt. 

Sure will try, fail and learn.

Thanks,
KMR21

kmr21

unread,
Jul 26, 2016, 2:47:15 AM7/26/16
to robotframework-users

Hi Bryan Oakley,

Thanks for pointing rflint. Gives good idea on how to start with ROBOT program with various sections.

Seems to be a CLI verification program, mine is something very similar. Difference would be here in your's CommandLine is fed on a Linux server where as mine it's a Network Equipment (Router / Switch)

Thanks,
KMR21

Wlad

unread,
Sep 10, 2019, 3:16:50 AM9/10/19
to badr...@gmail.com, robotframework-users
another option to consider for cli automation is pexpect[1] (expect) and similar tools. Pexpect is a Python module, so creating a RF library from it should be quite doable.


Reply all
Reply to author
Forward
0 new messages