Skip to content

Commit 105f4c6

Browse files
authored
yanglint UPDATE extension validation (#2413)
Examples included.
1 parent 0358e37 commit 105f4c6

File tree

13 files changed

+840
-99
lines changed

13 files changed

+840
-99
lines changed

tests/yanglint/interactive/data_operational.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
22

33
set ddir "$::env(TESTS_DIR)/data"
4-
set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notification input data types"
4+
set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notification/Extensions input data types"
55

66
test data_operational_twice {it is not allowed to specify more than one --operational parameter} {
77
-setup $ly_setup -cleanup $ly_cleanup -body {

tests/yanglint/non-interactive/data_operational.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/
22

33
set mdir "$::env(YANG_MODULES_DIR)"
44
set ddir "$::env(TESTS_DIR)/data"
5-
set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notification input data types"
5+
set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notification/Extensions input data types"
66

77
test data_operational_twice {it is not allowed to specify more than one --operational parameter} {
88
ly_cmd_err "-t notif -O $ddir/modconfig.xml -O $ddir/modleaf.xml" "cannot be set multiple times"

tools/lint/cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ COMMAND commands[] = {
7070
},
7171
{
7272
"data", cmd_data_opt, cmd_data_dep, cmd_data_store, cmd_data_process, cmd_data_help, NULL,
73-
"Load, validate and optionally print instance data", "d:ef:F:hmo:O:R:r:nt:x:"
73+
"Load, validate and optionally print instance data", "d:ef:F:hmo:O:R:r:nt:x:k:"
7474
},
7575
{
7676
"list", cmd_list_opt, cmd_list_dep, cmd_list_exec, NULL, cmd_list_help, NULL,

tools/lint/cmd.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,15 @@ int cmd_debug_dep(struct yl_opt *yo, int posc);
381381
*/
382382
int cmd_debug_store(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv);
383383

384+
/**
385+
* @brief Store the values: mod_name, name, argument of extension.
386+
*
387+
* @param[in] extension_id String in format "<module-name>:<extension-name>:<argument>".
388+
* @param[in,out] yo Options for yanglint.
389+
* @return 0 on success.
390+
*/
391+
int parse_ext_string(const char *extension_id, struct yl_opt *yo);
392+
384393
/**
385394
* @brief Set debug logging.
386395
*

0 commit comments

Comments
 (0)