1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
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
12 # http://www.apache.org/licenses/LICENSE-2.0
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
22 # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
26 ${success_return_code} 0
27 ${delete_max_wait_time} 1min
28 ${delete_pol_time} 15sec
33 [Documentation] Get nsds list
35 ${rc} ${stdout}= Run and Return RC and Output osm nsd-list
37 Should Be Equal As Integers ${rc} ${success_return_code}
41 [Documentation] Create nsd at osm
42 [Arguments] ${nsd_pkg}
44 ${rc} ${stdout}= Run and Return RC and Output osm nsd-create ${nsd_pkg}
46 Should Be Equal As Integers ${rc} ${success_return_code}
51 [Documentation] Delete nsd
54 # For timebeing exception thrown by nsd-delete api was ignor because nsd was deleted successfully. The cause of exception is need to debug further
55 ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nsd-delete ${nsd_id}
57 # Should Be Equal As Integers ${rc} ${success_return_code}
58 WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSD ${nsd_id}
64 ${rc} ${stdout}= Run and Return RC and Output osm nsd-list
66 Should Be Equal As Integers ${rc} ${success_return_code}
67 Should Not Contain ${stdout} ${nsd_id}
71 [Documentation] Forcely Delete nsd
74 ${rc} ${stdout}= Run and Return RC and Output osm nsd-delete ${nsd_id}
76 Should Be Equal As Integers ${rc} ${success_return_code}
80 [Documentation] Build NS Descriptor from the descriptor-packages
81 [Arguments] ${nsd path}
83 ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${nsd path}'
85 Should Be Equal As Integers ${rc} ${success_return_code}