[NETCONF-707] Netconf TestTool: Validation for invalid file in "schemas-dir" argument Created: 28/Jun/20  Updated: 28/Mar/22  Resolved: 21/Mar/22

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: 3.0.0, 2.0.15

Type: Bug Priority: Low
Reporter: Nikhil Soni Assignee: Oleksandr Zharov
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Microsoft Word [NETCONF-707] Steps to reproduce.docx     Text File [NETCONF-707] log.txt.txt    

 Description   

Netconf-testtool supports "schemas-dir" argument in java command line.

If the schema directory contains a file which is not readable as text then it throws "MissingSchemaSourceException: All available providers exhausted".

The exception is misleading, it should be thrown in existing validate method.

In Yang tool library, it takes only Yang type file in class FilesystemSchemaSourceCache.findFileWithNewestRev(), so condition for file type ".yang" can be added in TesttoolParameters class' validation method .



 Comments   
Comment by Robert Varga [ 01/Dec/21 ]

Alright, so the outstanding patch has a number of comments which were not addressed. It needs to be rebased and the comments addressed.

Once that happens we should be okay, I think.

Comment by Ivan Hrasko [ 02/Mar/22 ]

IMO:

1. its clear that schemadir is for yang files - testool is just tool used by devs - not a production product that needs to be prepared for situations like this

2. testtool has no possibility to verify if yang files are correct or form complete schema context - that is the work for yangtools

3. if you really want you can reject not .yang extension files - but that is not 100% fail-proof

4. if the problem is the misleading exception - you can catch exception from yangtools and tell the user of testool that something is wrong in his schemadir files.

 

Generated at Wed Feb 07 20:15:41 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.