X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fvnfd_lib.robot;h=f1cc95ea3a4d9d9666ac80a13d0c18afd981fda2;hb=f25782945b1e3db0a2442c572a5f8607bb42460e;hp=fc844365b8a5439cda3fa19575e22f02b0087438;hpb=9dca3a87c3fdce0babbe6945f73c28dc75f40ae3;p=osm%2Ftests.git diff --git a/robot-systest/lib/vnfd_lib.robot b/robot-systest/lib/vnfd_lib.robot index fc84436..f1cc95e 100644 --- a/robot-systest/lib/vnfd_lib.robot +++ b/robot-systest/lib/vnfd_lib.robot @@ -28,6 +28,7 @@ Library String *** Variables *** ${success_return_code} 0 +${failure_return_code} 1 ${delete_max_wait_time} 1min ${delete_pol_time} 15sec @@ -82,7 +83,7 @@ Create VNFD Overriding Fields ... - `--override-nonepa`: removes all EPA attributes from all VDUs. ... - `--override-paravirt`: converts all interfaces to `PARAVIRT`. This one can be combined with ... the others above (e.g. '--override-nonepa --override-paravirt'). - ... - Relevant environment variables: + ... - Relevant environment variables: ... - OVERRIDES: If the environment variable "OVERRIDES" exists, it prevails over the value in the argument. ... This is often more convenient to enforce the same behaviour for every test run in a given VIM. @@ -110,8 +111,21 @@ Delete VNFD WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} -Check For VNFD +Assert Failure Delete VNFD + [Documentation] Deletes a NF Package that cannot be deleted and asserts the failure [Arguments] ${vnfd_id} + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-delete ${vnfd_id} + log ${stdout} + Should Be Equal As Integers ${rc} ${failure_return_code} + Should Contain ${stdout} 409 msg=Expected Conflict values=False + WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} True + + +Check For VNFD + [Arguments] ${vnfd_id} ${exists}=False + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list | awk '{print $2}' | grep ${vnfd_id} - Should Not Be Equal As Strings ${stdout} ${vnfd_id} + Run Keyword If ${exists} Should Be Equal As Strings ${stdout} ${vnfd_id} + ... ELSE Should Not Be Equal As Strings ${stdout} ${vnfd_id} +