Skip to content

Commit a68a280

Browse files
author
Irfan Mohammad
committed
ut - segv in nacm extension
1 parent deae604 commit a68a280

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/utests/extensions/test_nacm.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,42 @@ 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+
122+
str = "module with-extensions {"
123+
" yang-version 1.1;"
124+
" prefix \"we\";"
125+
" namespace \"we\";"
126+
" import ietf-netconf-acm {"
127+
" prefix \"nacm\";"
128+
" }"
129+
" extension annotation {"
130+
" argument name;"
131+
" description \"This is inspired by md:annotation\";"
132+
" }"
133+
" container c {"
134+
" nacm:default-deny-write;"
135+
" we:annotation last-modified {"
136+
" type yang:date-and-time;"
137+
" }"
138+
" }"
139+
"}";
140+
141+
/* compile without obsolete nodes */
142+
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, &mod), LY_SUCCESS);
143+
CHECK_LOG_CTX(NULL, NULL, 0);
144+
}
145+
115146
int
116147
main(void)
117148
{
118149
const struct CMUnitTest tests[] = {
150+
UTEST(test_extension, setup),
119151
UTEST(test_deny_all, setup),
120152
UTEST(test_deny_write, setup),
121153
};

0 commit comments

Comments
 (0)