Skip to content

Commit ab23d01

Browse files
author
roman
committed
plugins extension REFACTOR add a dash to ext IDs
1 parent 1f6ac6d commit ab23d01

File tree

11 files changed

+41
-41
lines changed

11 files changed

+41
-41
lines changed

src/plugins_exts/metadata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const struct lyplg_ext_record plugins_metadata[] = {
257257
.revision = "2016-08-05",
258258
.name = "annotation",
259259

260-
.plugin.id = "ly2 metadata",
260+
.plugin.id = "ly2 - metadata",
261261
.plugin.parse = annotation_parse,
262262
.plugin.compile = annotation_compile,
263263
.plugin.printer_info = annotation_printer_info,

src/plugins_exts/nacm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const struct lyplg_ext_record plugins_nacm[] = {
173173
.revision = "2012-02-22",
174174
.name = "default-deny-write",
175175

176-
.plugin.id = "ly2 NACM",
176+
.plugin.id = "ly2 - NACM",
177177
.plugin.parse = nacm_parse,
178178
.plugin.compile = nacm_compile,
179179
.plugin.printer_info = NULL,
@@ -191,7 +191,7 @@ const struct lyplg_ext_record plugins_nacm[] = {
191191
.revision = "2018-02-14",
192192
.name = "default-deny-write",
193193

194-
.plugin.id = "ly2 NACM",
194+
.plugin.id = "ly2 - NACM",
195195
.plugin.parse = nacm_parse,
196196
.plugin.compile = nacm_compile,
197197
.plugin.printer_info = NULL,
@@ -209,7 +209,7 @@ const struct lyplg_ext_record plugins_nacm[] = {
209209
.revision = "2012-02-22",
210210
.name = "default-deny-all",
211211

212-
.plugin.id = "ly2 NACM",
212+
.plugin.id = "ly2 - NACM",
213213
.plugin.parse = nacm_parse,
214214
.plugin.compile = nacm_compile,
215215
.plugin.printer_info = NULL,
@@ -227,7 +227,7 @@ const struct lyplg_ext_record plugins_nacm[] = {
227227
.revision = "2018-02-14",
228228
.name = "default-deny-all",
229229

230-
.plugin.id = "ly2 NACM",
230+
.plugin.id = "ly2 - NACM",
231231
.plugin.parse = nacm_parse,
232232
.plugin.compile = nacm_compile,
233233
.plugin.printer_info = NULL,

src/plugins_exts/schema_mount.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ const struct lyplg_ext_record plugins_schema_mount[] = {
14221422
.revision = "2019-01-14",
14231423
.name = "mount-point",
14241424

1425-
.plugin.id = "ly2 schema mount",
1425+
.plugin.id = "ly2 - schema mount",
14261426
.plugin.parse = schema_mount_parse,
14271427
.plugin.compile = schema_mount_compile,
14281428
.plugin.printer_info = NULL,

src/plugins_exts/structure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ const struct lyplg_ext_record plugins_structure[] = {
562562
.revision = "2020-06-17",
563563
.name = "structure",
564564

565-
.plugin.id = "ly2 structure",
565+
.plugin.id = "ly2 - structure",
566566
.plugin.parse = structure_parse,
567567
.plugin.compile = structure_compile,
568568
.plugin.printer_info = structure_printer_info,
@@ -581,7 +581,7 @@ const struct lyplg_ext_record plugins_structure[] = {
581581
.revision = "2020-06-17",
582582
.name = "augment-structure",
583583

584-
.plugin.id = "ly2 structure",
584+
.plugin.id = "ly2 - structure",
585585
.plugin.parse = structure_aug_parse,
586586
.plugin.compile = NULL,
587587
.plugin.printer_info = NULL,

src/plugins_exts/yangdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ const struct lyplg_ext_record plugins_yangdata[] = {
278278
.revision = "2017-01-26",
279279
.name = "yang-data",
280280

281-
.plugin.id = "ly2 yang-data",
281+
.plugin.id = "ly2 - yang-data",
282282
.plugin.parse = yangdata_parse,
283283
.plugin.compile = yangdata_compile,
284284
.plugin.printer_info = yangdata_printer_info,

src/tree_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ lyd_get_meta_annotation(const struct lys_module *mod, const char *name, size_t n
13291329

13301330
LY_ARRAY_FOR(mod->compiled->exts, u) {
13311331
plugin = mod->compiled->exts[u].def->plugin;
1332-
if (plugin && !strncmp(plugin->id, "ly2 metadata", 12) &&
1332+
if (plugin && !strncmp(plugin->id, "ly2 - metadata", 12) &&
13331333
!ly_strncmp(mod->compiled->exts[u].argument, name, name_len)) {
13341334
return &mod->compiled->exts[u];
13351335
}

tests/utests/extensions/test_metadata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test_yang(void **state)
5252
"import ietf-yang-metadata {prefix md;}"
5353
"md:annotation aa;}";
5454
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
55-
CHECK_LOG_CTX("Ext plugin \"ly2 metadata\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
55+
CHECK_LOG_CTX("Ext plugin \"ly2 - metadata\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
5656
"/aa:{extension='md:annotation'}/aa", 0);
5757

5858
/* not allowed substatement */
@@ -89,7 +89,7 @@ test_yang(void **state)
8989
"import ietf-yang-metadata {prefix md;}"
9090
"md:annotation aa {type string;} md:annotation aa {type uint8;}}";
9191
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
92-
CHECK_LOG_CTX("Ext plugin \"ly2 metadata\": Extension md:annotation is instantiated multiple times.",
92+
CHECK_LOG_CTX("Ext plugin \"ly2 - metadata\": Extension md:annotation is instantiated multiple times.",
9393
"/aa:{extension='md:annotation'}/aa", 0);
9494
}
9595

@@ -130,7 +130,7 @@ test_yin(void **state)
130130
"<md:annotation name=\"aa\"/>\n"
131131
"</module>";
132132
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
133-
CHECK_LOG_CTX("Ext plugin \"ly2 metadata\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
133+
CHECK_LOG_CTX("Ext plugin \"ly2 - metadata\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
134134
"/aa:{extension='md:annotation'}/aa", 0);
135135

136136
/* not allowed substatement */
@@ -189,7 +189,7 @@ test_yin(void **state)
189189
" <type name=\"uint8\"/>\n"
190190
"</md:annotation></module>";
191191
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
192-
CHECK_LOG_CTX("Ext plugin \"ly2 metadata\": Extension md:annotation is instantiated multiple times.",
192+
CHECK_LOG_CTX("Ext plugin \"ly2 - metadata\": Extension md:annotation is instantiated multiple times.",
193193
"/aa:{extension='md:annotation'}/aa", 0);
194194
}
195195

tests/utests/extensions/test_nacm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test_deny_all(void **state)
5656
"import ietf-netconf-acm {revision-date 2018-02-14; prefix nacm;}"
5757
"nacm:default-deny-all;}";
5858
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
59-
CHECK_LOG_CTX("Ext plugin \"ly2 NACM\": "
59+
CHECK_LOG_CTX("Ext plugin \"ly2 - NACM\": "
6060
"Extension nacm:default-deny-all is allowed only in a data nodes, but it is placed in \"module\" statement.",
6161
"/b:{extension='nacm:default-deny-all'}", 0);
6262

@@ -65,7 +65,7 @@ test_deny_all(void **state)
6565
"import ietf-netconf-acm {revision-date 2018-02-14; prefix nacm;}"
6666
"leaf l { type string; nacm:default-deny-all; nacm:default-deny-write;}}";
6767
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
68-
CHECK_LOG_CTX("Ext plugin \"ly2 NACM\": "
68+
CHECK_LOG_CTX("Ext plugin \"ly2 - NACM\": "
6969
"Extension nacm:default-deny-write is mixed with nacm:default-deny-all.",
7070
"/aa:l/{extension='nacm:default-deny-all'}", 0);
7171
}
@@ -98,7 +98,7 @@ test_deny_write(void **state)
9898
"import ietf-netconf-acm {revision-date 2018-02-14; prefix nacm;}"
9999
"notification notif {nacm:default-deny-write;}}";
100100
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
101-
CHECK_LOG_CTX("Ext plugin \"ly2 NACM\": "
101+
CHECK_LOG_CTX("Ext plugin \"ly2 - NACM\": "
102102
"Extension nacm:default-deny-write is not allowed in notification statement.",
103103
"/b:notif/{extension='nacm:default-deny-write'}", 0);
104104

@@ -107,7 +107,7 @@ test_deny_write(void **state)
107107
"import ietf-netconf-acm {revision-date 2018-02-14; prefix nacm;}"
108108
"leaf l { type string; nacm:default-deny-write; nacm:default-deny-write;}}";
109109
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
110-
CHECK_LOG_CTX("Ext plugin \"ly2 NACM\": "
110+
CHECK_LOG_CTX("Ext plugin \"ly2 - NACM\": "
111111
"Extension nacm:default-deny-write is instantiated multiple times.",
112112
"/aa:l/{extension='nacm:default-deny-write'}", 0);
113113
}

tests/utests/extensions/test_schema_mount.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test_schema(void **state)
7373
" }\n"
7474
"}\n";
7575
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
76-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
76+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
7777
"Extension \"yangmnt:mount-point\" instance not allowed in YANG version 1 module.",
7878
"/sm:root/{extension='yangmnt:mount-point'}/root", 0);
7979

@@ -90,7 +90,7 @@ test_schema(void **state)
9090
" yangmnt:mount-point \"root\";\n"
9191
"}\n";
9292
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
93-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
93+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
9494
"Extension \"yangmnt:mount-point\" instance allowed only in container or list statement.",
9595
"/sm:{extension='yangmnt:mount-point'}/root", 0);
9696

@@ -112,7 +112,7 @@ test_schema(void **state)
112112
" }\n"
113113
"}\n";
114114
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
115-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
115+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
116116
"Extension \"yangmnt:mount-point\" instance allowed only in container or list statement.",
117117
"/sm:root/l/{extension='yangmnt:mount-point'}/root", 0);
118118

@@ -136,7 +136,7 @@ test_schema(void **state)
136136
" }\n"
137137
"}\n";
138138
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
139-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
139+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
140140
"Multiple extension \"yangmnt:mount-point\" instances.",
141141
"/sm:l/{extension='yangmnt:mount-point'}/root", 0);
142142

@@ -196,7 +196,7 @@ test_parse_invalid(void **state)
196196
" </unknown>"
197197
"</root>";
198198
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EINVAL, data);
199-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Failed to get extension data, no callback set.",
199+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Failed to get extension data, no callback set.",
200200
NULL, 0);
201201

202202
json =
@@ -213,7 +213,7 @@ test_parse_invalid(void **state)
213213
" }"
214214
"}";
215215
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EINVAL, data);
216-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Failed to get extension data, no callback set.",
216+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Failed to get extension data, no callback set.",
217217
NULL, 0);
218218

219219
/* unknown data */
@@ -401,22 +401,22 @@ test_parse_invalid(void **state)
401401
" </mount-point>"
402402
"</schema-mounts>");
403403
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
404-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Mandatory node \"type\" instance does not exist.",
404+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Mandatory node \"type\" instance does not exist.",
405405
"/ietf-interfaces:interfaces/interface[name='bu']", 0);
406406
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
407-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Mandatory node \"type\" instance does not exist.",
407+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Mandatory node \"type\" instance does not exist.",
408408
"/ietf-interfaces:interfaces/interface[name='bu']", 0);
409409

410410
/* same validation fail in separate validation */
411411
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT | LYD_PARSE_ONLY, 0, LY_SUCCESS, data);
412412
assert_int_equal(LY_EVALID, lyd_validate_all(&data, NULL, LYD_VALIDATE_PRESENT, NULL));
413-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Mandatory node \"type\" instance does not exist.",
413+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Mandatory node \"type\" instance does not exist.",
414414
"/ietf-interfaces:interfaces/interface[name='bu']", 0);
415415
lyd_free_siblings(data);
416416

417417
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT | LYD_PARSE_ONLY, 0, LY_SUCCESS, data);
418418
assert_int_equal(LY_EVALID, lyd_validate_all(&data, NULL, LYD_VALIDATE_PRESENT, NULL));
419-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": Mandatory node \"type\" instance does not exist.",
419+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": Mandatory node \"type\" instance does not exist.",
420420
"/ietf-interfaces:interfaces/interface[name='bu']", 0);
421421
lyd_free_siblings(data);
422422

@@ -865,7 +865,7 @@ test_parse_shared(void **state)
865865
" </interfaces-state>\n"
866866
"</root2>\n";
867867
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
868-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
868+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
869869
"Shared-schema yang-library content-id \"2\" differs from \"1\" used previously.",
870870
"/ietf-yang-library:yang-library/content-id", 0);
871871

