Skip to content

Commit c94c7f3

Browse files
Merge pull request #45 from IBM/prov-fix
test: fixed the connect test cases for directlink and updated the secrets baseline for directlink
2 parents 40e51aa + 14b1b30 commit c94c7f3

File tree

2 files changed

+87
-34
lines changed

2 files changed

+87
-34
lines changed

.secrets.baseline

Lines changed: 66 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2021-03-09T20:23:57Z",
6+
"generated_at": "2021-10-13T19:20:12Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -25,6 +25,7 @@
2525
"name": "CloudantDetector"
2626
},
2727
{
28+
"ghe_instance": "github.ibm.com",
2829
"name": "GheDetector"
2930
},
3031
{
@@ -69,7 +70,7 @@
6970
"hashed_secret": "6bc64a0a61d9b2e65803729327d1f82e9f96ea58",
7071
"is_secret": false,
7172
"is_verified": false,
72-
"line_number": 177,
73+
"line_number": 178,
7374
"type": "Hex High Entropy String",
7475
"verified_result": null
7576
}
@@ -79,15 +80,15 @@
7980
"hashed_secret": "9a49206d9befa62415e39b8246e09071b9dc81b3",
8081
"is_secret": false,
8182
"is_verified": false,
82-
"line_number": 131,
83+
"line_number": 132,
8384
"type": "Hex High Entropy String",
8485
"verified_result": null
8586
},
8687
{
8788
"hashed_secret": "6bc64a0a61d9b2e65803729327d1f82e9f96ea58",
8889
"is_secret": false,
8990
"is_verified": false,
90-
"line_number": 132,
91+
"line_number": 133,
9192
"type": "Hex High Entropy String",
9293
"verified_result": null
9394
}
@@ -97,7 +98,7 @@
9798
"hashed_secret": "1c785edec135c83b186cde8149c9883532f6f1d1",
9899
"is_secret": false,
99100
"is_verified": false,
100-
"line_number": 200,
101+
"line_number": 201,
101102
"type": "Hex High Entropy String",
102103
"verified_result": null
103104
}
@@ -107,7 +108,7 @@
107108
"hashed_secret": "9fb6a20c3e23ac01a480765a3e4246e05c6769d2",
108109
"is_secret": false,
109110
"is_verified": false,
110-
"line_number": 102,
111+
"line_number": 104,
111112
"type": "Hex High Entropy String",
112113
"verified_result": null
113114
}
@@ -117,7 +118,7 @@
117118
"hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c",
118119
"is_secret": false,
119120
"is_verified": false,
120-
"line_number": 104,
121+
"line_number": 105,
121122
"type": "Hex High Entropy String",
122123
"verified_result": null
123124
}
@@ -134,26 +135,26 @@
134135
],
135136
"test/unit/test_direct_link_provider_v2.py": [
136137
{
137-
"hashed_secret": "8cff7739d641fa350594fe96091ff06c8b66fa30",
138+
"hashed_secret": "c690fcc1554f0eb5b865d7f09c9ceda156df2a80",
138139
"is_secret": false,
139140
"is_verified": false,
140-
"line_number": 717,
141+
"line_number": 729,
141142
"type": "Hex High Entropy String",
142143
"verified_result": null
143144
},
144145
{
145146
"hashed_secret": "c2ea1b20b8c055f4640059ebef5046491c20f00e",
146147
"is_secret": false,
147148
"is_verified": false,
148-
"line_number": 799,
149+
"line_number": 811,
149150
"type": "Hex High Entropy String",
150151
"verified_result": null
151152
},
152153
{
153154
"hashed_secret": "4c154143659305d3cea695447bc2947935d294d0",
154155
"is_secret": false,
155156
"is_verified": false,
156-
"line_number": 1000,
157+
"line_number": 1012,
157158
"type": "Hex High Entropy String",
158159
"verified_result": null
159160
}
@@ -163,23 +164,23 @@
163164
"hashed_secret": "94851979e1cb78bbd9e48a9e2a01f7485e2dbf37",
164165
"is_secret": false,
165166
"is_verified": false,
166-
"line_number": 2286,
167+
"line_number": 3567,
167168
"type": "Hex High Entropy String",
168169
"verified_result": null
169170
},
170171
{
171172
"hashed_secret": "4c154143659305d3cea695447bc2947935d294d0",
172173
"is_secret": false,
173174
"is_verified": false,
174-
"line_number": 2623,
175+
"line_number": 3907,
175176
"type": "Hex High Entropy String",
176177
"verified_result": null
177178
},
178179
{
179180
"hashed_secret": "d67a00cdeec75b04602db35a89c15bb6ee53c877",
180181
"is_secret": false,
181182
"is_verified": false,
182-
"line_number": 2858,
183+
"line_number": 4422,
183184
"type": "Hex High Entropy String",
184185
"verified_result": null
185186
}
@@ -202,6 +203,29 @@
202203
"verified_result": null
203204
}
204205
],
206+
"test/unit/test_filters_v1.py": [
207+
{
208+
"hashed_secret": "5dde7ada70036e084f259d9d571d63a8123f74be",
209+
"is_verified": false,
210+
"line_number": 893,
211+
"type": "Hex High Entropy String",
212+
"verified_result": null
213+
},
214+
{
215+
"hashed_secret": "d734568d91468a08d988dc4b2f09ae9c120d0368",
216+
"is_verified": false,
217+
"line_number": 1036,
218+
"type": "Hex High Entropy String",
219+
"verified_result": null
220+
},
221+
{
222+
"hashed_secret": "66d6a25c558abd33ace6420a8710e1c00e2d8a0e",
223+
"is_verified": false,
224+
"line_number": 1111,
225+
"type": "Hex High Entropy String",
226+
"verified_result": null
227+
}
228+
],
205229
"test/unit/test_firewall_access_rules_v1.py": [
206230
{
207231
"hashed_secret": "fbf087ed5f01eee2bc96b8b32fa2e439ac34c5bd",
@@ -220,6 +244,29 @@
220244
"verified_result": null
221245
}
222246
],
247+
"test/unit/test_firewall_rules_v1.py": [
248+
{
249+
"hashed_secret": "0e0185981368730440e3e7e1c2d4aac4318c8808",
250+
"is_verified": false,
251+
"line_number": 1064,
252+
"type": "Hex High Entropy String",
253+
"verified_result": null
254+
},
255+
{
256+
"hashed_secret": "66d6a25c558abd33ace6420a8710e1c00e2d8a0e",
257+
"is_verified": false,
258+
"line_number": 1278,
259+
"type": "Hex High Entropy String",
260+
"verified_result": null
261+
},
262+
{
263+
"hashed_secret": "eaf07e046263e59dad24af9b4f5df034aa0bc10c",
264+
"is_verified": false,
265+
"line_number": 1284,
266+
"type": "Hex High Entropy String",
267+
"verified_result": null
268+
}
269+
],
223270
"test/unit/test_global_load_balancer_events_v1.py": [
224271
{
225272
"hashed_secret": "fbf087ed5f01eee2bc96b8b32fa2e439ac34c5bd",
@@ -353,15 +400,15 @@
353400
"hashed_secret": "d67a00cdeec75b04602db35a89c15bb6ee53c877",
354401
"is_secret": false,
355402
"is_verified": false,
356-
"line_number": 1253,
403+
"line_number": 1632,
357404
"type": "Hex High Entropy String",
358405
"verified_result": null
359406
},
360407
{
361408
"hashed_secret": "eb74ff42e2e8dfbaf3e4f64a02cdadc8bedda8c3",
362409
"is_secret": false,
363410
"is_verified": false,
364-
"line_number": 1343,
411+
"line_number": 1815,
365412
"type": "Hex High Entropy String",
366413
"verified_result": null
367414
}
@@ -497,15 +544,15 @@
497544
"hashed_secret": "ef721aec71abce87f596e22daa5e80b2785f1b85",
498545
"is_secret": false,
499546
"is_verified": false,
500-
"line_number": 6775,
547+
"line_number": 7014,
501548
"type": "Hex High Entropy String",
502549
"verified_result": null
503550
},
504551
{
505552
"hashed_secret": "e8149f1568ca067368f5fd5fab60e8db3662b78e",
506553
"is_secret": false,
507554
"is_verified": false,
508-
"line_number": 6778,
555+
"line_number": 7017,
509556
"type": "Base64 High Entropy String",
510557
"verified_result": null
511558
}
@@ -521,7 +568,7 @@
521568
}
522569
]
523570
},
524-
"version": "0.13.1+ibm.31.dss",
571+
"version": "0.13.1+ibm.46.dss",
525572
"word_list": {
526573
"file": null,
527574
"hash": null

test/integration/test_direct_link_v1.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ def delete_connection(self, gateway_id, conn_id):
145145
time.sleep(10)
146146
count += 1
147147

148+
def get_port_id(self):
149+
# Fetch the list of ports and use a port to create a connect gateway
150+
response = self.dl.list_ports()
151+
assert response is not None
152+
153+
ports = response.get_result().get("ports")
154+
port_id = ""
155+
provider_to_be_used = "DL2-TEST"
156+
for port in ports:
157+
if provider_to_be_used in port.get("provider_name"):
158+
port_id = port.get("id")
159+
break
160+
161+
return port_id
162+
148163
################## DirectLink Gateways ######################################
149164

150165
def test_gateway_crud_actions(self):
@@ -515,11 +530,8 @@ def test_connect_gateway_with_connection_mode(self):
515530
connectionMode = "direct"
516531

517532
""" test create/update/delete gateway with connection_mode success """
518-
# FEtch the list of ports and use a port to create a connect gateway
519-
response = self.dl.list_ports()
520-
assert response is not None
521-
522-
port_id = response.get_result().get("ports")[0].get("id")
533+
# Get the port id to create a connect gateway
534+
port_id = self.get_port_id()
523535

524536
# create gateway with connection_mode as transit
525537
gwPort = GatewayPortIdentity(id= port_id)
@@ -639,11 +651,8 @@ def test_connect_gateway_with_bgp_ip_update(self):
639651
gatewayType = "connect"
640652

641653
""" test create/update/delete gateway with bgp_asn bgp_cer_cidr bgp_ibm_cidr success """
642-
# Fetch the list of ports and use a port to create a connect gateway
643-
response = self.dl.list_ports()
644-
assert response is not None
645-
646-
port_id = response.get_result().get("ports")[0].get("id")
654+
# Get the port id to create a connect gateway
655+
port_id = self.get_port_id()
647656

648657
# create a connect gateway
649658
gwPort = GatewayPortIdentity(id= port_id)
@@ -787,11 +796,8 @@ def test_connect_gateway_with_bfd_config(self):
787796
gatewayType = "connect"
788797

789798
""" test create/update/delete gateway with bfd_config """
790-
# Fetch the list of ports and use a port to create a connect gateway
791-
response = self.dl.list_ports()
792-
assert response is not None
793-
794-
port_id = response.get_result().get("ports")[0].get("id")
799+
# Get the port id to create a connect gateway
800+
port_id = self.get_port_id()
795801

796802
# create a connect gateway
797803
gwPort = GatewayPortIdentity(id= port_id)

0 commit comments

Comments
 (0)