Issue-ID: RIC-149
[it/test.git] / ric_robot_suite / helm / nanobot / configmap-src / public / resources / 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          /robot/resources/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}  ${u} =    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      Should Not Be Empty  ${a}                No undeployed XApps
28      ${xapp} =            Evaluate            random.choice(${a})  random
29      ${status}  ${u} =    Run Keyword And Ignore Error  Undeploy XApp  ${xapp}
30      Should Be Equal As Strings               ${status}            FAIL
31
32 Request Nonexistent XApp And Expect Error
33      [Documentation]    Ensure AppMgr produces an appropriate error when retrieving a nonexistent XApp
34      ${xapp} =          Generate UUID
35      ${status}  ${u} =  Run Keyword And Ignore Error  Get XApp By Name {$xapp}
36      Should Be Equal As Strings  ${status}   FAIL
37
38