[UPDATE] - change log format

This commit is contained in:
Prof Isen 2025-02-04 22:51:22 +01:00
parent 3e3031ee27
commit 0317a3c506
5 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## 0.0.0.0.0 test ## test run sample apply
Apply 0 1 "Test true" [[ -f /etc/passwd ]] Apply 0 1 "Test true" [[ -f /etc/passwd ]]
Apply 0 2 "Test false" [[ -f /etc/nofile ]] Apply 0 2 "Test false" [[ -f /etc/nofile ]]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## 1.1.1.1 Ensure cramfs kernel module is not available (Automated) ## Ensure cramfs kernel module is not available (Automated)
Apply 1 1 "cramfs" echo '/bin/true' > /etc/modprobe.d/cramfs.conf Apply 1 1 "cramfs" echo '/bin/true' > /etc/modprobe.d/cramfs.conf
Apply 0 2 "cramfs" echo "tout va bien" Apply 0 2 "cramfs" echo "tout va bien"

View File

@ -1,6 +1,6 @@
#!/bin/bash !/bin/bash
## 1.1.1.1 Ensure cramfs kernel module is not available (Automated) ## Ensure cramfs kernel module is not available (Automated)
[[ ! -f /etc/modprobe.d/cramfs.conf ]] && ((CptErr++)) [[ ! -f /etc/modprobe.d/cramfs.conf ]] && ((CptErr++))
[[ -z $(cat /etc/modprobe.d/cramfs.conf|grep '/bin/true') ]] && ((CptErr++)) [[ -z $(cat /etc/modprobe.d/cramfs.conf|grep '/bin/true') ]] && ((CptErr++))

View File

@ -16,9 +16,9 @@ function LogTest() {
# LogTest ${Res} ${Action} ${TEST} # LogTest ${Res} ${Action} ${TEST}
if [[ ${1} -ne 0 ]] if [[ ${1} -ne 0 ]]
then then
echo -e "\n### ${2} - [RESULT] - ${3} : FAILED" echo -e "\n|FAILED|${2}|${3}|${4}"
else else
echo -e "\n### ${2} - [RESULT] - ${3} : SUCESS" echo -e "\n|OK|${2}|${3}|${4}"
fi | tee -a ${RealLogDir}/${3}.log fi | tee -a ${RealLogDir}/${3}.log
} }

View File

@ -39,6 +39,7 @@ for File in $(find ${DirAction} -type f -name run.sh| sort -n)
cd $(dirname ${File}) cd $(dirname ${File})
Test=$(basename $(dirname ${File})) Test=$(basename $(dirname ${File}))
export CptErr=0 export CptErr=0
TxtDesc=$(cat ./run.sh | grep ^'##' | sed 's/#//g')
bash ${Debug} ./run.sh &> ${RealLogDir}/${Test}.log bash ${Debug} ./run.sh &> ${RealLogDir}/${Test}.log
LogTest ${?} ${Action} ${Test} LogTest ${?} ${Action} ${Test} "${TxtDesc}"
done done