Commit bb9bd229 authored by Vitaly Lipatov's avatar Vitaly Lipatov

tests: add os-release tests

parent ac5bafc1
NAME="Fedora Linux"
VERSION="37 (Workstation Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
SUPPORT_END=2023-11-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation
NAME="M OC"
VERSION="MOS p10"
ID=mos
ID_LIKE=altlinux
VERSION_ID=10
PRETTY_NAME="MOS 830"
ANSI_COLOR="1;33"
CPE_NAME="cpe:/o:alt:mos:p10"
LOGO=mos
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
......@@ -6,15 +6,17 @@ WRITE=''
for ROOTDIR in $(ls -1d etc/*) ; do
export ROOTDIR
e=$(../bin/distr_info -e)
s=$(../bin/distr_info -s)
idstr="$e $s"
if [ -n "$WRITE" ] ; then
echo "$e" > $ROOTDIR/etalon.txt
echo "$idstr" > $ROOTDIR/etalon.txt
continue
fi
le="$(cat $ROOTDIR/etalon.txt 2>/dev/null)"
if [ "$le" = "$e" ] ; then
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$e" "OK"
if [ "$le" = "$idstr" ] ; then
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$idstr" "OK"
else
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$e" "FAIL (expect $le)"
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$idstr" "FAIL (expect $le)"
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment