From d851b7f760f0b4a4d3e3e43ab4cef294587674b7 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Sat, 14 Feb 2026 11:11:41 +0100 Subject: [PATCH] Fix Use grep instead of find and file to check CRLF in stage-test.sh Change-Id: Ia718640808d9466f7abf0f5759a6d36a2a3b1f00 Signed-off-by: garciadeblas --- Jenkinsfile.new | 2 +- devops-stages/stage-test.sh | 4 ++-- robot-systest/lib/advanced_cluster_mgmt_lib.resource | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile.new b/Jenkinsfile.new index 9e152666..e4d313a8 100644 --- a/Jenkinsfile.new +++ b/Jenkinsfile.new @@ -35,7 +35,7 @@ pipeline { 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 38993ad9..25f2a097 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_four_spaces () { 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 563eaa84..562e2f44 100644 --- a/robot-systest/lib/advanced_cluster_mgmt_lib.resource +++ b/robot-systest/lib/advanced_cluster_mgmt_lib.resource @@ -134,7 +134,7 @@ Check For Cluster Deletion Status 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. -- 2.25.1