Skip to content

Commit 9b3e7db

Browse files
author
Irfan Mohammad
committed
ut - segv in nacm extension
1 parent 965c93c commit 9b3e7db

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/utests/extensions/test_nacm.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,44 @@ test_deny_write(void **state)
112112
"/aa:l/{extension='nacm:default-deny-write'}", 0);
113113
}
114114

115+
static void
116+
test_extension(void **state)
117+
{
118+
const char *str;
119+
struct lys_module *mod;
120+
const struct lysc_node *snode;
121+
struct ly_ctx *ctx;
122+
123+
str = "module with-extensions {"
124+
" yang-version 1.1;"
125+
" prefix \"we\";"
126+
" namespace \"we\";"
127+
" import ietf-netconf-acm {"
128+
" prefix \"nacm\";"
129+
" }"
130+
" extension annotation {"
131+
" argument name;"
132+
" description \"This is inspired by md:annotation\";"
133+
" }"
134+
" container c {"
135+
" nacm:default-deny-write;"
136+
" we:annotation last-modified {"
137+
" type yang:date-and-time;"
138+
" }"
139+
" }"
140+
"}";
141+
142+
/* compile without obsolete nodes */
143+
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, &mod), LY_SUCCESS);
144+
CHECK_LOG_CTX(NULL, NULL, 0);
145+
ly_ctx_destroy(ctx);
146+
}
147+
115148
int
116149
main(void)
117150
{
118151
const struct CMUnitTest tests[] = {
152+
UTEST(test_extension, setup),
119153
UTEST(test_deny_all, setup),
120154
UTEST(test_deny_write, setup),
121155
};

0 commit comments

Comments
 (0)