3.2. Package management
Goal
- Create a new resource file named
apk-management.resource
. - Create a new keyword named
APK Search
in the previously created resource file.- This keyword should accept two arguments:
remote_host
andpackage_name
. - Using these arguments the keyword should execute
apk search package_name
command the givenremote_host
. - You should check that the command was executed successfully and log the found package(s) to the console.
- This keyword should accept two arguments:
Solution
Hints
Using one particular argument of Execute Command
keyword will make sure that it returns the return code of the executed command. You can use that return code to check if the command was executed successfully.
Click here to learn more about the parameters of Execute Command
keyword..
Solution: tests/03-remote/resources/apk-management.resource
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Solution: tests/03-remote/01-connection.robot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Results
Inside the tests
folder, execute the following command to execute 03-Remote
suite.
1 |
|
The output should be something like this:
-----------------------------------------------------------------------------
Test Package Management
The following packages were found: ipython-7.14.0-r0
ipython-doc-7.14.0-r0
py3-ipython_genutils-0.2.0-r2
Test Package Management | PASS |
You can check the generated log.html
file to see how your test cases worked.
Last update: June 22, 2020