blob: eda5573fcb535418158e41371f6093c5cd6b0790 [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
11if test -f /usr/share/doc/libyang2-tools/examples/ietf-interfaces.yang.gz; then
12 gunzip -c < /usr/share/doc/libyang2-tools/examples/ietf-interfaces.yang.gz > "${TESTFILE}"
Ondřej Surý748c8e52021-05-07 18:56:31 +020013else
Ondřej Surýa531aef2021-12-12 21:42:05 +010014 cp /usr/share/doc/libyang2-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}"