Validate cross-revision imports and includes 97/97697/11
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 1 Oct 2021 13:37:27 +0000 (15:37 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Oct 2021 12:06:14 +0000 (14:06 +0200)
commit15c24aad3f6bca0a832dfe4c28f7eb3f203e436c
tree99e308fcc933137eef8cb99f1ac90fa6c2e8125d
parent193ddc623a77c9cf2b986a07ede9a42451a63122
Validate cross-revision imports and includes

We are not performing no YANG version validation during include/import
linkage. RFC7950 section 12 specifically forbids a number of cases which
are invalid. Make sure we are enforcing them.

This flushes out a few violations in our test suite, which is also
updated.

JIRA: YANGTOOLS-1339
Change-Id: I7799f08291f9ffc9646b19922af512e28a2c7589
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
35 files changed:
model/yang-model-export/src/test/resources/bugs/bug2444/yang/submodule.yang
model/yang-model-export/src/test/resources/bugs/bug2444/yin/submodule.yin
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/bar.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/baz.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/foo-invalid-1.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/foo-invalid-2.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/foo-invalid-3.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/foo.yang
parser/rfc8040-parser-support/src/test/resources/yang-data-extension-test/foobar.yang
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/impl/YT1193Test.java
parser/yang-parser-impl/src/test/resources/yt1193/baz.yang
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/import_/ImportStatementSupport.java
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/meta/IncludeStatementSupport.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1339Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1262/bar.yang
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-norev/new.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-norev/old.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-norev/sub.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-rev-sub/new.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-rev-sub/old.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-rev-sub/sub.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-rev/new.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import-rev/old.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import/new.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import/old.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/import/sub.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/new-sub/mod.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/new-sub/sub.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/old-sub/mod.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1339/old-sub/sub.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/bug7480/files/foo.yang
parser/yang-parser-rfc7950/src/test/resources/bugs/bug7480/lib/lib-1.yang
parser/yang-parser-rfc7950/src/test/resources/deviation-resolution-test/deviation-replace/foo.yang
parser/yang-parser-rfc7950/src/test/resources/rfc7950/include-import-stmt-test/invalid-import-10/import-test-root.yang
parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/YangVersionLinkageException.java [new file with mode: 0644]