Skip to content

Commit 1851643

Browse files
committed
tests UPDATE test for nested mount-point data
Required a fix in libyang. Refs #1775
1 parent 944ebcc commit 1851643

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ endif()
4444
set(NP2SRV_VERSION 2.7.2)
4545

4646
# libyang required version
47-
set(LIBYANG_DEP_VERSION 4.2.0)
48-
set(LIBYANG_DEP_SOVERSION 4.2.0)
47+
set(LIBYANG_DEP_VERSION 4.3.7)
48+
set(LIBYANG_DEP_SOVERSION 4.3.7)
4949
set(LIBYANG_DEP_SOVERSION_MAJOR 4)
5050

5151
# libnetconf2 required version

tests/modules/schema_mount.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<label>root</label>
55
<shared-schema/>
66
</mount-point>
7+
<mount-point>
8+
<module>sm</module>
9+
<label>mnt-root</label>
10+
<shared-schema/>
11+
</mount-point>
712
</schema-mounts>
813
<root xmlns="urn:sm">
914
<yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
@@ -29,3 +34,30 @@
2934
<content-id>1</content-id>
3035
</yang-library>
3136
</root>
37+
<root3 xmlns="urn:sm">
38+
<ls>
39+
<name>key</name>
40+
<yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
41+
<module-set>
42+
<name>mp</name>
43+
<module>
44+
<name>ietf-yang-library</name>
45+
<namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>
46+
</module>
47+
<module>
48+
<name>ietf-netconf</name>
49+
<namespace>urn:ietf:params:xml:ns:netconf:base:1.0</namespace>
50+
</module>
51+
<module>
52+
<name>ietf-origin</name>
53+
<namespace>urn:ietf:params:xml:ns:yang:ietf-origin</namespace>
54+
</module>
55+
<module>
56+
<name>edit1</name>
57+
<namespace>ed1</namespace>
58+
</module>
59+
</module-set>
60+
<content-id>1</content-id>
61+
</yang-library>
62+
</ls>
63+
</root3>

tests/test_rpc.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,18 @@ test_schema_mount(void **state)
302302
ASSERT_OK_REPLY(st);
303303
FREE_TEST_VARS(st);
304304

305+
SEND_EDIT_RPC(st,
306+
"<root3 xmlns=\"urn:sm\">"
307+
" <ls>"
308+
" <name>key</name>"
309+
" <first xmlns=\"ed1\">AnotherFirst</first>"
310+
" </ls>"
311+
"</root3>");
312+
ASSERT_OK_REPLY(st);
313+
FREE_TEST_VARS(st);
314+
305315
/* read back the configuration */
306-
GET_CONFIG_FILTER(st, "/sm:root/*");
316+
GET_CONFIG_FILTER(st, "/sm:*");
307317
assert_string_equal(st->str,
308318
"<get-config xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
309319
" <data>\n"
@@ -314,6 +324,12 @@ test_schema_mount(void **state)
314324
" <third>25</third>\n"
315325
" </cont>\n"
316326
" </root>\n"
327+
" <root3 xmlns=\"urn:sm\">\n"
328+
" <ls>\n"
329+
" <name>key</name>\n"
330+
" <first xmlns=\"ed1\">AnotherFirst</first>\n"
331+
" </ls>\n"
332+
" </root3>\n"
317333
" </data>\n"
318334
"</get-config>\n");
319335
FREE_TEST_VARS(st);

0 commit comments

Comments
 (0)