Ondřej Surý | 748c8e5 | 2021-05-07 18:56:31 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
Ondřej Surý | a531aef | 2021-12-12 21:42:05 +0100 | [diff] [blame] | 4 | |
| 5 | # Setup the test file |
| 6 | trap 'rm -f "${TESTFILE}"; rmdir "${TESTDIR}"' EXIT |
| 7 | TESTDIR=$(mktemp -d /tmp/yanglint.XXXXXX) |
| 8 | TESTFILE="${TESTDIR}/ietf-interfaces.yang" |
| 9 | |
| 10 | # Unpack or copy the test file |
Michal Vasko | 71d0ca9 | 2024-02-26 15:14:52 +0100 | [diff] [blame] | 11 | if 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ý | 748c8e5 | 2021-05-07 18:56:31 +0200 | [diff] [blame] | 13 | else |
Michal Vasko | 71d0ca9 | 2024-02-26 15:14:52 +0100 | [diff] [blame] | 14 | cp /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang "${TESTFILE}" |
Ondřej Surý | 748c8e5 | 2021-05-07 18:56:31 +0200 | [diff] [blame] | 15 | fi |
Ondřej Surý | a531aef | 2021-12-12 21:42:05 +0100 | [diff] [blame] | 16 | |
| 17 | # Lint the test file |
| 18 | yanglint "${TESTFILE}" |