1 | /* |
---|
2 | * @author STF 370 |
---|
3 | * @version $Id $ |
---|
4 | * @desc This module contains functions which implement the |
---|
5 | * configuration of the SUT adapter and mapping of test |
---|
6 | * components for establishing and tearing down different |
---|
7 | * test configurations. |
---|
8 | */ |
---|
9 | |
---|
10 | module AtsImsIot_TestConfiguration { |
---|
11 | |
---|
12 | import from LibIot_PIXITS {modulepar PX_EUT_A, PX_EUT_B, PX_PRODUCTS;}
|
---|
13 |
|
---|
14 | import from LibIot_Functions {
|
---|
15 | function f_setConformanceVerdict, f_setE2EVerdict;
|
---|
16 | }
|
---|
17 |
|
---|
18 | import from AtsImsIot_Templates {template m_SetFilterReq, mw_SetFilterRsp;}
|
---|
19 |
|
---|
20 | import from LibCommon_VerdictControl {type FncRetCode;}
|
---|
21 |
|
---|
22 | import from LibIot_TypesAndValues {
|
---|
23 | type
|
---|
24 | InterfaceInfo,
|
---|
25 | InterfaceInfoList,
|
---|
26 | Product,
|
---|
27 | ProtocolFilter,
|
---|
28 | SetFilterReq,
|
---|
29 | SetFilterRsp,
|
---|
30 | Status;
|
---|
31 | }
|
---|
32 |
|
---|
33 | import from LibIot_TestConfiguration {
|
---|
34 | function f_cf_oracle_up, f_cf_oracle_down;
|
---|
35 | }
|
---|
36 |
|
---|
37 | import from AtsImsIot_TestSystem {
|
---|
38 | type ImsInterfaceMonitor, ImsTestCoordinator;
|
---|
39 | }
|
---|
40 |
|
---|
41 | import from LibIot_TestInterface {type IotEquipmentUser;} |
---|
42 | |
---|
43 | |
---|
44 | group constantDefinitions { |
---|
45 | //* interface monitor name Gm A |
---|
46 | const charstring c_gm_A := "Gm A"; |
---|
47 | //* interface monitor name Gm B |
---|
48 | const charstring c_gm_B := "Gm B"; |
---|
49 | //* interface monitor name Mw |
---|
50 | const charstring c_mw := "Mw"; |
---|
51 | //* interface monitor name Isc A |
---|
52 | const charstring c_isc_A := "Isc A"; |
---|
53 | //* interface monitor name Isc B |
---|
54 | const charstring c_isc_B := "Isc B"; |
---|
55 | //* eut trigger name User A |
---|
56 | const charstring c_trigger_A := "User A"; |
---|
57 | //* eut trigger name User B |
---|
58 | const charstring c_trigger_B := "User B"; |
---|
59 | //* eut trigger name User A |
---|
60 | const charstring c_userUE_A := "User A"; |
---|
61 | //* eut trigger name User B |
---|
62 | const charstring c_userUE_B := "User B"; |
---|
63 | const charstring c_userUE_B2 := "User B2"; |
---|
64 | } |
---|
65 | |
---|
66 | group mappingFunctions { |
---|
67 | |
---|
68 | /** |
---|
69 | * |
---|
70 | * @desc initialize the adapter port of MTC |
---|
71 | */ |
---|
72 | function f_cf_adapter_up() runs on ImsTestCoordinator { |
---|
73 | map(self:acPort, system:acPort); |
---|
74 | } |
---|
75 | |
---|
76 | /** |
---|
77 | * |
---|
78 | * @desc uninitialize the adapter port of MTC |
---|
79 | */ |
---|
80 | function f_cf_adapter_down() runs on ImsTestCoordinator { |
---|
81 | unmap(self:acPort, system:acPort); |
---|
82 | } |
---|
83 | |
---|
84 | /** |
---|
85 | * |
---|
86 | * @desc initialize trigger component ports |
---|
87 | * @param p_driver trigger component |
---|
88 | */ |
---|
89 | function f_cf_user_up(in IotEquipmentUser p_driver) runs on ImsTestCoordinator { |
---|
90 | // connect sync ports |
---|
91 | connect(p_driver:syncPort, self:syncPort); |
---|
92 | // connect TSI ports |
---|
93 | map(p_driver:eaPort, system:eaPort); |
---|
94 | // configure oracle |
---|
95 | f_cf_oracle_up(p_driver); |
---|
96 | } |
---|
97 | |
---|
98 | /** |
---|
99 | * |
---|
100 | * @desc uninitialize trigger component ports |
---|
101 | * @param p_driver trigger component |
---|
102 | */ |
---|
103 | function f_cf_user_down(in IotEquipmentUser p_driver) runs on ImsTestCoordinator { |
---|
104 | // disconnect sync ports |
---|
105 | disconnect(p_driver:syncPort, self:syncPort); |
---|
106 | // disconnect TSI ports |
---|
107 | unmap(p_driver:eaPort, system:eaPort); |
---|
108 | // release oracle ports |
---|
109 | f_cf_oracle_down(p_driver); |
---|
110 | } |
---|
111 | |
---|
112 | /** |
---|
113 | * @desc configures monitor component: connects to the synchronnization |
---|
114 | * port, maps to the TSI port and connects to the oracle |
---|
115 | * @param p_monitor monitor component |
---|
116 | */ |
---|
117 | function f_cf_monitor_up(in ImsInterfaceMonitor p_monitor) runs on ImsTestCoordinator { |
---|
118 | // connect sync ports |
---|
119 | connect(p_monitor:syncPort, self:syncPort); |
---|
120 | connect(p_monitor:icpPort, self:icpPort); |
---|
121 | // mapp TSI port |
---|
122 | map(p_monitor:dPort, system:dPort); |
---|
123 | map(p_monitor:acPort, system:acPort); |
---|
124 | // configure oracle |
---|
125 | f_cf_oracle_up(p_monitor); |
---|
126 | } |
---|
127 | |
---|
128 | /** |
---|
129 | * @desc frees monitor component: disconnects the synchronnization |
---|
130 | * port, unmaps from the TSI port and disconnects from the oracle |
---|
131 | * @param p_monitor monitor component |
---|
132 | */ |
---|
133 | function f_cf_monitor_down(in ImsInterfaceMonitor p_monitor) runs on ImsTestCoordinator { |
---|
134 | // connect sync ports |
---|
135 | disconnect(p_monitor:syncPort, self:syncPort); |
---|
136 | disconnect(p_monitor:icpPort, self:icpPort); |
---|
137 | // mapp TSI port |
---|
138 | unmap(p_monitor:dPort, system:dPort); |
---|
139 | unmap(p_monitor:acPort, system:acPort); |
---|
140 | // configure oracle |
---|
141 | f_cf_oracle_down(p_monitor); |
---|
142 | } |
---|
143 | |
---|
144 | } |
---|
145 | |
---|
146 | group adapterConfiguration { |
---|
147 | |
---|
148 | function f_cf_setFilter(in SetFilterReq p_req) runs on ImsInterfaceMonitor { |
---|
149 | var SetFilterRsp v_rsp; |
---|
150 | var template Status v_status := { |
---|
151 | code := e_success, |
---|
152 | reason := * |
---|
153 | } |
---|
154 | |
---|
155 | tc_wait.start; |
---|
156 | acPort.send(p_req); |
---|
157 | alt { |
---|
158 | [] acPort.receive (mw_SetFilterRsp(v_status)) -> value v_rsp { |
---|
159 | tc_wait.stop; |
---|
160 | f_setE2EVerdict(pass, "Adapter Configuration: setting monitor filter successful"); |
---|
161 | f_setConformanceVerdict(pass, "Adapter Configuration: setting monitor filter successful"); |
---|
162 | } |
---|
163 | [] acPort.receive (mw_SetFilterRsp(?)) -> value v_rsp { |
---|
164 | tc_wait.stop; |
---|
165 | f_setE2EVerdict(inconc, "Adapter Configuration: error while setting monitor filter"); |
---|
166 | f_setConformanceVerdict(inconc, "Adapter Configuration: error while setting monitor filter"); |
---|
167 | } |
---|
168 | [] tc_wait.timeout { |
---|
169 | f_setE2EVerdict(inconc, "Adapter Configuration: timer expires while waiting for response"); |
---|
170 | f_setConformanceVerdict(inconc, "Adapter Configuration: timer expires while waiting for response"); |
---|
171 | } |
---|
172 | } |
---|
173 | } |
---|
174 | |
---|
175 | |
---|
176 | } |
---|
177 | |
---|
178 | group componentCreation { |
---|
179 | |
---|
180 | /** |
---|
181 | * @desc creates a monitor component |
---|
182 | * @param p_name name of the monitor component |
---|
183 | * @return the created monitor component |
---|
184 | */ |
---|
185 | function f_cf_create_monitor(in charstring p_name) runs on ImsTestCoordinator return ImsInterfaceMonitor { |
---|
186 | var ImsInterfaceMonitor v_monitor := ImsInterfaceMonitor.create(p_name) alive; |
---|
187 | |
---|
188 | return v_monitor; |
---|
189 | } |
---|
190 | } |
---|
191 | |
---|
192 | |
---|
193 | group testConfiguration { |
---|
194 | |
---|
195 | /**
|
---|
196 | * @desc
|
---|
197 | * Test configuration function for roaming registration szenario.
|
---|
198 | * More information can be found in ETSI TS 186 011-2 V2.3.1 Cause
|
---|
199 | * 4.3.4.
|
---|
200 | * @param p_Gm Gm interface monitor component
|
---|
201 | * @param p_Mw Mw interface monitor component
|
---|
202 | */ |
---|
203 | function f_cf_roam_reg( |
---|
204 | inout ImsInterfaceMonitor p_Gm, |
---|
205 | inout ImsInterfaceMonitor p_Mw |
---|
206 | ) runs on ImsTestCoordinator { |
---|
207 | p_Gm := f_cf_create_monitor(c_gm_A); |
---|
208 | p_Mw := f_cf_create_monitor(c_mw); |
---|
209 | |
---|
210 | f_cf_monitor_up(p_Gm); |
---|
211 | f_cf_monitor_up(p_Mw); |
---|
212 | |
---|
213 | // TODO UE IP address and port is missing |
---|
214 | p_Gm.start(f_cf_setFilter( |
---|
215 | valueof (m_SetFilterReq( |
---|
216 | e_sip, |
---|
217 | f_getInterfaceInfoList("Gm", PX_EUT_A, PX_EUT_B) |
---|
218 | ) |
---|
219 | ))); |
---|
220 | p_Gm.done; |
---|
221 | |
---|
222 | p_Mw.start(f_cf_setFilter( |
---|
223 | valueof(m_SetFilterReq( |
---|
224 | e_sip, |
---|
225 | f_getInterfaceInfoList("Mw", PX_EUT_A, PX_EUT_B) |
---|
226 | ) |
---|
227 | ))); |
---|
228 | p_Mw.done; |
---|
229 | } |
---|
230 | |
---|
231 | function f_cf_int_call( |
---|
232 | inout ImsInterfaceMonitor p_GmA, |
---|
233 | inout ImsInterfaceMonitor p_Mw, |
---|
234 | inout ImsInterfaceMonitor p_GmB, |
---|
235 | in boolean p_useGmB |
---|
236 | ) runs on ImsTestCoordinator { |
---|
237 | p_GmA := f_cf_create_monitor(c_gm_A); |
---|
238 | p_Mw := f_cf_create_monitor(c_mw); |
---|
239 | if(p_useGmB) { |
---|
240 | p_GmB := f_cf_create_monitor(c_gm_B); |
---|
241 | f_cf_monitor_up(valueof(p_GmB)); |
---|
242 | } |
---|
243 | |
---|
244 | f_cf_monitor_up(p_GmA); |
---|
245 | f_cf_monitor_up(p_Mw); |
---|
246 | |
---|
247 | |
---|
248 | // TODO UE IP address and port is missing |
---|
249 | p_GmA.start(f_cf_setFilter( |
---|
250 | valueof (m_SetFilterReq( |
---|
251 | e_sip, |
---|
252 | {f_getInterfaceInfo("Gm", PX_PRODUCTS[PX_EUT_A])} |
---|
253 | ) |
---|
254 | ))); |
---|
255 | p_GmA.done; |
---|
256 | |
---|
257 | p_Mw.start(f_cf_setFilter( |
---|
258 | valueof(m_SetFilterReq( |
---|
259 | e_sip, |
---|
260 | f_getInterfaceInfoList("Mw", PX_EUT_A, PX_EUT_B) |
---|
261 | ) |
---|
262 | ))); |
---|
263 | p_Mw.done; |
---|
264 | |
---|
265 | if(p_useGmB) { |
---|
266 | p_GmB.start(f_cf_setFilter( |
---|
267 | valueof (m_SetFilterReq( |
---|
268 | e_sip, |
---|
269 | {f_getInterfaceInfo("Gm", PX_PRODUCTS[PX_EUT_B])} |
---|
270 | ) |
---|
271 | ))); |
---|
272 | p_GmB.done; |
---|
273 | } |
---|
274 | } |
---|
275 | } |
---|
276 | |
---|
277 | function f_getInterfaceInfoList( |
---|
278 | in charstring p_interfaceName, |
---|
279 | in integer p_product1, |
---|
280 | in integer p_product2 |
---|
281 | ) return InterfaceInfoList { |
---|
282 | var InterfaceInfoList v_list := { |
---|
283 | f_getInterfaceInfo(p_interfaceName, PX_PRODUCTS[p_product1]), |
---|
284 | f_getInterfaceInfo(p_interfaceName, PX_PRODUCTS[p_product2]) |
---|
285 | }; |
---|
286 | |
---|
287 | return v_list; |
---|
288 | } |
---|
289 | |
---|
290 | function f_getInterfaceInfo(in charstring p_interfaceName, Product p_product) return InterfaceInfo { |
---|
291 | var InterfaceInfo v_info := { |
---|
292 | IpInterfaceInfo := { |
---|
293 | { |
---|
294 | domainName := "invalid", |
---|
295 | IpAddress := "0.0.0.0", |
---|
296 | portNumbers := {0} |
---|
297 | } |
---|
298 | } |
---|
299 | }; |
---|
300 | |
---|
301 | for(var integer i := 0; i <= lengthof(p_product.monitorInterfaces); i := i + 1) { |
---|
302 | if(p_product.monitorInterfaces[i].interfaceName == p_interfaceName) { |
---|
303 | return p_product.monitorInterfaces[i].interfaceInfo; |
---|
304 | } |
---|
305 | } |
---|
306 | |
---|
307 | return v_info; |
---|
308 | } |
---|
309 | |
---|
310 | |
---|
311 | |
---|
312 | |
---|
313 | } |
---|