diff --git a/ci-scripts/checkAddedWarnings.sh b/ci-scripts/checkAddedWarnings.sh index 3c51a5717f..3d6c80be9e 100755 --- a/ci-scripts/checkAddedWarnings.sh +++ b/ci-scripts/checkAddedWarnings.sh @@ -106,11 +106,11 @@ echo "Merged Commit is : $MERGE_COMMMIT" echo "Target Init is : $TARGET_INIT_COMMIT" # Retrieve the list of modified files since the latest develop commit -MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq` +MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | grep -E "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq` NB_WARNINGS_FILES=0 # Retrieve list of warnings -LIST_WARNING_FILES=`egrep "error:|warning:" archives/*/*.txt | egrep -v "jobserver unavailable|Clock skew detected." | sed -e "s#^.*/home/ubuntu/tmp/##" -e "s#^.*/tmp/CI-eNB/##" -e "s#common/utils/.*/itti#common/utils/itti#" | awk -F ":" '{print $1}' | sort | uniq` +LIST_WARNING_FILES=`grep -E "error:|warning:" archives/*/*.txt | grep -E -v "jobserver unavailable|Clock skew detected." | sed -e "s#^.*/home/ubuntu/tmp/##" -e "s#^.*/tmp/CI-eNB/##" -e "s#common/utils/.*/itti#common/utils/itti#" | awk -F ":" '{print $1}' | sort | uniq` echo "" echo "List of files that have been modified by the Merge Request AND" diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index bd6b93ab84..b454ed4e91 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -64,18 +64,18 @@ then awk '/#[ \t]*ifndef/ { gsub("^.*ifndef *",""); if (names[$1]!="") print "files with same {define ", FILENAME, names[$1]; names[$1]=FILENAME } /#[ \t]*define/ { gsub("^.*define *",""); if(names[$1]!=FILENAME) print "error in declaration", FILENAME, $1, names[$1]; nextfile }' `find openair* common targets executables -name *.h |grep -v LFDS` > header-files-w-incorrect-define.txt # Testing if explicit GNU GPL license banner - egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . | egrep -v "openair3/NAS/COMMON/milenage.h" > files-w-gnu-gpl-license-banner.txt + grep -E -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . | grep -E -v "openair3/NAS/COMMON/milenage.h" > files-w-gnu-gpl-license-banner.txt # Looking at exotic/suspect banner - LIST_OF_FILES_W_BANNER=`egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "Copyright|copyleft" .` + LIST_OF_FILES_W_BANNER=`grep -E -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "Copyright|copyleft" .` if [ -f ./files-w-suspect-banner.txt ]; then rm -f ./files-w-suspect-banner.txt; fi for FILE in $LIST_OF_FILES_W_BANNER do - IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` - IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true` - IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` - IS_MIT_LICENCE_PRESENT=`egrep -c "MIT License" $FILE || true` - IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true` + IS_NFAPI=`echo $FILE | grep -E -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` + IS_OAI_LICENCE_PRESENT=`grep -E -c "OAI Public License" $FILE || true` + IS_BSD_LICENCE_PRESENT=`grep -E -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` + IS_MIT_LICENCE_PRESENT=`grep -E -c "MIT License" $FILE || true` + IS_EXCEPTION=`echo $FILE | grep -E -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] && [ $IS_MIT_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] @@ -147,7 +147,7 @@ echo " ----------------------------------------------------------" echo "" # Retrieve the list of modified files since the latest develop commit -MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq` +MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | grep -E "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq` NB_TO_FORMAT=0 if [ -f header-files-w-incorrect-define.txt ] then @@ -173,20 +173,20 @@ do if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ] then # Testing if explicit GNU GPL license banner - GNU_EXCEPTION=`echo $FULLFILE | egrep -c "openair3/NAS/COMMON/milenage.h" || true` + GNU_EXCEPTION=`echo $FULLFILE | grep -E -c "openair3/NAS/COMMON/milenage.h" || true` if [ $GNU_EXCEPTION -eq 0 ] then - egrep -il "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt + grep -E -il "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt fi # Looking at exotic/suspect banner - IS_BANNER=`egrep -i -c "Copyright|copyleft" $FULLFILE || true` + IS_BANNER=`grep -E -i -c "Copyright|copyleft" $FULLFILE || true` if [ $IS_BANNER -ne 0 ] then - IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` - IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true` - IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` - IS_MIT_LICENCE_PRESENT=`egrep -c "MIT License" $FULLFILE || true` - IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true` + IS_NFAPI=`echo $FULLFILE | grep -E -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` + IS_OAI_LICENCE_PRESENT=`grep -E -c "OAI Public License" $FULLFILE || true` + IS_BSD_LICENCE_PRESENT=`grep -E -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` + IS_MIT_LICENCE_PRESENT=`grep -E -c "MIT License" $FULLFILE || true` + IS_EXCEPTION=`echo $FULLFILE | grep -E -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] && [ $IS_MIT_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 85d8520a5f..1888e00068 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -214,7 +214,7 @@ class PhySim: mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc describe pod $pod >> cmake_targets/log/physim_pods_summary.txt; done', '\$', 10) mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/log/physim_test.txt', '.') try: - listLogFiles = subprocess.check_output('egrep --colour=never "Execution Log file|Linux oai-" physim_test.txt', shell=True, universal_newlines=True) + listLogFiles = subprocess.check_output('grep -E --colour=never "Execution Log file|Linux oai-" physim_test.txt', shell=True, universal_newlines=True) for line in listLogFiles.split('\n'): res1 = re.search('Linux (?Poai-[a-zA-Z0-9\-]+) ', str(line)) res2 = re.search('Execution Log file = (?P[a-zA-Z0-9\-\/\.\_\+]+)', str(line)) diff --git a/ci-scripts/doGitLabMerge.sh b/ci-scripts/doGitLabMerge.sh index c0d6121314..15c3f34855 100755 --- a/ci-scripts/doGitLabMerge.sh +++ b/ci-scripts/doGitLabMerge.sh @@ -126,7 +126,7 @@ git config user.email "jenkins@openairinterface.org" git config user.name "OAI Jenkins" git checkout -f $SOURCE_COMMIT_ID > checkout.txt 2>&1 -STATUS=`egrep -c "fatal: reference is not a tree" checkout.txt` +STATUS=`grep -E -c "fatal: reference is not a tree" checkout.txt` rm -f checkout.txt if [ $STATUS -ne 0 ] then @@ -137,7 +137,7 @@ fi git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI" -STATUS=`git status | egrep -c "You have unmerged paths.|fix conflicts"` +STATUS=`git status | grep -E -c "You have unmerged paths.|fix conflicts"` if [ $STATUS -ne 0 ] then echo "There are merge conflicts.. Cannot perform further build tasks" diff --git a/ci-scripts/docker/Dockerfile.cppcheck.xenial b/ci-scripts/docker/Dockerfile.cppcheck.xenial index 0d6aa029ff..5a61532346 100644 --- a/ci-scripts/docker/Dockerfile.cppcheck.xenial +++ b/ci-scripts/docker/Dockerfile.cppcheck.xenial @@ -52,8 +52,8 @@ RUN mkdir -p cmake_targets/log && \ -I openair3/NAS/COMMON/UTIL \ -j`nproc` . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt -RUN egrep -c 'severity="error' cmake_targets/log/cppcheck.xml +RUN grep -E -c 'severity="error' cmake_targets/log/cppcheck.xml -RUN egrep -c 'severity="warning' cmake_targets/log/cppcheck.xml +RUN grep -E -c 'severity="warning' cmake_targets/log/cppcheck.xml RUN cat cmake_targets/log/cppcheck.xml diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index e073282635..b03573685a 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -568,7 +568,7 @@ class EPCManagement(): mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60) mySSH.command('docker volume prune --force || true', '\$', 60) time.sleep(2) - mySSH.command('tshark -r /tmp/oai-cn5g-v1.5.pcap | egrep --colour=never "Tracking area update" ','\$', 30) + mySSH.command('tshark -r /tmp/oai-cn5g-v1.5.pcap | grep -E --colour=never "Tracking area update" ','\$', 30) result = re.search('Tracking area update request', mySSH.getBefore()) if result is not None: message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)' @@ -769,7 +769,7 @@ class EPCManagement(): mySSH.command('docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) else: mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) - mySSH.command('tshark -r mme_' + self.testCase_id + '.pcap | egrep --colour=never "Tracking area update"', '\$', 60) + mySSH.command('tshark -r mme_' + self.testCase_id + '.pcap | grep -E --colour=never "Tracking area update"', '\$', 60) result = re.search('Tracking area update request', mySSH.getBefore()) if result is not None: message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)' diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 031de4b70e..ad1b2bc5e4 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -512,7 +512,7 @@ class RANManagement(): self.prematureExit = True return else: - mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Starting|Started"', '\$', 4) + mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | grep -E --text --color=never -i "wait|sync|Starting|Started"', '\$', 4) if rruCheck: result = re.search('wait RUs', mySSH.getBefore()) else: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh index 24960e215d..586143cd2a 100755 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh @@ -19,7 +19,7 @@ MME_CONF[@HSS_IP_ADDR@]="192.168.61.2" cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf for K in "${!MME_CONF[@]}"; do - egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" + grep -E -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" ret=$?;[[ ret -ne 0 ]] && echo "Could not replace $K with ${MME_CONF[$K]}" done diff --git a/ci-scripts/yaml_files/fr1_epc_20897/entrypoint.sh b/ci-scripts/yaml_files/fr1_epc_20897/entrypoint.sh index 27c6c401a6..3655a74fc2 100755 --- a/ci-scripts/yaml_files/fr1_epc_20897/entrypoint.sh +++ b/ci-scripts/yaml_files/fr1_epc_20897/entrypoint.sh @@ -11,7 +11,7 @@ then ifconfig ${MME_INTERFACE_NAME_FOR_S10} ${MME_IPV4_ADDRESS_FOR_S10} up fi -LIST_OF_NETWORKS=`ifconfig -s | egrep -v "^Iface|^lo" | cut -d' ' -f1` +LIST_OF_NETWORKS=`ifconfig -s | grep -E -v "^Iface|^lo" | cut -d' ' -f1` for if_name in $LIST_OF_NETWORKS do diff --git a/ci-scripts/yaml_files/magma_lte_20892/entrypoint.sh b/ci-scripts/yaml_files/magma_lte_20892/entrypoint.sh index 859ff7d98f..3095860169 100755 --- a/ci-scripts/yaml_files/magma_lte_20892/entrypoint.sh +++ b/ci-scripts/yaml_files/magma_lte_20892/entrypoint.sh @@ -19,7 +19,7 @@ MME_CONF[@HSS_IP_ADDR@]="192.168.61.194" cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf for K in "${!MME_CONF[@]}"; do - egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" + grep -E -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" done diff --git a/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh b/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh index 859ff7d98f..3095860169 100755 --- a/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh +++ b/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh @@ -19,7 +19,7 @@ MME_CONF[@HSS_IP_ADDR@]="192.168.61.194" cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf for K in "${!MME_CONF[@]}"; do - egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" + grep -E -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" done diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index bcd151b086..05f3388627 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -42,7 +42,7 @@ KERNEL_VERSION=$(uname -r | cut -d '.' -f1) KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) #check if we run inside a container -IS_CONTAINER=`egrep -c "docker|podman|kubepods|libpod|buildah" /proc/self/cgroup || true` +IS_CONTAINER=`grep -E -c "docker|podman|kubepods|libpod|buildah" /proc/self/cgroup || true` #sudo is not needed when we are root if [ "$UID" = 0 ] then @@ -187,7 +187,7 @@ check_warnings() { #we look for 'warning:' in the compilation log file #this is how gcc starts a warning #this is not perfect, we may get false positive - warning_count=`grep "warning:" "$1" | egrep -v "jobserver unavailable|disabling jobserver mode" | wc -l` + warning_count=`grep "warning:" "$1" | grep -E -v "jobserver unavailable|disabling jobserver mode" | wc -l` if [ $warning_count -gt 0 ]; then echo_error "WARNING: $warning_count warnings. See $1" fi @@ -223,7 +223,7 @@ compilations() { ret=$? } > $dlog/$logfile 2>&1 # Print the errors and warnings for CI purposes - egrep -A3 "warning:|error:" $dlog/$logfile || true + grep -E -A3 "warning:|error:" $dlog/$logfile || true check_warnings "$dlog/$logfile" if [[ $ret -eq 0 ]]; then echo_success "$targets compiled" diff --git a/docker/Dockerfile.build.ubuntu22.cross-arm64 b/docker/Dockerfile.build.ubuntu22.cross-arm64 index faadf79eb2..16090c87e8 100644 --- a/docker/Dockerfile.build.ubuntu22.cross-arm64 +++ b/docker/Dockerfile.build.ubuntu22.cross-arm64 @@ -48,7 +48,7 @@ RUN /bin/sh oaienv && \ # making always passing so we can analyze the all.txt file ninja dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim lte-softmodem nr-softmodem nr-cuup oairu lte-uesoftmodem nr-uesoftmodem params_libconfig coding rfsimulator > ../../log/all.txt 2>&1; \ # displaying errors and warnings - egrep -A3 "warning:|error:" ../../log/all.txt || true && \ + grep -E -A3 "warning:|error:" ../../log/all.txt || true && \ # will fail only if string "errors:" is found - egrep "error:" -vqz ../../log/all.txt && \ + grep -E "error:" -vqz ../../log/all.txt && \ echo "====== End of log for cross-build executables ======" diff --git a/openair1/PHY/TOOLS/Makefile b/openair1/PHY/TOOLS/Makefile index 8ed80cfdd1..a881bd4070 100644 --- a/openair1/PHY/TOOLS/Makefile +++ b/openair1/PHY/TOOLS/Makefile @@ -13,7 +13,7 @@ oai_dfts_sse4.s: oai_dfts.c dft_cycles_avx2: oai_dfts_avx2 - ./oai_dfts_avx2 | egrep cycles + ./oai_dfts_avx2 | grep -E cycles oai_dfts_aarch64: oai_dfts_neon.c gcc -O2 -std=gnu99 -gdwarf-2 -lgcc -lrt -g -ggdb -o oai_dfts_neon oai_dfts_neon.c ../../../common/utils/time_meas.c ../../SIMULATION/TOOLS/taus.c $$OPENAIR_HOME/common/utils/LOG/log.c ../../SIMULATION/TOOLS/rangen_double.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR_TARGETS/COMMON -I$$OPENAIR_HOME/radio/COMMON -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -I$$OPENAIR_HOME/common/utils/msc -I$$OPENAIR_HOME/nfapi/open-nFAPI/nfapi/public_inc -DMR_MAIN -DNB_ANTENNAS_RX=1 -DNB_ANTENNAS_TX=1 -DMAX_NUM_CCs=1 -lm -lpthread