Closed danikova closed 3 years ago
Okay, should be fixed now.
Hi, i checked out to the devel branch to give it a try, and if i am not wrong, the error is still exists.
$ yanglint --version: yanglint SO 1.9.20
$yanglint -s -t auto must-error.yang must-error.xml: err : Must condition "not((../../../ranges/range[min > current()]/min) <= current()/../max)" not satisfied. (/must-error:ranges/range[min='10']/min) err : The ranges element cannot overlap another range. (/must-error:ranges/range[min='10']/min)
Just tested with the exact same command and the files you provided here, it works fine. Please provide similar output to the following.
# ldconfig -p | grep libyang
libyang.so.1 (libc6,x86-64) => /usr/local/lib64/libyang.so.1
libyang.so (libc6,x86-64) => /usr/local/lib64/libyang.so
# ls -l /usr/local/lib64/ | grep libyang
lrwxrwxrwx 1 root root 12 nov 26 10:52 libyang.so -> libyang.so.1
lrwxrwxrwx 1 root root 17 nov 30 18:47 libyang.so.1 -> libyang.so.1.9.20
-rwxr-xr-x 1 root root 2411720 nov 30 09:25 libyang.so.1.9.19
-rwxr-xr-x 1 root root 2411496 nov 30 18:42 libyang.so.1.9.20
drwxr-xr-x 4 root root 4096 nov 26 10:47 libyang1
I got too many links, according to ldconfig, so i did a major clean up and make install
, now it's working fine.
Thanks for your help.
I am using yanglint version 1.9.2.
Yanglint incorrectly enforces must condition in this case.
must-error.yang to reproduce the error:
must-error.xml to reproduce the issue:
The used validation command:
yanglint -s -t auto must-error.yang must-error.xml
This results in the following error, which is not correct:err : Must condition "not((../../../ranges/range[min > current()]/min) <= current()/../max)" not satisfied. (/must-error:ranges/range[min='10']/min) err : The ranges element cannot overlap another range. (/must-error:ranges/range[min='10']/min)
Pyang/yang2dsdl accepts this xml as valid.
The must condition is right, because when i'm introduce a new range which is overlap the another range, yang2dsdl throw an error too.
updated must-error.xml:
Pyang/yang2dsdl output:
Thanks, Dani