summaryrefslogtreecommitdiffstats
.highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright © 2016-2017 European Support Limited
 *
 * 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.
 */
const {Then, When} = require('cucumber');
const assert = require('assert');
const util = require('../cucumber-common/utils/Utils.js');
const _ = require('lodash');

function getPath(path, context) {
    let compiled = _.template(path);
    return compiled(context);
}

/**
 * @module Questionnaire
 * @description Gets the questionnaire for the current item and saves it on the context
 * @exampleFile Example_VSP.feature
 * @step I want to get the questionnaire for this item
 **/
Then('I want to get the questionnaire for this item', function () {
	let path = "/vendor-software-products/" + this.context.item.id + "/versions/" + this.context.item.versionId + "/questionnaire";
	return util.request(this.context, 'GET', path).then(result => {
		this.context.qdata = JSON.parse(result.data.data);
		this.context.qschema = result.data.schema;
		this.context.qurl = path;
	});
});

/**
 * @module Questionnaire
 * @description Gets the questionnaire for the current item and component and saves it on the context
 * @exampleFile Example_VSP.feature
 * @step I want to get the questionnaire for this component
 **/
Then('I want to get the questionnaire for this component', function () {
	let path = "/vendor-software-products/" + this.context.item.id + "/versions/" + this.context.item.versionId + "/components/" + this.context.componentId  + "/questionnaire";
	return util.request(this.context, 'GET', path).then(result => {
		this.context.qdata = JSON.parse(result.data.data);
		this.context.qschema = result.data.schema;
		this.context.qurl = path;
	});
});

/**
 * @module Questionnaire
 * @description Gets the questionnaire from path and saves it on the context
 * @exampleFile TestMD5.feature
 * @step I want to get the questionnaire for this path {string}
 **/
Then('I want to get the questionnaire for this path {string}', function (string) {
    let path = getPath(string, this.context);
    return util.request(this.context, 'GET', path).then(result => {
        this.context.qdata = JSON.parse(result.data.data);
        this.context.qschema = result.data.schema;
        this.context.qurl = path;
    });
});

/**
 * @module Questionnaire
 * @description Updates the property for the saved questionnaire
 * @exampleFile Example_VSP.feature
 * @step I want to update this questionnaire with value {string} for path {string}
 **/
Then('I want to update this questionnaire with value {string} for property {string}', function (string, string2) {
	_.set(this.context.qdata, string, string2);
});

/**
 * @module Questionnaire
 * @description Checks the questionnaire data on the context for the given value and property
 * @exampleFile Example_VSP.feature
 * @step I want to check this questionnaire has value {string} for property {string}
 **/
Then('I want to check this questionnaire has value {string} for property {string}', function (string, string2) {
	assert.equal(_.get(this.context.qdata, string), string2);
});

/**
 * @module Questionnaire
 * @description Updates the the questionnaire data from the context to the same url that loaded it
 * @exampleFile Example_VSP.feature
 * @step I want to update this questionnaire
 **/
Then('I want to update this questionnaire', function () {
	return util.request(this.context, 'PUT', this.context.qurl, this.context.qdata);
});

/**
 * @module Questionnaire
 * @description Checks if the value of given property name in questionnaire data on the context is same as provided value
 * @exampleFile ComponentData.feature
 * @step I want to check value of {string} in the questionnaire data with value of property {string}
 */
Then('I want to check value of {string} in the questionnaire data with value of property {string}', function (string,
																									propertyName) {
    expectedValue = _.get(this.context, propertyName)
	data1 = this.context.qdata;
    assert.equal(_.get(data1, string), expectedValue);
});

/**
 * @module Questionnaire - Defined in Questionnaire module since this is used to fetch componentId for which questionnaire is to be fetched
 * @description Finds and set componentId in context from list of components in responseData for component name in given property
 * @exampleFile ComponentData.feature
 * @step I want to set componentId for component name in property {string}
 */
