Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • limx1980/oai-cn5g-common-ci
  • oai/cn5g/oai-cn5g-common-ci
2 results
Show changes
......@@ -199,6 +199,25 @@ do
fi
fi
done
# Doing the common-src submodule folder all the time.
EXTENSION_LIST=("h" "hpp" "c" "cpp")
for EXTENSION in ${EXTENSION_LIST[@]}
do
echo "Checking for all files with .${EXTENSION} extension"
FILE_LIST=`tree -n --noreport -i -f -P *.${EXTENSION} *common-src | sed -e 's#^\./##' | grep "\.${EXTENSION}"`
for FILE_TO_CHECK in ${FILE_LIST[@]}
do
TO_FORMAT=`clang-format -output-replacements-xml ${FILE_TO_CHECK} 2>&1 | grep -v replacements | grep -c replacement`
NB_TOTAL=$((NB_TOTAL + 1))
if [ $TO_FORMAT -ne 0 ]
then
NB_TO_FORMAT=$((NB_TO_FORMAT + 1))
echo "src/$FILE_TO_CHECK" >> ./oai_rules_result_list.txt
fi
done
done
echo ""
echo " ----------------------------------------------------------"
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT over $NB_TOTAL checked!"
......
......@@ -57,6 +57,12 @@ class InstallationStatus():
self.lttngStatus=False
self.cppjwtToBeInstalled=False
self.cppjwtStatus=False
self.libbpfToBeInstalled=False
self.libbpfStatus=False
self.bpftoolToBeInstalled=False
self.bpftoolStatus=False
self.swigToBeInstalled=False
self.swigStatus=False
class BuildStatus():
def __init__(self):
......@@ -73,7 +79,7 @@ def build_summary(args, nfName, ubuntuVersion, rhelVersion):
details += nf_base_image_creation(args, nfName)
(buildStatus, errorList) = nf_build_log_check(nfName)
details += buildStatus
(status, imageRow) = nf_target_image_size(nfName)
(status, imageRow) = nf_target_image_size(nfName, ubuntuVersion, rhelVersion)
details += imageRow
details += generate_build_table_footer()
if len(errorList) > 0:
......@@ -97,7 +103,7 @@ def initial_base_preparation(args, nfName):
status = False
isCached = False
section_status = True
section_end_pattern = f'RUN ./build_{nfName} --install-deps --force'
section_end_pattern = f'RUN ./build_{nfName} --install-deps --force|RUN git clone https://github.com/swig/swig.git'
main_update_step = f'^#([0-9]+).*oai-{nfName}-base.*RUN apt-get update'
build_stage_id = 'NotAcorrectBuildStageId'
with open(f'{cwd}/archives/{logFileName}', 'r') as logfile:
......@@ -135,10 +141,10 @@ def nf_base_image_creation(args, nfName):
logFileName = f'{nfName}_{variant}_image_build.log'
if os.path.isfile(f'{cwd}/archives/{logFileName}'):
status = InstallationStatus()
section_start_pattern = f'RUN ./build_{nfName} --install-deps --force'
section_end_pattern = f'{nfName.upper()} not compiled, to compile it, re-run build_{nfName} without -I option'
section_start_pattern = f'RUN ./build_{nfName} --install-deps --force|RUN git clone https://github.com/swig/swig.git'
section_end_pattern = f'{nfName.upper()} not compiled, to compile it, re-run build_{nfName} without -I option|WORKDIR /flexric'
section_status = False
main_update_step = f'^#([0-9]+).*oai-{nfName}-base.*RUN ./build_{nfName} --install-deps --force'
main_update_step = f'^#([0-9]+).*oai-{nfName}-base.*RUN ./build_{nfName} --install-deps --force|RUN git clone https://github.com/swig/swig.git'
build_stage_id = 'NotAcorrectBuildStageId'
with open(f'{cwd}/archives/{logFileName}', 'r') as logfile:
for line in logfile:
......@@ -192,14 +198,32 @@ def nf_base_image_creation(args, nfName):
status.lttngToBeInstalled = True
if re.search('lttng installation complete', line) is not None and status.lttngToBeInstalled:
status.lttngStatus = True
if re.search('Starting to install libbpf', line) is not None:
status.libbpfToBeInstalled = True
if re.search('libbpf installation complete', line) is not None and status.libbpfToBeInstalled:
status.libbpfStatus = True
if re.search('Starting to install bpftool', line) is not None:
status.bpftoolToBeInstalled = True
if re.search('bpftool installation complete', line) is not None and status.bpftoolToBeInstalled:
status.bpftoolStatus = True
if re.search('Cloning into \'swig\'', line) is not None:
status.swigToBeInstalled = True
if re.search('Installation complete', line) is not None and status.swigToBeInstalled:
status.swigStatus = True
if status.fStatus:
messages[idx] = f'OK:\n -- ./build_{nfName} --install-deps --force'
if nfName != 'flexric':
messages[idx] = f'OK:\n -- ./build_{nfName} --install-deps --force'
else:
messages[idx] = f'OK:\n -- {nfName}: build dependencies installed'
if status.isCached:
messages[idx] += '\n * was cached'
else:
messages[idx] = f'KO:\n -- ./build_{nfName} --install-deps --force'
if nfName != 'flexric':
messages[idx] = f'KO:\n -- ./build_{nfName} --install-deps --force'
else:
messages[idx] = f'KO:\n -- {nfName}: build dependencies NOT installed'
if not status.isCached:
if status.package_install:
if status.package_install or nfName == 'flexric':
messages[idx] += '\n * Packages Installation: OK'
else:
messages[idx] += '\n * Packages Installation: KO'
......@@ -243,6 +267,21 @@ def nf_base_image_creation(args, nfName):
messages[idx] += '\n * lttng Installation: OK'
else:
messages[idx] += '\n * lttng Installation: KO'
if status.libbpfToBeInstalled:
if status.libbpfStatus:
messages[idx] += '\n * libbpf Installation: OK'
else:
messages[idx] += '\n * libbpf Installation: KO'
if status.bpftoolToBeInstalled:
if status.bpftoolStatus:
messages[idx] += '\n * bpftool Installation: OK'
else:
messages[idx] += '\n * bpftool Installation: KO'
if status.swigToBeInstalled:
if status.swigStatus:
messages[idx] += '\n * swig Installation: OK'
else:
messages[idx] += '\n * swig Installation: KO'
else:
messages[idx] = f'KO:\n -- logfile ({logFileName}) not found'
idx += 1
......@@ -261,8 +300,8 @@ def nf_build_log_check(nfName):
logFileName = f'{nfName}_{variant}_image_build.log'
if os.path.isfile(f'{cwd}/archives/{logFileName}'):
status = BuildStatus()
section_start_pattern = f'./build_{nfName} --clean --Verbose --build-type Release --jobs'
section_end_pattern = f'{nfName} installed'
section_start_pattern = f'./build_{nfName} --clean --Verbose --build-type Release --jobs|cmake -GNinja -DCMAKE_BUILD_TYPE=Release'
section_end_pattern = f'{nfName} installed|Installing: /usr/local/etc/{nfName}/{nfName}.conf'
section_status = False
with open(f'{cwd}/archives/{logFileName}', 'r') as logfile:
for line in logfile:
......@@ -286,10 +325,16 @@ def nf_build_log_check(nfName):
error_warning_msg = re.sub('^.*' + error_warning_status + ':', '', correctLine)
errorMessages.append((filename, linenumber, error_warning_status, error_warning_msg))
if status.fStatus:
messages[2*idx] = f'OK:\n -- build_{nfName} --clean --Verbose --build-type Release --jobs'
if nfName != 'flexric':
if status.fStatus:
messages[2*idx] = f'OK:\n -- build_{nfName} --clean --Verbose --build-type Release --jobs'
else:
messages[2*idx] = f'KO:\n -- build_{nfName} --clean --Verbose --build-type Release --jobs'
else:
messages[2*idx] = f'KO:\n -- build_{nfName} --clean --Verbose --build-type Release --jobs'
if status.fStatus:
messages[2*idx] = f'OK:\n -- {nfName}: cmake -DCMAKE_BUILD_TYPE=Release .. && ninja && ninja install'
else:
messages[2*idx] = f'KO:\n -- {nfName}: cmake -DCMAKE_BUILD_TYPE=Release .. && ninja && ninja install'
if status.nb_errors == 0 and status.nb_warnings == 0:
messages[2*idx+1] = 'Perfect:\n -- 0 errors and 0 warnings found in compile log'
elif status.nb_errors == 0 and status.nb_warnings < 20:
......@@ -299,7 +344,7 @@ def nf_build_log_check(nfName):
else:
messages[2*idx+1] = f'KO:\n -- {status.nb_errors} errors and {status.nb_warnings} warnings found in compile log'
else:
messages[2*idxidx] = f'KO:\n -- logfile ({logFileName}) not found'
messages[2*idx] = f'KO:\n -- logfile ({logFileName}) not found'
idx += 1
details += generate_build_table_double_row('cNF Compile / Build', 'Builder Image', messages[0], messages[1], messages[2], messages[3])
if len(errorMessages) > 0:
......@@ -312,7 +357,7 @@ def nf_build_log_check(nfName):
extraDetails += generate_button_footer()
return (details, extraDetails)
def nf_target_image_size(nfName):
def nf_target_image_size(nfName, ubuntuVersion, rhelVersion):
cwd = os.getcwd()
details = ''
variants = ['ubuntu', 'rhel']
......@@ -361,7 +406,10 @@ def nf_target_image_size(nfName):
imagesStatus = False
else:
messages[idx] = f'KO:\n -- logfile ({logFileName}) not found'
imagesStatus = False
if variant == 'ubuntu' and ubuntuVersion != 'N/A':
imagesStatus = False
if variant == 'rhel' and rhelVersion != 'N/A':
imagesStatus = False
idx += 1
details += generate_build_table_row('Image Size', 'Target Image', messages[0], messages[1])
return (imagesStatus, details)
......@@ -21,6 +21,7 @@ For more information about the OpenAirInterface (OAI) Software Alliance:
"""
import os
import shutil
import common.python.cls_cmd as cls_cmd
from common.python.generate_html import (
generate_chapter,
......@@ -36,6 +37,7 @@ def coding_formatting_log_check(args):
details = ''
chapterName = 'OAI Coding / Formatting Guidelines Check'
if os.path.isfile(f'{cwd}/src/oai_rules_result.txt'):
shutil.copy(f'{cwd}/src/oai_rules_result.txt', f'{cwd}/archives')
myCmd = cls_cmd.LocalCmd()
cmd = f'grep NB_FILES_FAILING_CHECK {cwd}/src/oai_rules_result.txt | sed -e "s#NB_FILES_FAILING_CHECK=##"'
nbFailRet = myCmd.run(cmd)
......@@ -55,6 +57,7 @@ def coding_formatting_log_check(args):
details += generate_chapter(chapterName, message, (int(nbFailRet.stdout) == 0))
if os.path.isfile(f'{cwd}/src/oai_rules_result_list.txt'):
shutil.copy(f'{cwd}/src/oai_rules_result_list.txt', f'{cwd}/archives')
details += generate_button_header('oai-formatting-details', 'More details on formatting check')
details += ' <p>Please apply the following command to this(ese) file(s): </p>\n'
details += ' <p style="margin-left: 30px"><strong><code>cd src && clang-format -i filename(s)</code></strong></p>\n'
......