aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test-utils/factories
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/test-utils/factories')
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductFactory.js62
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js498
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js163
3 files changed, 692 insertions, 31 deletions
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductFactory.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductFactory.js
index 86a8276beb..f3ca07c890 100644
--- a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductFactory.js
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductFactory.js
@@ -13,35 +13,35 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
-import {Factory} from 'rosie';
+import { Factory } from 'rosie';
-export const SoftwareProductFactory = new Factory()
- .attrs({
- softwareProductAttachments: {},
- softwareProductCreation: {},
- softwareProductEditor: {},
- softwareProductProcesses: {
- processesList: [],
- processesEditor: {},
- processToDelete: false
- },
- softwareProductNetworks: {
- networksList: []
- },
- softwareProductComponents: {
- componentsList: [],
- componentEditor: {},
- componentProcesses: {
- processesList: [],
- processesEditor: {},
- processToDelete: false
- },
- network: {
- nicList: [],
- nicEditor: {}
- }
- },
- monitoring: {},
- softwareProductCategories: [],
- softwareProductQuestionnaire: {}
- });
+export const SoftwareProductFactory = new Factory().attrs({
+ softwareProductAttachments: {},
+ softwareProductCreation: {},
+ softwareProductEditor: {},
+ softwareProductValidation: {},
+ softwareProductProcesses: {
+ processesList: [],
+ processesEditor: {},
+ processToDelete: false
+ },
+ softwareProductNetworks: {
+ networksList: []
+ },
+ softwareProductComponents: {
+ componentsList: [],
+ componentEditor: {},
+ componentProcesses: {
+ processesList: [],
+ processesEditor: {},
+ processToDelete: false
+ },
+ network: {
+ nicList: [],
+ nicEditor: {}
+ }
+ },
+ monitoring: {},
+ softwareProductCategories: [],
+ softwareProductQuestionnaire: {}
+});
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js
new file mode 100644
index 0000000000..2ae9249ff7
--- /dev/null
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js
@@ -0,0 +1,498 @@
+/**
+ * Copyright (c) 2019 Vodafone Group
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { Factory } from 'rosie';
+
+export const VSPComplianceCheckedFactory = new Factory().attrs({
+ complianceChecked: [
+ 'compliance.compliancetests.sriov',
+ 'compliance.compliancetests.computeflavors'
+ ]
+});
+
+export const VSPCertificationCheckedFactory = new Factory().attrs({
+ certificationChecked: ['certification.certificationtests.certquery']
+});
+
+export const VSPGeneralInfoFactory = new Factory().attrs({
+ generalInfo: {
+ 'certification.certificationtests.certquery': {
+ vspId: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ },
+ vspVersion: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ }
+ },
+ 'compliance.compliancetests.sriov': {
+ vspId: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ },
+ vspVersion: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ },
+ allowSriov: {
+ isValid: true,
+ errorText: ''
+ }
+ },
+ 'compliance.compliancetests.computeflavors': {
+ vspId: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ },
+ vspVersion: {
+ isValid: false,
+ errorText: 'Please Enter a Value in the Mandatory Field'
+ },
+ csp: {
+ isValid: true,
+ errorText: ''
+ },
+ profilespec: {
+ isValid: true,
+ errorText: ''
+ },
+ vnftype: {
+ isValid: true,
+ errorText: ''
+ }
+ }
+ }
+});
+
+export const VSPTestsRequestFactory = new Factory().attrs({
+ testsRequest: {
+ 'compliance.compliancetests.sriov': {
+ parameters: {
+ vspId: '',
+ vspVersion: '',
+ allowSriov: 'false'
+ },
+ scenario: 'compliance',
+ testCaseName: 'compliance.compliancetests.sriov',
+ testSuiteName: 'compliancetests',
+ endpoint: 'vtp'
+ },
+ 'compliance.compliancetests.computeflavors': {
+ parameters: {
+ vspId: '',
+ vspVersion: '',
+ csp: 'ZZFT',
+ profilespec: 'gsmafnw14',
+ vnftype: 'B'
+ },
+ scenario: 'compliance',
+ testCaseName: 'compliance.compliancetests.computeflavors',
+ testSuiteName: 'compliancetests',
+ endpoint: 'ovp'
+ },
+ 'certification.certificationtests.certquery': {
+ parameters: {
+ vspId: '',
+ vspVersion: ''
+ },
+ scenario: 'certification',
+ testCaseName: 'certification.certificationtests.certquery',
+ testSuiteName: 'certificationtests',
+ endpoint: 'repository'
+ }
+ }
+});
+
+export const VSPTestsMapFactory = new Factory().attrs({
+ vspTestsMap: {
+ 'compliance.compliancetests.sriov': {
+ title: ' SR-IOV Test',
+ parameters: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'VSP Version',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'allowSriov',
+ description: 'Allow SR-IOV?',
+ type: 'select',
+ defaultValue: 'false',
+ isOptional: false,
+ metadata: {
+ disabled: true,
+ choices: [
+ {
+ key: 'true',
+ label: 'Yes'
+ },
+ {
+ key: 'false',
+ label: 'No'
+ }
+ ]
+ }
+ }
+ ],
+ endpoint: 'vtp',
+ testCaseName: 'compliance.compliancetests.sriov',
+ testSuiteName: 'compliancetests',
+ scenario: 'compliance'
+ },
+ 'compliance.compliancetests.computeflavors': {
+ title: 'Compute Flavours Test',
+ parameters: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'VSP Version',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'csp',
+ description: 'CSP',
+ type: 'select',
+ defaultValue: 'ZZFT',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'ZZTF',
+ label: 'Vodafone Group'
+ }
+ ]
+ }
+ },
+ {
+ name: 'profilespec',
+ description: 'Profile Specification',
+ type: 'select',
+ defaultValue: 'gsmafnw14',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'gsmafnw14',
+ label: 'GSMA NFVI Profiles'
+ }
+ ]
+ }
+ },
+ {
+ name: 'vnftype',
+ description: 'VNF Type',
+ type: 'select',
+ defaultValue: 'B',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'B',
+ label: 'Basic'
+ },
+ {
+ key: 'N',
+ label: 'Network Intensive'
+ },
+ {
+ key: 'C',
+ label: 'Compute Intensive'
+ }
+ ]
+ }
+ }
+ ],
+ endpoint: 'ovp',
+ testCaseName: 'compliance.compliancetests.computeflavors',
+ testSuiteName: 'compliancetests',
+ scenario: 'compliance'
+ },
+ 'certification.certificationtests.certquery': {
+ title: 'Other Certifications',
+ parameters: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ defaultValue: '',
+ isOptional: true,
+ metadata: {
+ maxLength: 36,
+ minLength: 1,
+ disabled: true
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'Previous VSP Version',
+ type: 'text',
+ defaultValue: '',
+ isOptional: true,
+ metadata: {
+ maxLength: 36,
+ minLength: 1,
+ disabled: true
+ }
+ }
+ ],
+ endpoint: 'repository',
+ testCaseName: 'certification.certificationtests.certquery',
+ testSuiteName: 'certificationtests',
+ scenario: 'certification'
+ }
+ }
+});
+
+export const VSPChecksFactory = new Factory().attrs({
+ name: 'root',
+ description: 'root',
+ children: [
+ {
+ name: 'certification',
+ description: 'Available Certifications Query',
+ children: [
+ {
+ name: 'certificationtests',
+ description: 'Additional Certification',
+ tests: [
+ {
+ testCaseName:
+ 'certification.certificationtests.certquery',
+ testSuiteName: 'certificationtests',
+ description: 'Other Certifications',
+ author: 'jg@example.com',
+ inputs: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ defaultValue: '',
+ isOptional: true,
+ metadata: {
+ maxLength: 36,
+ minLength: 1,
+ disabled: true
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'Previous VSP Version',
+ type: 'text',
+ defaultValue: '',
+ isOptional: true,
+ metadata: {
+ maxLength: 36,
+ minLength: 1,
+ disabled: true
+ }
+ }
+ ],
+ endpoint: 'repository'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ name: 'compliance',
+ description: 'Available ComplianceChecks',
+ tests: [],
+ children: [
+ {
+ name: 'compliancetests',
+ description: 'Compliance Tests',
+ tests: [
+ {
+ testCaseName: 'compliance.compliancetests.sriov',
+ testSuiteName: 'compliancetests',
+ description: ' SR-IOV Test',
+ author: 'Jim',
+ inputs: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'VSP Version',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'allowSriov',
+ description: 'Allow SR-IOV?',
+ type: 'select',
+ defaultValue: 'false',
+ isOptional: false,
+ metadata: {
+ disabled: true,
+ choices: [
+ {
+ key: 'true',
+ label: 'Yes'
+ },
+ {
+ key: 'false',
+ label: 'No'
+ }
+ ]
+ }
+ }
+ ],
+ endpoint: 'vtp'
+ },
+ {
+ testCaseName:
+ 'compliance.compliancetests.computeflavors',
+ testSuiteName: 'compliancetests',
+ description: 'Compute Flavours Test',
+ author: 'Jim',
+ inputs: [
+ {
+ name: 'vspId',
+ description: 'VSP ID',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'vspVersion',
+ description: 'VSP Version',
+ type: 'text',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ maxLength: '36',
+ minLength: '1'
+ }
+ },
+ {
+ name: 'csp',
+ description: 'CSP',
+ type: 'select',
+ defaultValue: 'ZZFT',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'ZZTF',
+ label: 'Vodafone Group'
+ }
+ ]
+ }
+ },
+ {
+ name: 'profilespec',
+ description: 'Profile Specification',
+ type: 'select',
+ defaultValue: 'gsmafnw14',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'gsmafnw14',
+ label: 'GSMA NFVI Profiles'
+ }
+ ]
+ }
+ },
+ {
+ name: 'vnftype',
+ description: 'VNF Type',
+ type: 'select',
+ defaultValue: 'B',
+ isOptional: false,
+ metadata: {
+ disabled: false,
+ choices: [
+ {
+ key: 'B',
+ label: 'Basic'
+ },
+ {
+ key: 'N',
+ label: 'Network Intensive'
+ },
+ {
+ key: 'C',
+ label: 'Compute Intensive'
+ }
+ ]
+ }
+ }
+ ],
+ endpoint: 'ovp'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+});
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js
new file mode 100644
index 0000000000..6728e049b0
--- /dev/null
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js
@@ -0,0 +1,163 @@
+/**
+ * Copyright (c) 2019 Vodafone Group
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { Factory } from 'rosie';
+
+export const VSPTestResultsFailureFactory = new Factory().attrs({
+ vspTestResults: [
+ {
+ code: '500',
+ message: 'VTP Test(s) could not be completed',
+ httpStatus: 500
+ }
+ ]
+});
+
+export const VSPTestResultsSuccessFactory = new Factory().attrs({
+ vspTestResults: [
+ {
+ scenario: 'certification',
+ description: 'Other Certifications',
+ testCaseName: 'certification.certificationtests.certquery',
+ testSuiteName: 'certificationtests',
+ executionId: 'ebaa5f21-ed68-4098-97a9-775ac8800f09-1550575025614',
+ parameters: {
+ vspId: 'uuidval',
+ vspVersion: 'ver',
+ other: 'values'
+ },
+ results: {
+ testResults: {
+ complianceTests: [
+ {
+ testName: 'Compute Flavors',
+ testResult: 'Pass',
+ notes:
+ 'Diagnostic: test performed against GSMA NFVI Abstraction and Profiling Version 0.1 profiles.'
+ },
+ {
+ testName: 'SR-IOV',
+ testResult: 'Fail',
+ notes:
+ 'Diagnostic: SR-IOV found in VNF Template. User advice: VNF binary and VNF Template must be modified to not require SR-IOV.'
+ },
+ {
+ testName: 'Heat',
+ testResult: 'Pass',
+ notes: ''
+ },
+ {
+ testName: 'TOSCA',
+ testResult: 'Pass',
+ notes:
+ 'Diagnostic: test performed for ETSI GS NFV-SOL001v0.10.0.'
+ }
+ ],
+ validationTests: [
+ {
+ testName: 'OpenStack',
+ testResult: 'Pass',
+ notes:
+ 'Diagnostic: test performed for OpenStack Rocky.'
+ },
+ {
+ testName: 'VMware',
+ testResult: 'Fail',
+ notes:
+ 'Diagnostic: VMware compatible template not found. User advice: add a VMware compatible template to the VSP.'
+ },
+ {
+ testName: 'Kubernetes',
+ testResult: 'Fail',
+ notes:
+ 'Diagnostic: Kubernetes compatible template not found. User advice: add a Kubernetes compatible template, such as Helm Chart, to the VSP.'
+ }
+ ],
+ performanceTests: [
+ {
+ testName: 'Max Throughput',
+ testResult: 'Pass',
+ notes: ''
+ },
+ {
+ testName: 'Latency',
+ testResult: 'Fail',
+ notes:
+ 'Diagnostic: maximum latency threshold of 20ms signalling response time exceededUser advice: consider increasing VDU compute resource.'
+ }
+ ]
+ }
+ },
+
+ status: 'COMPLETED',
+ startTime: '2019-02-19T11:17:05.670',
+ endTime: '2019-02-19T11:17:05.683'
+ },
+ {
+ scenario: 'compliance',
+ testCaseName: 'compliance.compliancetests.sriov',
+ description: 'Allow_SR-IOV',
+ testSuiteName: 'compliancetests',
+ executionId: 'ebaa5f21-ed68-4098-97a9-775ac8800f09-1550575025614',
+ parameters: {
+ vspId: 'uuidval',
+ vspVersion: 'ver',
+ other: 'values'
+ },
+ results: {
+ errors: [
+ {
+ attribute: '',
+ reason: 'Record Not Found',
+ advice:
+ 'User must query with (vspId, vspVersion) values for a certifications record that is present in the Repository',
+ code: 40
+ },
+ {
+ attribute: '',
+ reason: 'Record Not Found',
+ advice:
+ 'User must query with (vspId, vspVersion) values for a certifications record that is present in the Repository',
+ code: 40
+ }
+ ]
+ },
+ status: 'FAILED',
+ startTime: '2019-02-19T11:17:05.670',
+ endTime: '2019-02-19T11:17:05.683'
+ },
+ {
+ scenario: 'compliance',
+ testCaseName: ' compliance.compliancetests.computeflavours',
+ description: 'Allow SR-IOV ',
+ testSuiteName: 'compliancetests',
+ executionId: 'ebaa5f21-ed68-4098-97a9-775ac8800f09-1550575025614',
+ parameters: {
+ vspId: 'uuidval',
+ vspVersion: 'ver',
+ other: 'values'
+ },
+ results: {},
+ status: 'COMPLETED',
+ startTime: '2019-02-19T11:17:05.670',
+ endTime: '2019-02-19T11:17:05.683'
+ },
+ {
+ code: '500',
+ message: 'VTP Test(s) could not be completed',
+ httpStatus: 500
+ }
+ ]
+});