librtas/activate-firmware-regress
Michal Suchanek 6320ffa20b Accepting request 1136886 from home:michals
- Add support for new rtas kernel interface for VPD and sysparm (jsc#PED-4541).
  * 0001-librtas-expose-low-level-RTAS-call-APIs-internally.patch
  * 0002-librtas-move-VPD-code-into-separate-module.patch
  * 0003-librtas-move-system-parameter-code-to-separate-modul.patch
  * 0004-librtas-vendor-papr-miscdev.h.patch
  * 0005-librtas-vpd-prefer-dev-papr-vpd-when-available.patch
  * 0006-librtas-sysparm-prefer-dev-papr-sysparm-when-availab.patch
  * link-lpthread.patch
  * tests: activate-firmware-regress vpdupdate-regress

OBS-URL: https://build.opensuse.org/request/show/1136886
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/librtas?expand=0&rev=67
2024-01-04 16:53:48 +00:00

119 lines
2.7 KiB
Bash

#!/bin/bash
# Created by argbash-init v2.10.0
# ARG_OPTIONAL_SINGLE([old],[],[old librtas DSO],[/lib64/librtas.so.2])
# ARG_OPTIONAL_SINGLE([new],[],[new librtas DSO],[$PWD/.libs/librtas.so.2])
# ARG_HELP([Test the activate_firmware command against a development build of librtas])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.10.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, see https://argbash.io for more info
die()
{
local _ret="${2:-1}"
test "${_PRINT_HELP:-no}" = yes && print_help >&2
echo "$1" >&2
exit "${_ret}"
}
begins_with_short_option()
{
local first_option all_short_options='h'
first_option="${1:0:1}"
test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0
}
# THE DEFAULTS INITIALIZATION - OPTIONALS
_arg_old="/lib64/librtas.so.2"
_arg_new="$PWD/.libs/librtas.so.2"
print_help()
{
printf '%s\n' "Test the activate_firmware command against a development build of librtas"
printf 'Usage: %s [--old <arg>] [--new <arg>] [-h|--help]\n' "$0"
printf '\t%s\n' "--old: old librtas DSO (default: '/lib64/librtas.so.2')"
printf '\t%s\n' "--new: new librtas DSO (default: '$PWD/.libs/librtas.so.2')"
printf '\t%s\n' "-h, --help: Prints help"
}
parse_commandline()
{
while test $# -gt 0
do
_key="$1"
case "$_key" in
--old)
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_old="$2"
shift
;;
--old=*)
_arg_old="${_key##--old=}"
;;
--new)
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_new="$2"
shift
;;
--new=*)
_arg_new="${_key##--new=}"
;;
-h|--help)
print_help
exit 0
;;
-h*)
print_help
exit 0
;;
*)
_PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1
;;
esac
shift
done
}
parse_commandline "$@"
# OTHER STUFF GENERATED BY Argbash
### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash
set -eu
set -o pipefail
workdir="$(mktemp -d)"
uak_old="${workdir}/uak.old"
uak_new="${workdir}/uak.new"
preload_sanitizers=/lib64/libasan.so.8:/lib64/libubsan.so.1
export LD_PRELOAD="${preload_sanitizers}":"$_arg_old"
activate_firmware -e > "$uak_old"
export LD_PRELOAD="${preload_sanitizers}":"$_arg_new"
activate_firmware -e > "$uak_new"
export -n LSAN_OPTIONS ASAN_OPTIONS LD_PRELOAD
cmp "$uak_old" "$uak_new" || {
echo "error: Update Access Key information differs"
diff -u "$uak_old" "$uak_new"
exit 1
}
echo "Tested $(type -P activate_firmware) with ${_arg_old} and ${_arg_new}, no differences detected."
test -d "$workdir" && rm -fr "$workdir"
# ] <-- needed because of Argbash