| yadavmr | 58af6b1 | 2019-09-18 15:33:25 +0530 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | ## |
| 4 | # Copyright 2019 Tech Mahindra Limited |
| 5 | # |
| 6 | # All Rights Reserved. |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. You may obtain |
| 10 | # a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 17 | # License for the specific language governing permissions and limitations |
| 18 | # under the License. |
| 19 | ## |
| 20 | |
| 21 | ## Change log: |
| 22 | # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 |
| 23 | ## |
| 24 | |
| 25 | *** Variables *** |
| 26 | ${success_return_code} 0 |
| 27 | ${delete_max_wait_time} 1min |
| 28 | ${delete_pol_time} 15sec |
| 29 | |
| 30 | |
| 31 | *** Keywords *** |
| 32 | Get VNFDs List |
| 33 | [Documentation] Get vnfds list |
| 34 | |
| 35 | ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list |
| 36 | log ${stdout} |
| 37 | log ${rc} |
| 38 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 39 | |
| 40 | |
| 41 | Create VNFD |
| 42 | [Documentation] Create vnfd at osm |
| 43 | [Arguments] ${vnfd_pkg} |
| 44 | |
| 45 | ${rc} ${stdout}= Run and Return RC and Output osm vnfd-create ${vnfd_pkg} |
| 46 | log ${stdout} |
| 47 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 48 | [Return] ${stdout} |
| 49 | |
| 50 | |
| 51 | Delete VNFD |
| 52 | [Documentation] Delete vnfd |
| 53 | [Arguments] ${vnfd_id} |
| 54 | |
| 55 | ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id} |
| 56 | log ${stdout} |
| 57 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 58 | WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} |
| 59 | |
| 60 | |
| 61 | Check For VNFD |
| 62 | [Arguments] ${vnfd_id} |
| 63 | |
| 64 | ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list |
| 65 | log ${stdout} |
| 66 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 67 | Should Not Contain ${stdout} ${vnfd_id} |
| 68 | |
| 69 | |
| 70 | Force Delete VNFD |
| 71 | [Documentation] Forcely Delete vnfd |
| 72 | [Arguments] ${vnfd_id} |
| 73 | |
| 74 | ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id} |
| 75 | log ${stdout} |
| 76 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 77 | |
| 78 | |
| 79 | Build VNF Descriptor |
| 80 | [Documentation] Build VNF Descriptor from the descriptor-packages |
| 81 | [Arguments] ${vnfd path} |
| 82 | |
| 83 | ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${vnfd path}' |
| 84 | log ${stdout} |
| 85 | Should Be Equal As Integers ${rc} ${success_return_code} |