You also need to install YANG schemas, so the unit-tests are able to
retrieve, add, update and generally interact with the sysrepo information.
There are several production Kea models (src/share/yang/modules/kea*.yang)
-and one test specific model (src/share/yang/modules/keatest-module*.yang).
+and one test specific model (src/share/yang/modules/keatest-module*.yang)
+which is only required if you want to run Kea unit tests, i.e. it is not
+used in production.
To install the test module, issue the following command:
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# Check hashes:
+# Check hashes
+#
+# This developer script verifies recorded hashes still match the
+# result of SHA-256 checksums of the YIN format.
+# Requires yanglint to translate YANG to YIN formats and openssl
+# for a system independent SHA-256.
+error=0
for m in *.yang
do
hash1=`yanglint -f yin $m | openssl dgst -sha256 | sed 's/(stdin)= //'`
hash2=`cat $h`
if test $hash1 != $hash2
then
+ error=1
echo hash mismatch on $m expected $hash1 in $h
fi
else
+ error=1
echo missing hash file $h for $m
fi
done
+exit $error
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# Check revisions:
+# Check revisions
+#
+# This developer script verifies versions in module contents match
+# the version in the name.
+# Requires yanglint to translate YANG to YIN formats.
+# Fixme: use xlstproc to extract the revision.
+error=0
for m in *.yang
do
rev1=`yanglint -f yin $m | grep '<revision date=' | head -1 | sed \
if test $rev1 != $rev2
then
+ error=1
echo revision mismatch on $m got $rev1
fi
done
+exit $error
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# Build module / revision table:
+# Build module / revision table
+#
+# This developer script builds the module / revision table, i.e. fill
+# the content of the src/lib/yang/yang_revisions.h as explained in
+# src/lib/yang/yang_revisions.h.skel
+# The keatest-module entry is enabled only when KEATEST_MODULE is defined.
test=keatest-module*.yang
last=kea-dhcp-ddns*.yang