@@ -1121,7 +1121,7 @@ test_parse_shared_parent_ref(void **state)
11211121
"</root3>\n"
11221122
"<target xmlns=\"urn:sm\">wrong-target-value</target>\n";
11231123
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
1124-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
1124+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
11251125
"Invalid leafref value \"target-value\" - no target instance \"/sm:target\" with the same value.",
11261126
"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name", 0);
11271127

@@ -1146,7 +1146,7 @@ test_parse_shared_parent_ref(void **state)
11461146
" \"sm:target\": \"wrong-target-value\"\n"
11471147
"}\n";
11481148
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
1149-
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount\": "
1149+
CHECK_LOG_CTX("Ext plugin \"ly2 - schema mount\": "
11501150
"Invalid leafref value \"target-value\" - no target instance \"/sm:target\" with the same value.",
11511151
"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name", 0);
11521152

tests/utests/extensions/test_structure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ test_schema_invalid(void **state)
154154
"import ietf-yang-structure-ext {prefix sx;}"
155155
"container b { sx:structure struct { container x { leaf x {type string;}}}}}";
156156
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
157-
CHECK_LOG_CTX("Ext plugin \"ly2 structure\": "
157+
CHECK_LOG_CTX("Ext plugin \"ly2 - structure\": "
158158
"Extension sx:structure must not be used as a non top-level statement in \"container\" statement.",
159159
"/a:b/{extension='sx:structure'}/struct", 0);
160160

@@ -170,15 +170,15 @@ test_schema_invalid(void **state)
170170
"sx:structure struct { container x { leaf x {type string;}}}"
171171
"sx:structure struct { container y { leaf y {type string;}}}}";
172172
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
173-
CHECK_LOG_CTX("Ext plugin \"ly2 structure\": Extension sx:structure is instantiated multiple times.",
173+
CHECK_LOG_CTX("Ext plugin \"ly2 - structure\": Extension sx:structure is instantiated multiple times.",
174174
"/a:{extension='sx:structure'}/struct", 0);
175175

176176
data = "module a {yang-version 1.1; namespace urn:tests:extensions:structure:a; prefix self;"
177177
"import ietf-yang-structure-ext {prefix sx;}"
178178
"sx:structure struct { container x { leaf x {type string;}}}"
179179
"choice struct { container y { leaf y {type string;}}}}";
180180
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
181-
CHECK_LOG_CTX("Ext plugin \"ly2 structure\": Extension sx:structure collides with a choice with the same identifier.",
181+
CHECK_LOG_CTX("Ext plugin \"ly2 - structure\": Extension sx:structure collides with a choice with the same identifier.",
182182
"/a:{extension='sx:structure'}/struct", 0);
183183

184184
/* augment-structure */

0 commit comments

Comments
 (0)