|
| 1 | +robotframework-scplibrary |
| 2 | +========================= |
| 3 | + |
| 4 | +Robot Framework test library for Secure Copy (SCP) |
| 5 | +-------------------------------------------------- |
| 6 | + |
| 7 | +This library can be used to copy files to and from a remote machine |
| 8 | +using Secure Copy (SCP). It uses the Paramiko SSH Python library (just |
| 9 | +like robotframework-sshlibrary) and an SCP wrapper (‘scp’ by James |
| 10 | +Bardin). |
| 11 | + |
| 12 | +The library does not currently support Jython or IronPython at this |
| 13 | +time. |
| 14 | + |
| 15 | +Installation |
| 16 | +------------ |
| 17 | + |
| 18 | +This library may be installed via PyPI or from the source distribution. |
| 19 | +To install using pip, run: |
| 20 | + |
| 21 | +:: |
| 22 | + |
| 23 | + pip install robotframework-scplibrary |
| 24 | + |
| 25 | +To install from the source distribution, download the repo archive and |
| 26 | +extract the source and run: |
| 27 | + |
| 28 | +:: |
| 29 | + |
| 30 | + python setup.py install |
| 31 | + |
| 32 | +Example |
| 33 | +------- |
| 34 | + |
| 35 | +.. code:: python |
| 36 | +
|
| 37 | + *** Settings *** |
| 38 | + Library SCPLibrary |
| 39 | +
|
| 40 | + *** Test Cases *** |
| 41 | + Grab Files From My Server |
| 42 | + Open Connection 192.168.1.42 username=tyler password=teapot |
| 43 | + Get File remotefile.txt localfile.txt |
| 44 | + Get File /home/tyler/ mytylerdir/ recursive=True |
| 45 | + Close Connection |
| 46 | +
|
| 47 | + Put File On My Server |
| 48 | + Open Connection 192.168.1.42 username=tyler password=teapot |
| 49 | + Put File mytea.txt /home/tyler/ |
| 50 | + Close Connection |
| 51 | +
|
| 52 | +Connection |
| 53 | +---------- |
| 54 | + |
| 55 | +Before files can be transferred, a connection to remote machine must |
| 56 | +first be made. A connection can be made with the ``Open Connection`` |
| 57 | +keyword. Both normal username/password authentication and asymmetric |
| 58 | +key-pair authentication may be used. |
| 59 | + |
| 60 | +Connections should be closed using the ``Close Connection`` keyword when |
| 61 | +they are no longer in use. |
| 62 | + |
| 63 | +File transfer |
| 64 | +------------- |
| 65 | + |
| 66 | +Files and directories can be uploaded to the remote machine using the |
| 67 | +``Put File`` or ``Put Directory`` keywords or downloaded to the local |
| 68 | +machine using the ``Get File`` keyword. |
| 69 | + |
| 70 | +A connection must be made using the ``Open Connection`` keyword before |
| 71 | +file transfers may be made. |
0 commit comments