summaryrefslogtreecommitdiffstats
path: root/distro/pkg/deb/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-23 09:41:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-23 09:41:28 +0000
commit76ffd5ce84e4adb412833c8186fc6b26b656947f (patch)
tree11da7c12c05e9d2a85ec40022d43a970184bb867 /distro/pkg/deb/tests
parentInitial commit. (diff)
downloadlibyang3-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/control3
-rwxr-xr-xdistro/pkg/deb/tests/yanglint18
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}"