mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-05 13:43:06 +00:00
tests: static checker: Add announce message
Added an announcement message to the `static-checks.sh` script. It runs platform / architecture specific code so it would be useful to display details of the platform the checker is running on to help with debugging. Fixes: #9258. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
4af4a8ad2b
commit
577abd014b
@ -1404,6 +1404,56 @@ setup()
|
|||||||
trap remove_tmp_files EXIT
|
trap remove_tmp_files EXIT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Display a message showing some system details.
|
||||||
|
announce()
|
||||||
|
{
|
||||||
|
local arch
|
||||||
|
arch=$(uname -m)
|
||||||
|
|
||||||
|
local file='/proc/cpuinfo'
|
||||||
|
|
||||||
|
local detail
|
||||||
|
detail=$(grep -m 1 -E '\<vendor_id\>|\<cpu\> * *:' "$file" \
|
||||||
|
2>/dev/null |\
|
||||||
|
cut -d: -f2- |\
|
||||||
|
tr -d ' ' || true)
|
||||||
|
|
||||||
|
local arch="$arch"
|
||||||
|
|
||||||
|
[ -n "$detail" ] && arch+=" ('$detail')"
|
||||||
|
|
||||||
|
local kernel
|
||||||
|
kernel=$(uname -r)
|
||||||
|
|
||||||
|
local distro_name
|
||||||
|
local distro_version
|
||||||
|
|
||||||
|
distro_name="${NAME:-}"
|
||||||
|
distro_version="${VERSION:-}"
|
||||||
|
|
||||||
|
local -a lines
|
||||||
|
|
||||||
|
local IFS=$'\n'
|
||||||
|
|
||||||
|
lines=( $(cat <<-EOF
|
||||||
|
Running static checks:
|
||||||
|
script: $script_name
|
||||||
|
architecture: $arch
|
||||||
|
kernel: $kernel
|
||||||
|
distro:
|
||||||
|
name: $distro_name
|
||||||
|
version: $distro_version
|
||||||
|
EOF
|
||||||
|
))
|
||||||
|
|
||||||
|
local line
|
||||||
|
|
||||||
|
for line in "${lines[@]}"
|
||||||
|
do
|
||||||
|
info "$line"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
setup
|
setup
|
||||||
@ -1482,6 +1532,8 @@ main()
|
|||||||
|
|
||||||
repo_path=$GOPATH/src/$repo
|
repo_path=$GOPATH/src/$repo
|
||||||
|
|
||||||
|
announce
|
||||||
|
|
||||||
local all_check_funcs=$(typeset -F|awk '{print $3}'|grep "${check_func_regex}"|sort)
|
local all_check_funcs=$(typeset -F|awk '{print $3}'|grep "${check_func_regex}"|sort)
|
||||||
|
|
||||||
# Run user-specified check and quit
|
# Run user-specified check and quit
|
||||||
|
Loading…
Reference in New Issue
Block a user