summaryrefslogtreecommitdiffstats
path: root/debian/tests/yanglint
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:55:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:55:11 +0000
commit8712cf23f0ebf5323f546a6b6363a27d12461b2d (patch)
treeaa6828b07e325da484988c86c36cba4e78a10629 /debian/tests/yanglint
parentAdding upstream version 2.1.30. (diff)
downloadlibyang2-debian.tar.xz
libyang2-debian.zip
Adding debian version 2.1.30-2.debian/2.1.30-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/yanglint18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/tests/yanglint b/debian/tests/yanglint
new file mode 100755
index 0000000..eda5573
--- /dev/null
+++ b/debian/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/libyang2-tools/examples/ietf-interfaces.yang.gz; then
+ gunzip -c < /usr/share/doc/libyang2-tools/examples/ietf-interfaces.yang.gz > "${TESTFILE}"
+else
+ cp /usr/share/doc/libyang2-tools/examples/ietf-interfaces.yang "${TESTFILE}"
+fi
+
+# Lint the test file
+yanglint "${TESTFILE}"