Skip to content

Commit

Permalink
Merge pull request #10 from chetan-rathore/mainline
Browse files Browse the repository at this point in the history
Mainline
  • Loading branch information
chetan-rathore authored Nov 21, 2024
2 parents 99e0490 + d9a0d07 commit 380ef87
Show file tree
Hide file tree
Showing 20 changed files with 1,441 additions and 360 deletions.
3 changes: 1 addition & 2 deletions SystemReady-band/build-scripts/get_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ get_linux-acs_src()
get_bbr_acs_src()
{
echo "Downloading Arm BBR source code."
#TODO change branch to main
git clone https://github.com/chetan-rathore/bbr-acs-1.git bbr-acs
git clone https://github.com/ARM-software/bbr-acs.git bbr-acs
if [ -n "$ARM_BBR_TAG" ]; then
# TAG provided.
echo "Checking out Arm BBR TAG: $ARM_BBR_TAG"
Expand Down
2 changes: 2 additions & 0 deletions SystemReady-devicetree-band/Yocto/build-scripts/get_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ copy_recipes()
sed -i 's/connect -r//g' startup.nsh
cp $TOP_DIR/../../common/linux_scripts/secure_init.sh $TOP_DIR/meta-woden/recipes-acs/install-files/files
cp $TOP_DIR/../../common/linux_scripts/verify_tpm_measurements.py $TOP_DIR/meta-woden/recipes-acs/install-files/files
cp $TOP_DIR/../../common/linux_scripts/extract_capsule_fw_version.py $TOP_DIR/meta-woden/recipes-acs/install-files/files

cp -r $TOP_DIR/../../common/log_parser $TOP_DIR/meta-woden/recipes-acs/install-files/files/
popd
# copy any patches to linux src files directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://bbr-acs/LICENSE.md;md5=2a944942e1496af1886903d274dedb13"

# TODO
SRC_URI += "git://github.com/chetan-rathore/bbr-acs-1;destsuffix=bbr-acs;protocol=https;branch=main;name=bbr-acs \
SRC_URI += "git://github.com/ARM-software/bbr-acs;destsuffix=bbr-acs;protocol=https;branch=main;name=bbr-acs \
git://github.com/tianocore/edk2-test;destsuffix=edk2-test;protocol=https;nobranch=1;name=edk2-test \
gitsm://github.com/tianocore/edk2.git;destsuffix=edk2-test/edk2;protocol=https;nobranch=1;name=edk2 \
file://sctversion.patch;patch=1;patchdir=edk2-test \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then

#LINUX DEBUG DUMP

echo "Collecting Linux debug logs"
LINUX_DUMP_DIR="/mnt/acs_results/linux_dump"
mkdir -p $LINUX_DUMP_DIR
lspci -vvv &> $LINUX_DUMP_DIR/lspci.log
Expand All @@ -81,7 +82,7 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
fwupdmgr get-history &> $LINUX_DUMP_DIR/fwupd_get_history.log
sync /mnt
sleep 5

echo "Linux debug logs run - Completed"
# FWTS EBBR run

mkdir -p /mnt/acs_results/fwts
Expand All @@ -93,18 +94,23 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
echo -e -n "\n"
sync /mnt
sleep 5
echo "FWTS test execution - Completed"

#LINUX BSA RUN

mkdir -p /mnt/acs_results/linux_acs/bsa_acs_app
echo "Loading BSA ACS Linux Driver"
insmod /lib/modules/*/kernel/bsa_acs/bsa_acs.ko
echo "Executing BSA ACS Application "
echo "SystemReady devicetree band ACS v3.0.0-BETA0" > /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log
bsa >> /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log
dmesg | sed -n 'H; /PE_INFO/h; ${g;p;}' > /mnt/acs_results/linux_acs/bsa_acs_app/BsaResultsKernel.log
sync /mnt
sleep 5
if [ -f /lib/modules/*/kernel/bsa_acs/bsa_acs.ko ]; then
echo "Running Linux BSA tests"
insmod /lib/modules/*/kernel/bsa_acs/bsa_acs.ko
echo "SystemReady devicetree band ACS v3.0.0-BETA0" > /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log
bsa >> /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log
dmesg | sed -n 'H; /PE_INFO/h; ${g;p;}' > /mnt/acs_results/linux_acs/bsa_acs_app/BsaResultsKernel.log
sync /mnt
sleep 5
echo "Linux BSA test execution - Completed"
else
echo "Error: BSA kernel Driver is not found. Linux BSA tests cannot be run"
fi

# Device Driver Info script

Expand Down Expand Up @@ -148,12 +154,14 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then

# Capturing System PSCI command output

echo "Collecting psci command output"
mkdir -p /mnt/acs_results/linux_tools/psci
mount -t debugfs none /sys/kernel/debug
cat /sys/kernel/debug/psci > /mnt/acs_results/linux_tools/psci/psci.log
dmesg | grep psci > /mnt/acs_results/linux_tools/psci/psci_kernel.log
sync /mnt
sleep 5
echo "PSCI command output - Completed"

# DT Kernel Self test run

Expand All @@ -165,10 +173,11 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
popd
sync /mnt
sleep 5
echo "DT Kernel Self test run - Completed"

# ETHTOOL test run

echo "Running Ethtool"
echo "Running Ethtool test"
# update resolv.conf with 8.8.8.8 DNS server
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# run ethtool-test.py, dump ethernet information, run self-tests if supported, and ping
Expand All @@ -177,6 +186,7 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
awk '{gsub(/\x1B\[[0-9;]*[JKmsu]/, "")}1' ethtool-test.log > /mnt/acs_results/linux_tools/ethtool-test.log
sync /mnt
sleep 5
echo "Ethtool test run - Completed"

# READ_WRITE_BLOCK_DEVICE run

Expand All @@ -185,6 +195,7 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
python3 /bin/read_write_check_blk_devices.py | tee /mnt/acs_results/linux_tools/read_write_check_blk_devices.log
sync /mnt
sleep 5
echo "BLK devices read and write check - Completed"

umount /mnt
sleep 5
Expand All @@ -200,16 +211,21 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
cur_fw_ver=$(python3 /usr/bin/extract_capsule_fw_version.py $fw_pattern /mnt/acs_results_template/fw/CapsuleApp_ESRT_table_info_after_update.log)
last_attempted_status=$(python3 /usr/bin/extract_capsule_fw_version.py $fw_status_pattern /mnt/acs_results_template/fw/CapsuleApp_ESRT_table_info_after_update.log)

#echo prev_fw_ver: $prev_fw_ver
#echo cur_fw_ver: $cur_fw_ver
#echo last_attempted_status: $last_attempted_status
fw_status="0x0"
if [ "$((cur_fw_ver))" -gt "$((prev_fw_ver))" ] && [ "$((last_attempted_status))" == "$((fw_status))" ]; then
echo "Capsule update has done successfully from version $prev_fw_ver to $cur_fw_ver"

fw_status="0x0"
echo "Testing ESRT FW version update" >> /mnt/acs_results/app_output/capsule_test_results.log
echo "INFO: prev version: $prev_fw_ver, current version: $cur_fw_ver, last attempted status: $last_attempted_status" >> /mnt/acs_results/app_output/capsule_test_results.log
if [ "$((cur_fw_ver))" -gt "$((prev_fw_ver))" ] && [ "$((last_attempted_status))" == "$((fw_status))" ]; then
echo "RESULTS: PASSED" >> /mnt/acs_results/app_output/capsule_test_results.log
echo "Capsule update has passed"
else
echo "RESULTS: FAILED" >> /mnt/acs_results/app_output/capsule_test_results.log
echo "Capsule update has failed"
fi
rm /mnt/acs_tests/app/capsule_update_done.flag
elif [ -f /mnt/acs_tests/app/capsule_update_unsupport.flag ]; then
echo "Capsule update has failed ..."
echo "Capsule update has failed"
echo "Capsule update has failed ..." >> /mnt/acs_results/app_output/capsule_test_results.log
rm /mnt/acs_tests/app/capsule_update_unsupport.flag
else
echo "Capsule update has ignored..."
Expand Down Expand Up @@ -244,7 +260,9 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
sync /mnt
sleep 5
mkdir /usr/cache_dir
/usr/bin/systemready-scripts/check-sr-results.py --cache-dir=/usr/cache_dir/
mkdir -p /mnt/acs_results/post-script
/usr/bin/systemready-scripts/check-sr-results.py --cache-dir=/usr/cache_dir/ > /mnt/acs_results/post-script/post-script.log 2&>1
cd -
fi
sync /mnt
sleep 5
Expand All @@ -256,12 +274,13 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
if [ -d "/mnt/acs_results/acs_summary" ]; then
rm -r /mnt/acs_results/acs_summary
fi
/usr/bin/log_parser/main_log_parser.sh /mnt/acs_results /mnt/acs_tests/config/acs_config_dt.txt /mnt/acs_tests/config/system_config.txt
/usr/bin/log_parser/main_log_parser.sh /mnt/acs_results /mnt/acs_tests/config/acs_config_dt.txt /mnt/acs_tests/config/system_config.txt /mnt/acs_tests/config/acs_waiver.json
fi
sync /mnt
sleep 5

echo "ACS run is completed"
echo "ACS automated test suites run is completed."
echo "Please reboot to run BBSR tests if not done"
fi
else
echo ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SRC_URI:append = " file://acs_run-before-login-prompt.service \
file://init.sh \
file://secure_init.sh \
file://verify_tpm_measurements.py \
file://extract_capsule_fw_version.py \
file://ethtool-test.py \
file://read_write_check_blk_devices.py \
file://device_driver_info.sh \
Expand All @@ -27,6 +28,7 @@ do_install:append() {
install -m 0770 ${WORKDIR}/../../ebbr-sct/1.0/bbr-acs/bbsr/config/bbsr_fwts_tests.ini ${D}${bindir}
install -m 0644 ${WORKDIR}/acs_run-before-login-prompt.service ${D}${systemd_unitdir}/system
install -m 0770 ${WORKDIR}/verify_tpm_measurements.py ${D}${bindir}
install -m 0770 ${WORKDIR}/extract_capsule_fw_version.py ${D}${bindir}
install -m 0770 ${WORKDIR}/ethtool-test.py ${D}${bindir}
install -m 0770 ${WORKDIR}/read_write_check_blk_devices.py ${D}${bindir}
install -m 0770 ${WORKDIR}/device_driver_info.sh ${D}${bindir}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ CONFIG_NUMA_BALANCING=y
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
Expand Down
6 changes: 3 additions & 3 deletions common/config/acs_config.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ACS version: ACS v24.11_3.0.0
ACS version: ACS v24.11_3.0.0-BET0
SRS version: SRS 3.0
BSA version: BSA v1.0C
SBSA version: SBSA v7.1
SBBR version: BBR v2.0
BBSR version: BBSR v1.2
SBBR version: BBR v2.1
BBSR version: BBSR v1.3
Band: SystemReady band 3.0
8 changes: 4 additions & 4 deletions common/config/acs_config_dt.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ACS version: ACS v24.11_3.0.0
ACS version: ACS v24.11_3.0.0-BET0
SRS version: SRS 3.0
BSA version: BSA v1.0C
BBR version: BBR v2.0
EBBR version: EBBR v2.1.0
BBSR version: BBSR v1.2
BBR version: BBR v2.1
EBBR version: EBBR v2.2.0
BBSR version: BBSR v1.3
Band: SystemReady Devicetree band 3.0
Device Tree Version:v0.4
2 changes: 1 addition & 1 deletion common/config/acs_run_config.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[Settings]
SbsaRunEnabled=1
SbsaRunEnabled=0
50 changes: 39 additions & 11 deletions common/linux_scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
exec sh +m
fi

#linux debug dump

#Linux debug dump

echo "Collecting Linux Debug Dump"
mkdir -p /mnt/acs_results/linux_dump
dmesg > /mnt/acs_results/linux_dump/dmesg.log
lspci > /mnt/acs_results/linux_dump/lspci.log
Expand Down Expand Up @@ -134,82 +137,107 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then
mount -t debugfs none /sys/kernel/debug
cat /sys/kernel/debug/psci > /mnt/acs_results/linux_tools/psci/psci.log
dmesg | grep psci > /mnt/acs_results/linux_tools/psci/psci_kernel.log
sync /mnt
sleep 5
echo "Linux Debug Dump - Completed"

# FWTS (SBBR) Execution

mkdir -p /mnt/acs_results/fwts
#SBBR Execution
echo "Executing FWTS for SBBR"
echo "SystemReady band ACS v3.0.0-BETA0" > /mnt/acs_results/fwts/FWTSResults.log
fwts -r stdout -q --uefi-set-var-multiple=1 --uefi-get-mn-count-multiple=1 --sbbr esrt uefibootpath aest cedt slit srat hmat pcct pdtt bgrt bert einj erst hest sdei nfit iort mpam ibft ras2 >> /mnt/acs_results/fwts/FWTSResults.log
sync /mnt
sleep 5
echo "FWTS Execution - Completed"

sleep 2
# Linux BSA Execution

mkdir -p /mnt/acs_results/linux
echo "Running Linux BSA tests"
if [ -f /lib/modules/bsa_acs.ko ]; then
echo "Running Linux BSA tests"
insmod /lib/modules/bsa_acs.ko
echo "SystemReady band ACS v3.0.0-BETA0" > /mnt/acs_results/linux/BsaResultsApp.log
/bin/bsa >> /mnt/acs_results/linux/BsaResultsApp.log
dmesg | sed -n 'H; /PE_INFO/h; ${g;p;}' > /mnt/acs_results/linux/BsaResultsKernel.log
sync /mnt
sleep 5
echo "Linux BSA test Execution - Completed"
else
echo "Error: BSA kernel Driver is not found. Linux BSA tests cannot be run."
fi

# Linux SBSA Execution

# Read the value of SbsaRunEnabled
if [ -f /mnt/acs_tests/config/acs_run_config.ini ]; then
SbsaRunEnabled=$(grep -E '^SbsaRunEnabled=' "/mnt/acs_tests/config/acs_run_config.ini" | cut -d'=' -f2 || echo "0")
if [ "$SbsaRunEnabled" == "1" ]; then
echo "Running Linux SBSA tests"
if [ -f /lib/modules/sbsa_acs.ko ]; then
insmod /lib/modules/sbsa_acs.ko
echo "Running Linux SBSA tests"
insmod /lib/modules/sbsa_acs.ko
echo "SystemReady band ACS v3.0.0-BETA0" > /mnt/acs_results/linux/SbsaResultsApp.log
/bin/sbsa >> /mnt/acs_results/linux/SbsaResultsApp.log
dmesg | sed -n 'H; /PE_INFO/h; ${g;p;}' > /mnt/acs_results/linux/SbsaResultsKernel.log
sync /mnt
sleep 5
echo "Linux SBSA test Execution - Completed"
else
echo "Error: SBSA kernel Driver is not found. Linux SBSA tests cannot be run."
fi
fi
fi

# EDK2 test parser

if [ -d "/mnt/acs_results/sct_results" ]; then
echo "Running edk2-test-parser tool "
mkdir -p /mnt/acs_results/edk2-test-parser
cd /usr/bin/edk2-test-parser
./parser.py --md /mnt/acs_results/edk2-test-parser/edk2-test-parser.log /mnt/acs_results/sct_results/Overall/Summary.ekl /mnt/acs_results/sct_results/Sequence/SBBR.seq > /dev/null 2>&1
cd -
sleep 3
echo "edk2-test-parser run completed"
sync /mnt
sleep 5
else
echo "SCT result does not exist, cannot run edk2-test-parser tool cannot run"
fi

# Device Driver script run

if [ -f "/mnt/acs_results/uefi_dump/devices.log" ] && [ -f "/mnt/acs_results/uefi_dump/drivers.log" ] && [ -f "/mnt/acs_results/uefi_dump/dh.log" ]; then
echo "Running Device Driver Matching Script"
cd /usr/bin/
./device_driver.sh --md /mnt/acs_results/linux_dump/device_driver.log /mnt/acs_results/uefi_dump/devices.log /mnt/acs_results/uefi_dump/drivers.log /mnt/acs_results/uefi_dump/dh.log > /dev/null 2>&1
cd -
echo "Device Driver script run completed"
sync /mnt
sleep 5
else
echo "Devices/Driver/dh log does not exist, cannot run the script"
fi

# ACS log parser run

echo "Running acs log parser tool "
if [ -d "/mnt/acs_results" ]; then
if [ -d "/mnt/acs_results/acs_summary" ]; then
rm -r /mnt/acs_results/acs_summary
fi
/usr/bin/log_parser/main_log_parser.sh /mnt/acs_results /mnt/acs_tests/config/acs_config.txt /mnt/acs_tests/config/system_config.txt
/usr/bin/log_parser/main_log_parser.sh /mnt/acs_results /mnt/acs_tests/config/acs_config.txt /mnt/acs_tests/config/system_config.txt /mnt/acs_tests/config/acs_waiver.json
sync /mnt
sleep 5
fi
sleep 3

echo "The ACS test suites are completed."
echo "ACS automated test suites run is completed."
echo "Please reboot to run BBSR tests if not done"
else
echo ""
echo "Additional option set to not run ACS Tests. Skipping ACS tests on Linux"
echo ""
fi

sync /mnt
sleep 3
sleep 5

exec sh +m
Loading

0 comments on commit 380ef87

Please sign in to comment.