Refresh option in validation result page
[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         'vnf-validation'
23     ]
24 });
25
26 export const VSPCertificationCheckedFactory = new Factory().attrs({
27     certificationChecked: ['certification.certificationtests.certquery']
28 });
29
30 export const VSPGeneralInfoFactory = new Factory().attrs({
31     generalInfo: {
32         'certification.certificationtests.certquery': {
33             vspId: {
34                 isValid: false,
35                 errorText: 'Please Enter a Value in the Mandatory Field'
36             },
37             vspVersion: {
38                 isValid: false,
39                 errorText: 'Please Enter a Value in the Mandatory Field'
40             }
41         },
42         'compliance.compliancetests.sriov': {
43             vspId: {
44                 isValid: false,
45                 errorText: 'Please Enter a Value in the Mandatory Field'
46             },
47             vspVersion: {
48                 isValid: false,
49                 errorText: 'Please Enter a Value in the Mandatory Field'
50             },
51             allowSriov: {
52                 isValid: true,
53                 errorText: ''
54             }
55         },
56         'compliance.compliancetests.computeflavors': {
57             vspId: {
58                 isValid: false,
59                 errorText: 'Please Enter a Value in the Mandatory Field'
60             },
61             vspVersion: {
62                 isValid: false,
63                 errorText: 'Please Enter a Value in the Mandatory Field'
64             },
65             csp: {
66                 isValid: true,
67                 errorText: ''
68             },
69             profilespec: {
70                 isValid: true,
71                 errorText: ''
72             },
73             vnftype: {
74                 isValid: true,
75                 errorText: ''
76             }
77         },
78         'vnf-validation': {
79             'vspId': {
80                 isValid: true,
81                 errorText: ''
82             },
83             'host-password': {
84                 isValid: true,
85                 errorText: ''
86             },
87             'vsp-csar': {
88                 isValid: true,
89                 errorText: ''
90             }
91         }
92     }
93 });
94
95 export const VSPTestsRequestFactory = new Factory().attrs({
96     testsRequest: {
97         'compliance.compliancetests.sriov': {
98             parameters: {
99                 vspId: '',
100                 vspVersion: '',
101                 allowSriov: 'false'
102             },
103             scenario: 'compliance',
104             testCaseName: 'compliance.compliancetests.sriov',
105             testSuiteName: 'compliancetests',
106             endpoint: 'vtp'
107         },
108         'compliance.compliancetests.computeflavors': {
109             parameters: {
110                 vspId: '',
111                 vspVersion: '',
112                 csp: 'ZZFT',
113                 profilespec: 'gsmafnw14',
114                 vnftype: 'B'
115             },
116             scenario: 'compliance',
117             testCaseName: 'compliance.compliancetests.computeflavors',
118             testSuiteName: 'compliancetests',
119             endpoint: 'ovp'
120         },
121         'certification.certificationtests.certquery': {
122             parameters: {
123                 vspId: '',
124                 vspVersion: ''
125             },
126             scenario: 'certification',
127             testCaseName: 'certification.certificationtests.certquery',
128             testSuiteName: 'certificationtests',
129             endpoint: 'repository'
130         },
131         'vnf-validation': {
132             parameters: {
133                 'vspId': 'abc',
134                 'host-password': '123',
135                 'vsp-csar': 'vsp.csar',
136             },
137               testCaseName: 'vnf-validation',
138               testSuiteName: 'vnf-validation',
139               scenario: 'onap-dublin',
140               endpoint: 'vtp'
141         }
142     }
143 });
144 export const VSPTestRequestFactory = new Factory().attrs({
145     vspTestRequest:  [
146       {
147         'parameters': {
148           'config-json': '/opt/oclip/conf/vnf-tosca-provision.json',
149           'vsp': '',
150           'vnf-csar': 'file://1574080373688.csar',
151           'ns-csar': '',
152           'vnfm-driver': 'gvnfmdriver ',
153           'onap-objects': '{}',
154           'mode': 'provision ',
155           'vnf-name': 'ABC',
156           'vnf-vendor-name': 'ABC',
157           'timeout': '60000'
158         },
159         'scenario': 'onap-dublin',
160         'testCaseName': 'vnf-tosca-provision',
161         'testSuiteName': 'vnf-validation',
162         'endpoint': 'vtp'
163       }
164      ]
165
166    });
167 export const VSPTestsMapFactory = new Factory().attrs({
168     vspTestsMap: {
169         'compliance.compliancetests.sriov': {
170             title: ' SR-IOV Test',
171             parameters: [
172                 {
173                     name: 'vspId',
174                     description: 'VSP ID',
175                     type: 'text',
176                     isOptional: false,
177                     metadata: {
178                         disabled: false,
179                         maxLength: '36',
180                         minLength: '1'
181                     }
182                 },
183                 {
184                     name: 'vspVersion',
185                     description: 'VSP Version',
186                     type: 'text',
187                     isOptional: false,
188                     metadata: {
189                         disabled: false,
190                         maxLength: '36',
191                         minLength: '1'
192                     }
193                 },
194                 {
195                     name: 'allowSriov',
196                     description: 'Allow  SR-IOV?',
197                     type: 'select',
198                     defaultValue: 'false',
199                     isOptional: false,
200                     metadata: {
201                         disabled: true,
202                         choices: [
203                             {
204                                 key: 'true',
205                                 label: 'Yes'
206                             },
207                             {
208                                 key: 'false',
209                                 label: 'No'
210                             }
211                         ]
212                     }
213                 }
214             ],
215             endpoint: 'vtp',
216             testCaseName: 'compliance.compliancetests.sriov',
217             testSuiteName: 'compliancetests',
218             scenario: 'compliance'
219         },
220         'compliance.compliancetests.computeflavors': {
221             title: 'Compute Flavours Test',
222             parameters: [
223                 {
224                     name: 'vspId',
225                     description: 'VSP ID',
226                     type: 'text',
227                     isOptional: false,
228                     metadata: {
229                         disabled: false,
230                         maxLength: '36',
231                         minLength: '1'
232                     }
233                 },
234                 {
235                     name: 'vspVersion',
236                     description: 'VSP Version',
237                     type: 'text',
238                     isOptional: false,
239                     metadata: {
240                         disabled: false,
241                         maxLength: '36',
242                         minLength: '1'
243                     }
244                 },
245                 {
246                     name: 'csp',
247                     description: 'CSP',
248                     type: 'select',
249                     defaultValue: 'ZZFT',
250                     isOptional: false,
251                     metadata: {
252                         disabled: false,
253                         choices: [
254                             {
255                                 key: 'ZZTF',
256                                 label: 'Vodafone Group'
257                             }
258                         ]
259                     }
260                 },
261                 {
262                     name: 'profilespec',
263                     description: 'Profile Specification',
264                     type: 'select',
265                     defaultValue: 'gsmafnw14',
266                     isOptional: false,
267                     metadata: {
268                         disabled: false,
269                         choices: [
270                             {
271                                 key: 'gsmafnw14',
272                                 label: 'GSMA NFVI Profiles'
273                             }
274                         ]
275                     }
276                 },
277                 {
278                     name: 'vnftype',
279                     description: 'VNF Type',
280                     type: 'select',
281                     defaultValue: 'B',
282                     isOptional: false,
283                     metadata: {
284                         disabled: false,
285                         choices: [
286                             {
287                                 key: 'B',
288                                 label: 'Basic'
289                             },
290                             {
291                                 key: 'N',
292                                 label: 'Network Intensive'
293                             },
294                             {
295                                 key: 'C',
296                                 label: 'Compute Intensive'
297                             }
298                         ]
299                     }
300                 }
301             ],
302             endpoint: 'ovp',
303             testCaseName: 'compliance.compliancetests.computeflavors',
304             testSuiteName: 'compliancetests',
305             scenario: 'compliance'
306         },
307         'certification.certificationtests.certquery': {
308             title: 'Other Certifications',
309             parameters: [
310                 {
311                     name: 'vspId',
312                     description: 'VSP ID',
313                     type: 'text',
314                     defaultValue: '$vspid',
315                     isOptional: true,
316                     metadata: {
317                         maxLength: 36,
318                         minLength: 1,
319                         disabled: true
320                     }
321                 },
322                 {
323                     name: 'vspVersion',
324                     description: 'Previous VSP Version',
325                     type: 'text',
326                     defaultValue: '$vspPreviousVersion',
327                     isOptional: true,
328                     metadata: {
329                         maxLength: 36,
330                         minLength: 1,
331                         disabled: true
332                     }
333                 }
334             ],
335             endpoint: 'repository',
336             testCaseName: 'certification.certificationtests.certquery',
337             testSuiteName: 'certificationtests',
338             scenario: 'certification'
339         },
340         'vnf-validation': {
341                       title: 'vnf-validation',
342                       parameters: [
343                           {
344                               name: 'vspId',
345                               description: 'VSP ID',
346                               type: 'text',
347                               defaultValue: '$vspid',
348                               isOptional: true,
349                               metadata: {
350                                   maxLength: 36,
351                                   minLength: 1,
352                                   disabled: true
353                               }
354                           },
355                           {
356                               name: 'vsp-csar',
357                               description: 'Vsp Csar',
358                               type: 'binary',
359                               defaultValue: '',
360                               isOptional: true
361                           },
362                           {
363                                 name: 'host-password',
364                                 description: 'host-password',
365                                 type: 'binary',
366                                 defaultValue: '',
367                                 isOptional: true
368                           }
369                       ],
370                       endpoint: 'vtp',
371                       testCaseName: 'vnf-validation',
372                       testSuiteName: 'vnf-validation',
373                       scenario: 'onap-dublin'
374                   }
375     }
376 });
377
378 export const VSPChecksFactory = new Factory().attrs({
379     name: 'root',
380     description: 'root',
381     children: [
382         {
383             name: 'certification',
384             description: 'Available Certifications Query',
385             children: [
386                 {
387                     name: 'certificationtests',
388                     description: 'Additional Certification',
389                     tests: [
390                         {
391                             testCaseName:
392                                 'certification.certificationtests.certquery',
393                             testSuiteName: 'certificationtests',
394                             description: 'Other Certifications',
395                             author: 'jg@example.com',
396                             inputs: [
397                                 {
398                                     name: 'vspId',
399                                     description: 'VSP ID',
400                                     type: 'text',
401                                     defaultValue: '$vspid',
402                                     isOptional: true,
403                                     metadata: {
404                                         maxLength: 36,
405                                         minLength: 1,
406                                         disabled: true
407                                     }
408                                 },
409                                 {
410                                     name: 'vspVersion',
411                                     description: 'Previous VSP Version',
412                                     type: 'text',
413                                     defaultValue: '$vspPreviousVersion',
414                                     isOptional: true,
415                                     metadata: {
416                                         maxLength: 36,
417                                         minLength: 1,
418                                         disabled: true
419                                     }
420                                 }
421                             ],
422                             endpoint: 'repository'
423                         }
424                     ]
425                 }
426             ]
427         },
428         {
429             name: 'compliance',
430             description: 'Available ComplianceChecks',
431             tests: [],
432             children: [
433                 {
434                     name: 'compliancetests',
435                     description: 'Compliance Tests',
436                     tests: [
437                         {
438                             testCaseName: 'compliance.compliancetests.sriov',
439                             testSuiteName: 'compliancetests',
440                             description: ' SR-IOV Test',
441                             author: 'Jim',
442                             inputs: [
443                                 {
444                                     name: 'vspId',
445                                     description: 'VSP ID',
446                                     type: 'text',
447                                     isOptional: false,
448                                     metadata: {
449                                         disabled: false,
450                                         maxLength: '36',
451                                         minLength: '1'
452                                     }
453                                 },
454                                 {
455                                     name: 'vspVersion',
456                                     description: 'VSP Version',
457                                     type: 'text',
458                                     isOptional: false,
459                                     metadata: {
460                                         disabled: false,
461                                         maxLength: '36',
462                                         minLength: '1'
463                                     }
464                                 },
465                                 {
466                                     name: 'allowSriov',
467                                     description: 'Allow  SR-IOV?',
468                                     type: 'select',
469                                     defaultValue: 'false',
470                                     isOptional: false,
471                                     metadata: {
472                                         disabled: true,
473                                         choices: [
474                                             {
475                                                 key: 'true',
476                                                 label: 'Yes'
477                                             },
478                                             {
479                                                 key: 'false',
480                                                 label: 'No'
481                                             }
482                                         ]
483                                     }
484                                 }
485                             ],
486                             endpoint: 'vtp'
487                         },
488                         {
489                             testCaseName:
490                                 'compliance.compliancetests.computeflavors',
491                             testSuiteName: 'compliancetests',
492                             description: 'Compute Flavours Test',
493                             author: 'Jim',
494                             inputs: [
495                                 {
496                                     name: 'vspId',
497                                     description: 'VSP ID',
498                                     type: 'text',
499                                     isOptional: false,
500                                     metadata: {
501                                         disabled: false,
502                                         maxLength: '36',
503                                         minLength: '1'
504                                     }
505                                 },
506                                 {
507                                     name: 'vspVersion',
508                                     description: 'VSP Version',
509                                     type: 'text',
510                                     isOptional: false,
511                                     metadata: {
512                                         disabled: false,
513                                         maxLength: '36',
514                                         minLength: '1'
515                                     }
516                                 },
517                                 {
518                                     name: 'csp',
519                                     description: 'CSP',
520                                     type: 'select',
521                                     defaultValue: 'ZZFT',
522                                     isOptional: false,
523                                     metadata: {
524                                         disabled: false,
525                                         choices: [
526                                             {
527                                                 key: 'ZZTF',
528                                                 label: 'Vodafone Group'
529                                             }
530                                         ]
531                                     }
532                                 },
533                                 {
534                                     name: 'profilespec',
535                                     description: 'Profile Specification',
536                                     type: 'select',
537                                     defaultValue: 'gsmafnw14',
538                                     isOptional: false,
539                                     metadata: {
540                                         disabled: false,
541                                         choices: [
542                                             {
543                                                 key: 'gsmafnw14',
544                                                 label: 'GSMA NFVI Profiles'
545                                             }
546                                         ]
547                                     }
548                                 },
549                                 {
550                                     name: 'vnftype',
551                                     description: 'VNF Type',
552                                     type: 'select',
553                                     defaultValue: 'B',
554                                     isOptional: false,
555                                     metadata: {
556                                         disabled: false,
557                                         choices: [
558                                             {
559                                                 key: 'B',
560                                                 label: 'Basic'
561                                             },
562                                             {
563                                                 key: 'N',
564                                                 label: 'Network Intensive'
565                                             },
566                                             {
567                                                 key: 'C',
568                                                 label: 'Compute Intensive'
569                                             }
570                                         ]
571                                     }
572                                 }
573                             ],
574                             endpoint: 'ovp'
575                         }
576                     ]
577                 }
578             ]
579         },
580         {
581           'name': 'onap-dublin',
582           'children': [
583             {
584               'name': 'vnf-validation',
585               'tests': [
586                 {
587                   'scenario': 'onap-dublin',
588                   'testCaseName': 'vnf-tosca-provision',
589                   'testSuiteName': 'vnf-validation',
590                   'description': 'ONAP TOSCA VNF validation',
591                   'author': 'ONAP VTP Team kanagaraj.manickam@huawei.com',
592                   'inputs': [
593                     {
594                       'name': 'config-json',
595                       'description': 'Configuration file path',
596                       'type': 'string',
597                       'defaultValue': '$s{env:OPEN_CLI_HOME}/conf/vnf-tosca-provision.json',
598                       'isOptional': false
599                     },
600                     {
601                       'name': 'vsp',
602                       'description': 'Path to the ONAP vendor service product (VSP) for the VNF to provision',
603                       'type': 'binary',
604                       'isOptional': false
605                     },
606                     {
607                       'name': 'vnf-csar',
608                       'description': 'Path to the TOSCA CSAR for the VNF to provision',
609                       'type': 'binary',
610                       'isOptional': false
611                     },
612                     {
613                       'name': 'ns-csar',
614                       'description': 'Path to the TOSCA CSAR for the NS service to provision',
615                       'type': 'binary',
616                       'isOptional': true
617                     },
618                     {
619                       'name': 'vnfm-driver',
620                       'description': 'VNFM driver to use. One of gvnfmdriver or hwvnfmdriver',
621                       'type': 'string',
622                       'isOptional': false
623                     },
624                     {
625                       'name': 'onap-objects',
626                       'description': 'Existing ONAP object ids to use instead of creating them while running this task',
627                       'type': 'json',
628                       'isOptional': true
629                     },
630                     {
631                       'name': 'mode',
632                       'description': 'setup or standup or cleanup or provision or validate',
633                       'type': 'string',
634                       'defaultValue': 'checkup',
635                       'isOptional': true
636                     },
637                     {
638                       'name': 'vnf-name',
639                       'description': 'VNF Name',
640                       'type': 'string',
641                       'isOptional': false
642                     },
643                     {
644                       'name': 'vnf-vendor-name',
645                       'description': 'VNF Vendor Name',
646                       'type': 'string',
647                       'isOptional': false
648                     },
649                     {
650                       'name': 'timeout',
651                       'description': 'timeout for command to complete the given task in milliseconds',
652                       'type': 'string',
653                       'defaultValue': '60000',
654                       'isOptional': true
655                     }
656                   ],
657                   'endpoint': 'vtp'
658                 }
659               ]
660             }
661           ]
662         }
663     ]
664 });