VSP Compliance Check for Compute Flavor
[sdc.git] / openecomp-ui / test-utils / factories / softwareProduct / SoftwareProductValidationFactory.js
1 /**
2  * Copyright (c) 2019 Vodafone Group
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 import { Factory } from 'rosie';
17
18 export const VSPComplianceCheckedFactory = new Factory().attrs({
19     complianceChecked: [
20         'compliance.compliancetests.sriov',
21         'compliance.compliancetests.computeflavors'
22     ]
23 });
24
25 export const VSPCertificationCheckedFactory = new Factory().attrs({
26     certificationChecked: ['certification.certificationtests.certquery']
27 });
28
29 export const VSPGeneralInfoFactory = new Factory().attrs({
30     generalInfo: {
31         'certification.certificationtests.certquery': {
32             vspId: {
33                 isValid: false,
34                 errorText: 'Please Enter a Value in the Mandatory Field'
35             },
36             vspVersion: {
37                 isValid: false,
38                 errorText: 'Please Enter a Value in the Mandatory Field'
39             }
40         },
41         'compliance.compliancetests.sriov': {
42             vspId: {
43                 isValid: false,
44                 errorText: 'Please Enter a Value in the Mandatory Field'
45             },
46             vspVersion: {
47                 isValid: false,
48                 errorText: 'Please Enter a Value in the Mandatory Field'
49             },
50             allowSriov: {
51                 isValid: true,
52                 errorText: ''
53             }
54         },
55         'compliance.compliancetests.computeflavors': {
56             vspId: {
57                 isValid: false,
58                 errorText: 'Please Enter a Value in the Mandatory Field'
59             },
60             vspVersion: {
61                 isValid: false,
62                 errorText: 'Please Enter a Value in the Mandatory Field'
63             },
64             csp: {
65                 isValid: true,
66                 errorText: ''
67             },
68             profilespec: {
69                 isValid: true,
70                 errorText: ''
71             },
72             vnftype: {
73                 isValid: true,
74                 errorText: ''
75             }
76         }
77     }
78 });
79
80 export const VSPTestsRequestFactory = new Factory().attrs({
81     testsRequest: {
82         'compliance.compliancetests.sriov': {
83             parameters: {
84                 vspId: '',
85                 vspVersion: '',
86                 allowSriov: 'false'
87             },
88             scenario: 'compliance',
89             testCaseName: 'compliance.compliancetests.sriov',
90             testSuiteName: 'compliancetests',
91             endpoint: 'vtp'
92         },
93         'compliance.compliancetests.computeflavors': {
94             parameters: {
95                 vspId: '',
96                 vspVersion: '',
97                 csp: 'ZZFT',
98                 profilespec: 'gsmafnw14',
99                 vnftype: 'B'
100             },
101             scenario: 'compliance',
102             testCaseName: 'compliance.compliancetests.computeflavors',
103             testSuiteName: 'compliancetests',
104             endpoint: 'ovp'
105         },
106         'certification.certificationtests.certquery': {
107             parameters: {
108                 vspId: '',
109                 vspVersion: ''
110             },
111             scenario: 'certification',
112             testCaseName: 'certification.certificationtests.certquery',
113             testSuiteName: 'certificationtests',
114             endpoint: 'repository'
115         }
116     }
117 });
118
119 export const VSPTestsMapFactory = new Factory().attrs({
120     vspTestsMap: {
121         'compliance.compliancetests.sriov': {
122             title: ' SR-IOV Test',
123             parameters: [
124                 {
125                     name: 'vspId',
126                     description: 'VSP ID',
127                     type: 'text',
128                     isOptional: false,
129                     metadata: {
130                         disabled: false,
131                         maxLength: '36',
132                         minLength: '1'
133                     }
134                 },
135                 {
136                     name: 'vspVersion',
137                     description: 'VSP Version',
138                     type: 'text',
139                     isOptional: false,
140                     metadata: {
141                         disabled: false,
142                         maxLength: '36',
143                         minLength: '1'
144                     }
145                 },
146                 {
147                     name: 'allowSriov',
148                     description: 'Allow  SR-IOV?',
149                     type: 'select',
150                     defaultValue: 'false',
151                     isOptional: false,
152                     metadata: {
153                         disabled: true,
154                         choices: [
155                             {
156                                 key: 'true',
157                                 label: 'Yes'
158                             },
159                             {
160                                 key: 'false',
161                                 label: 'No'
162                             }
163                         ]
164                     }
165                 }
166             ],
167             endpoint: 'vtp',
168             testCaseName: 'compliance.compliancetests.sriov',
169             testSuiteName: 'compliancetests',
170             scenario: 'compliance'
171         },
172         'compliance.compliancetests.computeflavors': {
173             title: 'Compute Flavours Test',
174             parameters: [
175                 {
176                     name: 'vspId',
177                     description: 'VSP ID',
178                     type: 'text',
179                     isOptional: false,
180                     metadata: {
181                         disabled: false,
182                         maxLength: '36',
183                         minLength: '1'
184                     }
185                 },
186                 {
187                     name: 'vspVersion',
188                     description: 'VSP Version',
189                     type: 'text',
190                     isOptional: false,
191                     metadata: {
192                         disabled: false,
193                         maxLength: '36',
194                         minLength: '1'
195                     }
196                 },
197                 {
198                     name: 'csp',
199                     description: 'CSP',
200                     type: 'select',
201                     defaultValue: 'ZZFT',
202                     isOptional: false,
203                     metadata: {
204                         disabled: false,
205                         choices: [
206                             {
207                                 key: 'ZZTF',
208                                 label: 'Vodafone Group'
209                             }
210                         ]
211                     }
212                 },
213                 {
214                     name: 'profilespec',
215                     description: 'Profile Specification',
216                     type: 'select',
217                     defaultValue: 'gsmafnw14',
218                     isOptional: false,
219                     metadata: {
220                         disabled: false,
221                         choices: [
222                             {
223                                 key: 'gsmafnw14',
224                                 label: 'GSMA NFVI Profiles'
225                             }
226                         ]
227                     }
228                 },
229                 {
230                     name: 'vnftype',
231                     description: 'VNF Type',
232                     type: 'select',
233                     defaultValue: 'B',
234                     isOptional: false,
235                     metadata: {
236                         disabled: false,
237                         choices: [
238                             {
239                                 key: 'B',
240                                 label: 'Basic'
241                             },
242                             {
243                                 key: 'N',
244                                 label: 'Network Intensive'
245                             },
246                             {
247                                 key: 'C',
248                                 label: 'Compute Intensive'
249                             }
250                         ]
251                     }
252                 }
253             ],
254             endpoint: 'ovp',
255             testCaseName: 'compliance.compliancetests.computeflavors',
256             testSuiteName: 'compliancetests',
257             scenario: 'compliance'
258         },
259         'certification.certificationtests.certquery': {
260             title: 'Other Certifications',
261             parameters: [
262                 {
263                     name: 'vspId',
264                     description: 'VSP ID',
265                     type: 'text',
266                     defaultValue: '$vspid',
267                     isOptional: true,
268                     metadata: {
269                         maxLength: 36,
270                         minLength: 1,
271                         disabled: true
272                     }
273                 },
274                 {
275                     name: 'vspVersion',
276                     description: 'Previous VSP Version',
277                     type: 'text',
278                     defaultValue: '$vspPreviousVersion',
279                     isOptional: true,
280                     metadata: {
281                         maxLength: 36,
282                         minLength: 1,
283                         disabled: true
284                     }
285                 }
286             ],
287             endpoint: 'repository',
288             testCaseName: 'certification.certificationtests.certquery',
289             testSuiteName: 'certificationtests',
290             scenario: 'certification'
291         }
292     }
293 });
294
295 export const VSPChecksFactory = new Factory().attrs({
296     name: 'root',
297     description: 'root',
298     children: [
299         {
300             name: 'certification',
301             description: 'Available Certifications Query',
302             children: [
303                 {
304                     name: 'certificationtests',
305                     description: 'Additional Certification',
306                     tests: [
307                         {
308                             testCaseName:
309                                 'certification.certificationtests.certquery',
310                             testSuiteName: 'certificationtests',
311                             description: 'Other Certifications',
312                             author: 'jg@example.com',
313                             inputs: [
314                                 {
315                                     name: 'vspId',
316                                     description: 'VSP ID',
317                                     type: 'text',
318                                     defaultValue: '$vspid',
319                                     isOptional: true,
320                                     metadata: {
321                                         maxLength: 36,
322                                         minLength: 1,
323                                         disabled: true
324                                     }
325                                 },
326                                 {
327                                     name: 'vspVersion',
328                                     description: 'Previous VSP Version',
329                                     type: 'text',
330                                     defaultValue: '$vspPreviousVersion',
331                                     isOptional: true,
332                                     metadata: {
333                                         maxLength: 36,
334                                         minLength: 1,
335                                         disabled: true
336                                     }
337                                 }
338                             ],
339                             endpoint: 'repository'
340                         }
341                     ]
342                 }
343             ]
344         },
345         {
346             name: 'compliance',
347             description: 'Available ComplianceChecks',
348             tests: [],
349             children: [
350                 {
351                     name: 'compliancetests',
352                     description: 'Compliance Tests',
353                     tests: [
354                         {
355                             testCaseName: 'compliance.compliancetests.sriov',
356                             testSuiteName: 'compliancetests',
357                             description: ' SR-IOV Test',
358                             author: 'Jim',
359                             inputs: [
360                                 {
361                                     name: 'vspId',
362                                     description: 'VSP ID',
363                                     type: 'text',
364                                     isOptional: false,
365                                     metadata: {
366                                         disabled: false,
367                                         maxLength: '36',
368                                         minLength: '1'
369                                     }
370                                 },
371                                 {
372                                     name: 'vspVersion',
373                                     description: 'VSP Version',
374                                     type: 'text',
375                                     isOptional: false,
376                                     metadata: {
377                                         disabled: false,
378                                         maxLength: '36',
379                                         minLength: '1'
380                                     }
381                                 },
382                                 {
383                                     name: 'allowSriov',
384                                     description: 'Allow  SR-IOV?',
385                                     type: 'select',
386                                     defaultValue: 'false',
387                                     isOptional: false,
388                                     metadata: {
389                                         disabled: true,
390                                         choices: [
391                                             {
392                                                 key: 'true',
393                                                 label: 'Yes'
394                                             },
395                                             {
396                                                 key: 'false',
397                                                 label: 'No'
398                                             }
399                                         ]
400                                     }
401                                 }
402                             ],
403                             endpoint: 'vtp'
404                         },
405                         {
406                             testCaseName:
407                                 'compliance.compliancetests.computeflavors',
408                             testSuiteName: 'compliancetests',
409                             description: 'Compute Flavours Test',
410                             author: 'Jim',
411                             inputs: [
412                                 {
413                                     name: 'vspId',
414                                     description: 'VSP ID',
415                                     type: 'text',
416                                     isOptional: false,
417                                     metadata: {
418                                         disabled: false,
419                                         maxLength: '36',
420                                         minLength: '1'
421                                     }
422                                 },
423                                 {
424                                     name: 'vspVersion',
425                                     description: 'VSP Version',
426                                     type: 'text',
427                                     isOptional: false,
428                                     metadata: {
429                                         disabled: false,
430                                         maxLength: '36',
431                                         minLength: '1'
432                                     }
433                                 },
434                                 {
435                                     name: 'csp',
436                                     description: 'CSP',
437                                     type: 'select',
438                                     defaultValue: 'ZZFT',
439                                     isOptional: false,
440                                     metadata: {
441                                         disabled: false,
442                                         choices: [
443                                             {
444                                                 key: 'ZZTF',
445                                                 label: 'Vodafone Group'
446                                             }
447                                         ]
448                                     }
449                                 },
450                                 {
451                                     name: 'profilespec',
452                                     description: 'Profile Specification',
453                                     type: 'select',
454                                     defaultValue: 'gsmafnw14',
455                                     isOptional: false,
456                                     metadata: {
457                                         disabled: false,
458                                         choices: [
459                                             {
460                                                 key: 'gsmafnw14',
461                                                 label: 'GSMA NFVI Profiles'
462                                             }
463                                         ]
464                                     }
465                                 },
466                                 {
467                                     name: 'vnftype',
468                                     description: 'VNF Type',
469                                     type: 'select',
470                                     defaultValue: 'B',
471                                     isOptional: false,
472                                     metadata: {
473                                         disabled: false,
474                                         choices: [
475                                             {
476                                                 key: 'B',
477                                                 label: 'Basic'
478                                             },
479                                             {
480                                                 key: 'N',
481                                                 label: 'Network Intensive'
482                                             },
483                                             {
484                                                 key: 'C',
485                                                 label: 'Compute Intensive'
486                                             }
487                                         ]
488                                     }
489                                 }
490                             ],
491                             endpoint: 'ovp'
492                         }
493                     ]
494                 }
495             ]
496         }
497     ]
498 });