Remove deprecated code from Validate.groovy
Related-PROD: PROD-28331
Change-Id: I3345acb37a5799ce0a1b9623e7ad35a2b745cb94
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index 5049693..b504922 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -1,7 +1,7 @@
package com.mirantis.mcp
/**
- *
+ * DEPRECATED
* Tests providing functions
*
*/
@@ -17,6 +17,8 @@
def runBasicContainer(master, target, dockerImageLink="xrally/xrally-openstack:0.10.1"){
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Please migrate to validate.runContainer. This method will be removed')
+ error('You are using deprecated method! Please migrate to validate.runContainer. This method will be removed')
def _pillar = salt.getPillar(master, 'I@keystone:server', 'keystone:server')
def keystone = _pillar['return'][0].values()[0]
if ( salt.cmdRun(master, target, "docker ps -f name=cvp -q", false, null, false)['return'][0].values()[0] ) {
@@ -160,6 +162,7 @@
}
/**
+ * DEPRECATED
* Get reclass value
*
* @param target The host for which the values will be provided
@@ -168,6 +171,8 @@
*/
def getReclassValue(master, target, filter) {
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def salt = new com.mirantis.mk.Salt()
def items = filter.tokenize('.')
def _result = salt.cmdRun(master, 'I@salt:master', "reclass-salt -o json -p ${target}", false, null, false)
@@ -181,6 +186,7 @@
}
/**
+ * DEPRECATED
* Create list of nodes in JSON format.
*
* @param filter The Salt's matcher
@@ -189,6 +195,8 @@
def getNodeList(master, filter = null) {
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def nodes = []
def filtered_list = null
def controllers = salt.getMinions(master, 'I@nova:controller')
@@ -220,6 +228,7 @@
}
/**
+ * DEPRECATED
* Execute mcp sanity tests
* Deprecated. Will be removed soon
*
@@ -231,6 +240,8 @@
*/
def runSanityTests(salt_url, salt_credentials, test_set="", output_dir="validation_artifacts/", env_vars="") {
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
+ error('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
def creds = common.getCredentials(salt_credentials)
def username = creds.username
def password = creds.password
@@ -248,6 +259,7 @@
}
/**
+ * DEPRECATED
* Execute pytest framework tests
*
* @param salt_url Salt master url
@@ -259,6 +271,8 @@
def runPyTests(salt_url, salt_credentials, test_set="", env_vars="", name='cvp', container_node="", remote_dir='/root/qa_results/', artifacts_dir='validation_artifacts/') {
def xml_file = "${name}_report.xml"
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
+ error('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
def salt = new com.mirantis.mk.Salt()
def creds = common.getCredentials(salt_credentials)
def username = creds.username
@@ -316,6 +330,7 @@
}
/**
+ * DEPRECATED
* Execute tempest tests
*
* @param target Host to run tests
@@ -330,6 +345,9 @@
*/
def runTempestTests(master, target, dockerImageLink, output_dir, confRepository, confBranch, repository, version, pattern = "false", results = '/root/qa_results') {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def output_file = 'docker-tempest.log'
def dest_folder = '/home/rally/qa_results'
def skip_list = '--skip-list /opt/devops-qa-tools/deployment/skip_contrail.list'
@@ -562,6 +580,7 @@
}
/**
+ * DEPRECATED
* Generate test report
*
* @param target Host to run script from
@@ -573,6 +592,8 @@
def report_file = 'jenkins_test_report.html'
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def dest_folder = '/opt/devops-qa-tools/generate_test_report/test_results'
salt.runSaltProcessStep(master, target, 'file.remove', ["${results}"])
salt.runSaltProcessStep(master, target, 'file.mkdir', ["${results}", "mode=777"])
@@ -608,6 +629,7 @@
}
/**
+ * DEPRECATED
* Execute SPT tests
*
* @param target Host to run tests
@@ -618,6 +640,9 @@
*/
def runSptTests(master, target, dockerImageLink, output_dir, ext_variables = [], results = '/root/qa_results') {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def dest_folder = '/home/rally/qa_results'
salt.runSaltProcessStep(master, target, 'file.remove', ["${results}"])
salt.runSaltProcessStep(master, target, 'file.mkdir', ["${results}", "mode=777"])
diff --git a/src/com/mirantis/mk/Test.groovy b/src/com/mirantis/mk/Test.groovy
index d9de536..d67ac1d 100644
--- a/src/com/mirantis/mk/Test.groovy
+++ b/src/com/mirantis/mk/Test.groovy
@@ -316,6 +316,7 @@
}
/**
+ * DEPRECATED
* Execute tempest tests
*
* @param dockerImageLink Docker image link with rally and tempest
@@ -335,6 +336,9 @@
skipList="mcp_skip.list", localKeystone="/root/keystonercv3" , localLogDir="/root/rally_reports",
doCleanupResources = "false") {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
salt.runSaltProcessStep(master, target, 'file.mkdir', ["${localLogDir}"])
def custom = ''
if (pattern) {
@@ -357,6 +361,7 @@
/**
+ * DEPRECATED
* Execute Rally scenarios
*
* @param dockerImageLink Docker image link with rally and tempest
@@ -368,6 +373,9 @@
def runRallyScenarios(master, dockerImageLink, target, scenario, logDir = "/home/rally/rally_reports/",
doCleanupResources = "false", containerName = "rally_ci") {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
salt.runSaltProcessStep(master, target, 'file.mkdir', ["/root/rally_reports"])
salt.cmdRun(master, target, "docker run --net=host -dit " +
"--name ${containerName} " +
@@ -382,11 +390,15 @@
/**
+ * DEPRECATED
* Upload results to cfg01 node
*
*/
def copyTempestResults(master, target) {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Use validate.addFiles instead. This method will be removed')
+ error('You are using deprecated method! Use validate.addFiles instead. This method will be removed')
if (! target.contains('cfg')) {
salt.cmdRun(master, target, "mkdir -p /root/rally_reports/ && rsync -av /root/rally_reports/ cfg01:/root/rally_reports/")
}
@@ -417,6 +429,7 @@
/** Upload Tempest test results to Testrail
*
+ * DEPRECATED
* @param report Source report to upload
* @param image Testrail reporter image
* @param testGroup Testrail test group
@@ -432,6 +445,8 @@
def uploadResultsTestrail(report, image, testGroup, credentialsId, plan, milestone, suite, master = null, target = 'cfg01*') {
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Try Common.uploadResultsTestRail instead. This method will be removed')
+ error('You are using deprecated method! Try Common.uploadResultsTestRail instead. This method will be removed')
creds = common.getPasswordCredentials(credentialsId)
command = "docker run --rm --net=host " +
"-v ${report}:/srv/report.xml " +
@@ -451,6 +466,7 @@
/** Archive Rally results in Artifacts
*
+ * DEPRECATED
* @param master Salt connection.
* @param target Target node to install docker pkg
* @param reports_dir Source directory to archive
@@ -458,7 +474,9 @@
def archiveRallyArtifacts(master, target, reports_dir='/root/rally_reports') {
def salt = new com.mirantis.mk.Salt()
-
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
def artifacts_dir = '_artifacts/'
def output_file = 'rally_reports.tar'
@@ -495,12 +513,16 @@
/** Cleanup: Remove reports directory
*
+ * DEPRECATED
* @param target Target node to remove repo
* @param reports_dir_name Reports directory name to be removed (that is in /root/ on target node)
* @param archive_artifacts_name Archive of the artifacts
*/
def removeReports(master, target, reports_dir_name = 'rally_reports', archive_artifacts_name = 'rally_reports.tar') {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! This method will be removed')
+ error('You are using deprecated method! This method will be removed')
salt.runSaltProcessStep(master, target, 'file.find', ["/root/${reports_dir_name}", '\\*', 'delete'])
salt.runSaltProcessStep(master, target, 'file.remove', ["/root/${archive_artifacts_name}"])
}
@@ -508,10 +530,14 @@
/** Cleanup: Remove Docker container
*
+ * DEPREACTED
* @param target Target node to remove Docker container
* @param image_link The link of the Docker image that was used for the container
*/
def removeDockerContainer(master, target, containerName) {
def salt = new com.mirantis.mk.Salt()
+ def common = new com.mirantis.mk.Common()
+ common.errorMsg('You are using deprecated method! Use validate.runCleanup instead. This method will be removed')
+ error('You are using deprecated method! Use validate.runCleanup instead. This method will be removed')
salt.cmdRun(master, target, "docker rm -f ${containerName}")
}