tests: replace egrep with grep -E to avoid deprecation warning

https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html

Signed-off-by: Balint Tobik <btobik@redhat.com>
This commit is contained in:
Balint Tobik
2025-01-28 10:40:49 +01:00
parent 47140357c4
commit 1943a1c96d
5 changed files with 21 additions and 21 deletions

View File

@@ -286,7 +286,7 @@ show_procs()
local regex
regex="(${pattern_list})"
ps -efww | egrep -i "$regex" || true
ps -efww | grep -i -E "$regex" || true
}
kill_tmux_sessions()
@@ -612,7 +612,7 @@ cleanup()
# Check that clh socket was deleted
if [ $configured_hypervisor = "clh" ] && [ ! -z $clh_socket_path ]; then
[ -f $clh_socket_path ] && die "CLH socket path $clh_socket_path was not properly cleaned up"
[ -f $clh_socket_path ] && die "CLH socket path $clh_socket_path was not properly cleaned up"
fi
sudo systemctl restart containerd
@@ -961,7 +961,7 @@ get_addresses()
if [ $configured_hypervisor = "qemu" ]; then
addresses=$(ss -Hp --vsock |\
egrep -v "\<socat\>" |\
grep -v -E "\<socat\>" |\
awk '$2 ~ /^ESTAB$/ {print $6}' |\
grep ":${EXPECTED_VSOCK_PORT}$")
elif [ $configured_hypervisor = "clh" ]; then
@@ -1166,7 +1166,7 @@ validate_agent()
# Regular expression that describes possible agent failures
local regex="(slog::Fuse|Drain|Custom|serialization error|thread.*panicked|stack backtrace:)"
egrep -q "$regex" "$log_file" && cat $log_file && die "Found agent error in log file: '$log_file'"
grep -q -E "$regex" "$log_file" && cat $log_file && die "Found agent error in log file: '$log_file'"
local entry
entry=$(get_shutdown_test_type_entry "$shutdown_test_type" || true)
@@ -1186,7 +1186,7 @@ validate_agent()
# The message the agent writes to stderr just before it exits.
local done_msg="\<shutdown complete\>"
egrep -q "$done_msg" "$log_file" || (cat $log_file && die "missing agent shutdown message")
grep -q -E "$done_msg" "$log_file" || (cat $log_file && die "missing agent shutdown message")
else
# We can only check for the shutdown message if the agent debug
# logs are available.

View File

@@ -76,7 +76,7 @@ create_user_data() {
dnf_proxy=""
service_proxy=""
docker_user_proxy="{}"
environment=$(env | egrep "ghprb|WORKSPACE|KATA|GIT|JENKINS|_PROXY|_proxy" | \
environment=$(env | grep -E "ghprb|WORKSPACE|KATA|GIT|JENKINS|_PROXY|_proxy" | \
sed -e "s/'/'\"'\"'/g" \
-e "s/\(^[[:alnum:]_]\+\)=/\1='/" \
-e "s/$/'/" \
@@ -210,7 +210,7 @@ create_config_iso() {
pull_fedora_cloud_image() {
fedora_img="$1"
fedora_version=38
# Add a version to the image cache, otherwise the tests are going to
# Add a version to the image cache, otherwise the tests are going to
# use always the same image without rebuilding it, regardless the version
# set in fedora_version
fedora_img_cache="${fedora_img}.cache.${fedora_version}"

View File

@@ -638,7 +638,7 @@ errors=$(
signals=$(
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
grep -v -E '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort
)
@@ -648,7 +648,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |
sort >_error.grep
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
grep -v -E '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort >_signal.grep
echo '// mkerrors.sh' "$@"

View File

@@ -200,7 +200,7 @@ function grab_system() {
((anon*=1024))
# Mapped pages
local mapped=$(egrep "^Mapped:" /proc/meminfo | awk '{print $2}')
local mapped=$(grep -E "^Mapped:" /proc/meminfo | awk '{print $2}')
((mapped*=1024))
# Cached

View File

@@ -429,7 +429,7 @@ static_check_license_headers()
info "Checking $desc"
local missing=$(egrep \
local missing=$(grep \
--exclude=".git/*" \
--exclude=".gitignore" \
--exclude=".dockerignore" \
@@ -475,7 +475,7 @@ static_check_license_headers()
--exclude="src/mem-agent/example/protocols/protos/google/protobuf/*.proto" \
--exclude="src/libs/*/test/texture/*" \
--exclude="*.dic" \
-EL $extra_args "\<${pattern}\>" \
-EL $extra_args -E "\<${pattern}\>" \
$files || true)
if [ -n "$missing" ]; then
@@ -783,7 +783,7 @@ static_check_docs()
local exclude_pattern
# Convert the list of files into an egrep(1) alternation pattern.
# Convert the list of files into an grep(1) alternation pattern.
exclude_pattern=$(echo "${exclude_doc_regexs[@]}"|sed 's, ,|,g')
# Every document in the repo (except a small handful of exceptions)
@@ -792,7 +792,7 @@ static_check_docs()
do
# Check the ignore list for markdown files that do not need to
# be referenced by others.
echo "$doc"|egrep -q "(${exclude_pattern})" && continue
echo "$doc"|grep -q -E "(${exclude_pattern})" && continue
grep -q "$doc" "$md_links" || die "Document $doc is not referenced"
done
@@ -827,7 +827,7 @@ static_check_docs()
if [ "$specific_branch" != "true" ]
then
# If the URL is new on this PR, it cannot be checked.
echo "$new_urls" | egrep -q "\<${url}\>" && \
echo "$new_urls" | grep -q -E "\<${url}\>" && \
info "ignoring new (but correct) URL: $url" && continue
fi
@@ -925,12 +925,12 @@ static_check_eof()
[ "$file" == "Vagrantfile" ] && return
local invalid=$(cat "$file" |\
egrep -o '<<-* *\w*' |\
grep -o -E '<<-* *\w*' |\
sed -e 's/^<<-*//g' |\
tr -d ' ' |\
sort -u |\
egrep -v '^$' |\
egrep -v "$anchor" || true)
grep -v -E '^$' |\
grep -v -E "$anchor" || true)
[ -z "$invalid" ] || die "Expected '$anchor' here anchor, in $file found: $invalid"
}
@@ -957,7 +957,7 @@ static_check_files()
then
info "Checking all files in $branch branch"
files=$(git ls-files | egrep -v "/(.git|vendor|grpc-rs|target)/" || true)
files=$(git ls-files | grep -v -E "/(.git|vendor|grpc-rs|target)/" || true)
else
info "Checking local branch for changed files only"
@@ -979,7 +979,7 @@ static_check_files()
# Look for files containing the specified comment tags but
# which do not include a github URL.
match=$(egrep -H "\<FIXME\>|\<TODO\>" "$file" |\
match=$(grep -H -E "\<FIXME\>|\<TODO\>" "$file" |\
grep -v "https://github.com/.*/issues/[0-9]" |\
cut -d: -f1 |\
sort -u || true)
@@ -1294,7 +1294,7 @@ static_check_dockerfiles()
linter_cmd+=" --ignore DL3041"
# "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
linter_cmd+=" --ignore DL3033"
# "DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`"
# "DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`"
linter_cmd+=" --ignore DL3018"
# "DL3003 warning: Use WORKDIR to switch to a directory"
# See https://github.com/hadolint/hadolint/issues/70