Fix Use grep instead of find and file to check CRLF in stage-test.sh
Change-Id: Ia718640808d9466f7abf0f5759a6d36a2a3b1f00
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/Jenkinsfile.new b/Jenkinsfile.new
index 9e15266..e4d313a 100644
--- a/Jenkinsfile.new
+++ b/Jenkinsfile.new
@@ -35,7 +35,7 @@
booleanParam(name: 'DO_INSTALL', defaultValue: true, description: '')
booleanParam(name: 'DO_DOCKERPUSH', defaultValue: true, description: '')
booleanParam(name: 'DO_ROBOT', defaultValue: true, description: '')
-
+
// Module configuration
string(name: 'MODULE_NAME', defaultValue: 'tests', description: 'Name of the module under test')
string(name: 'IMAGENAME', defaultValue: 'opensourcemano/tests', description: 'Image name for publish')
diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh
index 38993ad..25f2a09 100755
--- a/devops-stages/stage-test.sh
+++ b/devops-stages/stage-test.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# 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
@@ -47,7 +47,7 @@
check_crlf_terminators () {
folder="$1"
crlf_terminators="y"
- ! (find ${folder} -not -type d -exec file "{}" ";" | grep CRLF) && crlf_terminators=""
+ ! grep -r $'\r' ${folder} && crlf_terminators=""
[ -n "${crlf_terminators}" ] && \
echo "Some files in ${folder} have CRLF at the end of some lines" && \
echo "Use this command to change it:" && \
diff --git a/robot-systest/lib/advanced_cluster_mgmt_lib.resource b/robot-systest/lib/advanced_cluster_mgmt_lib.resource
index 563eaa8..562e2f4 100644
--- a/robot-systest/lib/advanced_cluster_mgmt_lib.resource
+++ b/robot-systest/lib/advanced_cluster_mgmt_lib.resource
@@ -134,7 +134,7 @@
Log ${rc},${output}
${rc} ${resourceState}= Run And Return Rc And Output osm cluster-show ${cluster_name} -o jsonpath='{.resourceState}'
Log ${rc},${resourceState}
- IF '$rc' == '$SUCCESS_RETURN_CODE' and '$resourceState' == 'ERROR'
+ IF "${rc}" == "${SUCCESS_RETURN_CODE}" and "${resourceState}" == "ERROR"
Fail Cluster is in error state and will not be deleted.
ELSE
Log Either the cluster ${cluster_name} has been deleted or it is in a valid state.