blob: 30719e08a84f9117c875e9c00967088e036e4f69 [file] [log] [blame]
Ondřej Surý748c8e52021-05-07 18:56:31 +02001#!/bin/sh
2
3set -e
Ondřej Surýa531aef2021-12-12 21:42:05 +01004
5# Setup the test file
6trap 'rm -f "${TESTFILE}"; rmdir "${TESTDIR}"' EXIT
7TESTDIR=$(mktemp -d /tmp/yanglint.XXXXXX)
8TESTFILE="${TESTDIR}/ietf-interfaces.yang"
9
10# Unpack or copy the test file
Michal Vasko71d0ca92024-02-26 15:14:52 +010011if test -f /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz; then
12 gunzip -c < /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz > "${TESTFILE}"
Ondřej Surý748c8e52021-05-07 18:56:31 +020013else
Michal Vasko71d0ca92024-02-26 15:14:52 +010014 cp /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang "${TESTFILE}"
Ondřej Surý748c8e52021-05-07 18:56:31 +020015fi
Ondřej Surýa531aef2021-12-12 21:42:05 +010016
17# Lint the test file
18yanglint "${TESTFILE}"