#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: Check operatingSystem and operatingSystemVersion of ldap/hostdn
## roles-not: [basesystem]
## tags:
##  - basic
##  - apptest
## exposure: safe

# shellcheck source=../../lib/base.sh
. "$TESTLIBPATH/base.sh" || exit 137

os="$(univention-ldapsearch -b "$ldap_hostdn" -s base -LLL univentionOperatingSystem | sed -ne 's|univentionOperatingSystem: ||p')"
if [ "$os" != "Univention Corporate Server" ]; then
	fail_test 110 "univentionOperatingSystem is set to $os"
fi
ovs="$(univention-ldapsearch -b "$ldap_hostdn" -s base -LLL univentionOperatingSystemVersion | sed -ne 's|univentionOperatingSystemVersion: ||p')"
if [ "$ovs" != "$version_version-$version_patchlevel" ]; then
	fail_test 110 "univentionOperatingSystemVersion is set to $ovs"
fi

exit "$RETVAL"
