diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 09:41:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 09:41:28 +0000 |
commit | 76ffd5ce84e4adb412833c8186fc6b26b656947f (patch) | |
tree | 11da7c12c05e9d2a85ec40022d43a970184bb867 /distro/pkg/deb/tests | |
parent | Initial commit. (diff) | |
download | libyang3-76ffd5ce84e4adb412833c8186fc6b26b656947f.tar.xz libyang3-76ffd5ce84e4adb412833c8186fc6b26b656947f.zip |
Adding upstream version 3.1.0.upstream/3.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'distro/pkg/deb/tests')
-rw-r--r-- | distro/pkg/deb/tests/control | 3 | ||||
-rwxr-xr-x | distro/pkg/deb/tests/yanglint | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/distro/pkg/deb/tests/control b/distro/pkg/deb/tests/control new file mode 100644 index 0000000..ca73c4a --- /dev/null +++ b/distro/pkg/deb/tests/control @@ -0,0 +1,3 @@ +Tests: yanglint +Depends: gzip, + libyang-tools diff --git a/distro/pkg/deb/tests/yanglint b/distro/pkg/deb/tests/yanglint new file mode 100755 index 0000000..30719e0 --- /dev/null +++ b/distro/pkg/deb/tests/yanglint @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +# Setup the test file +trap 'rm -f "${TESTFILE}"; rmdir "${TESTDIR}"' EXIT +TESTDIR=$(mktemp -d /tmp/yanglint.XXXXXX) +TESTFILE="${TESTDIR}/ietf-interfaces.yang" + +# Unpack or copy the test file +if test -f /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz; then + gunzip -c < /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz > "${TESTFILE}" +else + cp /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang "${TESTFILE}" +fi + +# Lint the test file +yanglint "${TESTFILE}" |