Remove regression tag from disabled daily tests
[osm/tests.git] / robot-systest / deprecated / testsuite / cli / TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot
1 # -*- coding: utf-8 -*-
2
3 ##
4 # Copyright 2020 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 # Author: Mrityunjay Yadav <MY00514913@techmahindra.com>, Jayant Madavi
21 ##
22
23
24 *** Settings ***
25 Documentation    Test Suite to test disable network port security NS
26 Library     OperatingSystem
27 Library     String
28 Library     Collections
29 Resource    ../../lib/cli/vnfd_lib.robot
30 Resource    ../../lib/cli/nsd_lib.robot
31 Resource    ../../lib/cli/ns_lib.robot
32 Resource    ../../lib/cli/vim_account_lib.robot
33 Library     ../../lib/custom_lib.py
34 Variables   ../../resource/cli/disable_port_security_ns_data.py
35
36 Suite Teardown     Run Keyword And Ignore Error    Test Cleanup
37
38
39 *** Variables ***
40 @{vnfd_ids}
41 ${nsd_id}
42 @{nsd_ids}
43 @{ns_ids}
44
45
46 *** Test Cases ***
47 Create VNF Descriptor
48     [Tags]   disable_port_security    comprehensive
49
50     Build VNF Descriptor    ${vnfdPckgPath}
51     ${vnfd_id}=    Create VNFD    '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
52     Append To List     ${vnfd_ids}       ${vnfd_id}
53
54
55 Create NS Descriptor
56     [Tags]   disable_port_security    comprehensive
57
58     Build NS Descriptor    ${nsdPckgPath}
59     ${nsd_id}=    Create NSD    '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
60     Append To List     ${nsd_ids}       ${nsd_id}
61
62
63 Network Service Instance Test
64     [Documentation]  Launch and terminate network services
65     [Tags]   disable_port_security    comprehensive
66
67     :FOR    ${vim_name}    IN    @{vim}
68     \    Launch Network Services and Return    ${vim_name}
69
70
71 Verify Port Security
72     [Tags]   disable_port_security    comprehensive
73
74     :FOR    ${ns}  IN   @{ns_ids}
75     \   Check For Network Port Security   ${ns}
76
77
78 Delete NS Instance Test
79     [Tags]    disable_port_security   comprehensive
80
81     :FOR    ${ns}  IN   @{ns_ids}
82     \   Delete NS   ${ns}
83
84
85 Delete NS Descriptor Test
86     [Tags]   disable_port_security    comprehensive
87
88     :FOR    ${nsd}  IN   @{nsd_ids}
89     \   Delete NSD      ${nsd}
90
91
92 Delete VNF Descriptor Test
93     [Tags]   disable_port_security    comprehensive
94
95     :FOR    ${vnfd_id}  IN   @{vnfd_ids}
96     \   Delete VNFD     ${vnfd_id}
97
98
99 *** Keywords ***
100 Check For Network Port Security
101     [Arguments]    ${ns_name}
102     ${rc}   ${network_id}=      Run and Return RC and Output    openstack network list | grep ${ns_name} | awk '{print $2}'
103     Log    ${network_id}
104     ${rc}   ${stdout}=      Run and Return RC and Output    openstack network show ${network_id} -f json | jq '.port_security_enabled'
105     Log    ${stdout}
106     Should Be Equal As Strings    ${stdout}    true
107
108
109 Test Cleanup
110     [Documentation]  Test Suit Cleanup: Deliting Descriptor, instance and vim
111
112     :FOR    ${ns}  IN   @{ns_ids}
113     \   Delete NS   ${ns}
114
115     :FOR    ${nsd}  IN   @{nsd_ids}
116     \   Delete NSD      ${nsd}
117
118     :FOR    ${vnfd}  IN   @{vnfd_ids}
119     \   Delete VNFD     ${vnfd}
120
121 #    :FOR    ${vim_id}  IN   @{vim}
122 #    \   Delete Vim Account    ${vim_id}