Then('I want to set componentId for component name in property {string}', function (string) {
    displayName = _.get(this.context, string);
    results = this.context.responseData.results;
    for (i=0; i<results.length; i++) {
        if (results[i].displayName == displayName ){
            this.context.componentId = results[i].id;
            return;
        }
    }
});
AgeCommit message (Collapse)AuthorFilesLines
2021-05-04Update versions for Aluminum SR3Dan Timoney140-164/+154
Update versions for Aluminum SR3 Issue-ID: CCSDK-3285 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: I781f82b9ca6c640bb1c889c6f914bae53c1c54ab
2021-04-19Release version 1.2.2 and roll to next snapshotDan Timoney149-150/+155
Release version 1.2.2 of ccsdk/sli and roll to next snapshot Issue-ID: SDNC-1515 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: Ie301afd08ba9039b510b55f38b7be5ad8d1773cb
2021-04-19Fix yangparser invocationDan Timoney20-39/+8206
Fix YangParser invocation in restconf-provider to address breaking change in ODL Aluminum release. Issue-ID: SDNC-1515 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: I9974889bfa9bbd11077c95275c0cb8ba59b1b0bb
2021-03-24Roll versionDan Timoney148-150/+150
Roll version to next snapshot version Issue-ID: CCSDK-3237 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: Ib2312e63af4a6f5d875dc7341eeee61cd5446d68
2021-03-24Release version 1.2.1Dan Timoney1-0/+5
Release version 1.2.1 of ccsdk/sli Issue-ID: CCSDK-3237 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: Ie33b0e730465a1231e4654fdc561c1f22d08ff7d
2021-03-24Fix null pointer exceptionDan Timoney139-139/+142
Fix null pointer exception in case of empty list Issue-ID: CCSDK-3237 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: Ic94d60bf7a52c23507ecc2402f9be9b580f2ea5b
h=guilin&id=46c69f518bd200e25d46f28cc32473ba08cdfe3d'>Release version 1.1.0 of sli/northboundDan Timoney31-70/+66 Release initial Honolulu version of sli/northbound and roll version to next snapshot Change-Id: I21ee4f2431d6e15573998fd615fc2090aee15810 Issue-ID: CCSDK-3002 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-25Release version 1.1.0 of sli/pluginsDan Timoney33-89/+68 Release initial Honolulu version of sli/plugins and roll version to next snapshot Change-Id: I75d58fccc8ab0b5653d3160ed6f2e302c3ade8b9 Issue-ID: CCSDK-3002 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-25Release version 1.1.0 of sli/adaptorsDan Timoney53-115/+106 Release initial Honolulu version of sli/adaptors and roll version to next snapshot Change-Id: I3a59f29d7819e8d777dd02aede9a263ea0be8e36 Issue-ID: CCSDK-3002 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-25Release version 1.1.0 of sli/coreDan Timoney38-37/+42 Release initial Honolulu version of sli/core and roll version to next snapshot Change-Id: Id65539a7e275c57fce0bc23e88bbc2eaf641cf05 Issue-ID: CCSDK-3002 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-17Fix NPE in toJsonString()Dan Timoney1-1/+5 Fixed SvcLogicContext.toJsonString() to return the empty string () if it cannot find the requested prefix in the service logic context. Change-Id: I5e36864f961b36b6c82a3db8d20483df6686ed15 Issue-ID: CCSDK-2990 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-10Handle properties file reference outside OSGiDan Timoney2-25/+33 Update properties file resolves for OSGi to handle ClassNotFoundError exception correctly. Change-Id: I511213e447d07576c9a44654956b207174ed6638 Issue-ID: CCSDK-2976 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-11-10Fix handling of non-OSGiDan Timoney3-4/+29 Fixed handling of case where aai-service and netbox-client are called outside OSGi container. Change-Id: Ie83dd217a77a021a30d171e0964d9ac709e40cc8 Issue-ID: CCSDK-2976 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-23- Adding the path for the newly introduced (i.e. in v21) network-route ↵Hesam Rahimi2-0/+7 resource in aai-schema, to the properties file. - Adding tunnel-termination-points and te-link-attributes back into aai schema. Issue-ID: CCSDK-2393 Change-Id: I80d21463c509c8caf802cf5681abc3434d6cf34a Signed-off-by: Hesam Rahimi <hesam.rahimi@huawei.com> 2020-10-21Fix pattern validationDan Timoney2-4/+4 Pattern validation incorrectly disallows period as part of file name Change-Id: I3b3692093e16c41c312b326246a5dee83f674ee0 Issue-ID: CCSDK-2918 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-20Merge changes I4a6cb477,I00d6a0c1KAPIL SINGAL5-478/+69 * changes: Support netbox-client outside OSGi container Address security issues 2020-10-20Support netbox-client outside OSGi containerDan Timoney2-9/+63 Updated netbox-client initialization so that it works properly when initialized outside an OSGi container (e.g springboot) Change-Id: I4a6cb477206745eb4ca21f10a7fb54cc616ef4cd Issue-ID: CCSDK-2923 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-20Updating AAI service adaptor to use version 21 (v21) of the schema model.Hesam Rahimi26-859/+4152 Issue-ID: CCSDK-2393 Change-Id: I53369c73fd25c7f433fd99456e28fbe0fecbc59a Signed-off-by: Hesam Rahimi <hesam.rahimi@huawei.com> 2020-10-19Disable external entities referenceDan Timoney1-0/+5 Disable external entities reference in properties node XML parser to avoid XXE vulnerability. Change-Id: I5136dc7edb575d944dfe9fbab334629ec18c5d47 Issue-ID: CCSDK-2918 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-19Address security issuesDan Timoney3-469/+6 Removed unused Mdsal activator class. Added file name validation for ConnectionBuilder in ansible adaptor Change-Id: I00d6a0c1edccae263520738f7a4685b1ad71b943 Issue-ID: CCSDK-2918 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-19Add file path validationDan Timoney7-4/+8 Add file path validation for EnvVarFileResolver. Refactored PathValidator to org.onap.ccsdk.sli.core.utils so it can be used here. Change-Id: Ibb50df0ad020cf376c1ce20e7b598f7ad7223d48 Issue-ID: CCSDK-2918 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-10-16Add code to validate path names.Dan Timoney5-7/+40 Added code to validate path names to avoid possible attacks due to hidden/special characters and/or embedded new lines. Change-Id: I53d7266e44fbada1d9d5f458dfcdbc452801672c Issue-ID: CCSDK-2918 Signed-off-by: Dan Timoney <dtimoney@att.com> 2020-09-09Roll to initial Honolulu release versionDan Timoney32-64/+64 Roll master branch to initial Honolulu release version Change-Id: I54ac03e89312555c06c11b8f5512393909cae786 Issue-ID: CCSDK-2742 Signed-off-by: Dan Timoney <dtimoney@att.com>