4f82d5cd31b90344e2b4a705df7a7f7ad452818d
[it/test.git] / ric_robot_suite / robot / resources / appmgr / negative_appmgr_tests.robot
1 *** Settings ***
2 Documentation     Negative tests for the AppMgr: ensure that AppMgr produces expected errors for a variety of invalid requests
3
4 Library           Collections
5 Library           UUID
6
7 Resource          ../global_properties.robot
8 Resource          appmgr_interface.robot
9
10 *** Keywords ***
11 Deploy Duplicate XApp And Expect Error
12      [Documentation]      Ensure AppMgr produces an appropriate error when an already-running XApp is deployed
13      @{d} =               Get Deployed XApps
14      Should Not Be Empty  ${d}      No XApps currently deployed
15      @{names} =           Pluck     Name  ${d}
16      ${xapp} =            Evaluate  random.choice(${names})  random
17      ${status} =          Run Keyword And Ignore Error  Deploy XApp  ${xapp}
18      Should Be Equal As Strings  ${status}          FAIL
19
20 Undeploy Nondeployed XApp And Expect Error
21      [Documentation]      Ensure AppMgr produces an appropriate error when an existing but non-running XApp is deleted
22      @{d} =               Get Deployed XApps
23      @{a} =               Get Deployable XApps
24      Should Not Be Empty  ${a}       No XApps available to deploy
25      @{dNames} =          Pluck      Name     ${d}
26      @{a} =               Subtract From List  ${a}  ${dNames}
27      ${xapp} =            Evaluate            random.choice(${a})  random
28      ${status}  ${u} =    Run Keyword And Ignore Error  Undeploy XApp  ${xapp}
29      Should Be Equal As Strings               ${status}            FAIL
30
31 Request Nonexistent XApp And Expect Error
32      [Documentation]    Ensure AppMgr produces an appropriate error when retrieving a nonexistent XApp
33      ${xapp} =          Generate UUID
34      ${status}  ${u} =  Run Keyword And Ignore Error  Get XApp By Name {$xapp}
35      Should Be Equal As Strings  ${status}   FAIL