diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index cfc3f4e8..0e132867 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -653,6 +653,7 @@ text_modify(clicon_handle h, if (strcmp(restype, "enumeration") == 0 || strcmp(restype, "bits") == 0) x1bstr = clixon_trim2(x1bstr, " \t\n"); +#if 0 /* Passes regression test without, keep for some time until other test requires it */ /* If origin body has namespace definitions, copy them. The reason is that * some bodies rely on namespace prefixes, such as NACM path, but there is * no way we can know this here. @@ -663,6 +664,7 @@ text_modify(clicon_handle h, */ if (assign_namespace_body(x1, x0) < 0) goto done; +#endif } /* XXX here x1bstr is checked for null, while adding an empty string above */ if ((x0b = xml_body_get(x0)) == NULL && x1bstr && strlen(x1bstr)){ diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index d2788028..32d9dc30 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -1006,6 +1006,7 @@ assign_namespace_element(cxobj *x0, /* source */ * * @param[in] x0 Source XML * @param[in] x1 Destination XML + * @note "standard" namespaces, including clixon internal namespaces are removed */ int assign_namespace_body(cxobj *x0, /* source */ @@ -1031,9 +1032,13 @@ assign_namespace_body(cxobj *x0, /* source */ else prefix1 = name; /* prefix1 contains actual prefix or NULL, prefix0 can be xmlns */ - if (strcmp(namespace, NETCONF_BASE_NAMESPACE) ==0 || - strcmp(namespace, YANG_XML_NAMESPACE) ==0) + if (strcmp(namespace, NETCONF_BASE_NAMESPACE) == 0 || + strcmp(namespace, YANG_XML_NAMESPACE) == 0 || + strcmp(namespace, CLIXON_CONF_NS) == 0 || + strcmp(namespace, CLIXON_LIB_NS) == 0 + ) continue; + continue; // XXX /* Detect if prefix:namespace is declared already? */ if (xml2ns(x1, prefix1, &namespace1) == 1) continue; diff --git a/test/test_netconf.sh b/test/test_netconf.sh index 8687961b..f8b7f485 100755 --- a/test/test_netconf.sh +++ b/test/test_netconf.sh @@ -56,7 +56,7 @@ module clixon-example{ base if:interface-type; } /* Generic config data */ - container table{ + container table{ list parameter{ key name; leaf name{ @@ -256,6 +256,16 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +# These are clixon-lib attributes used by RESTCONF +new "netonf edit-config with extra attributes on leaf" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "nonex99
" "" + +new "netconf get-config" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "x99
" + +new "netconf discard-changes" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" + new "netconf get empty config2" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_restconf_jukebox.sh b/test/test_restconf_jukebox.sh index dc6d96a0..c73d79ca 100755 --- a/test/test_restconf_jukebox.sh +++ b/test/test_restconf_jukebox.sh @@ -245,7 +245,7 @@ new 'B.3.5. "point" Parameter leaf-list 4 before 3' expectpart "$(curl $CURLOPTS -X POST -H 'Content-Type: application/yang-data+json' -d '{"example-jukebox:extra":"4"}' $RCPROTO://localhost/restconf/data?insert=before\&point=%2Fexample-jukebox%3Aextra%3D3 )" 0 "HTTP/$HVER 201" "Location: $RCPROTO://localhost/restconf/data/example-jukebox:extra=4" new 'B.3.5. "insert/point" leaf-list check order (2,4,3,1)' -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example-jukebox:extra -H 'Accept: application/yang-data+xml')" 0 "HTTP/$HVER 200" '2431' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example-jukebox:extra -H 'Accept: application/yang-data+xml')" 0 "HTTP/$HVER 200" '2431' #new "B.2.2. Detect Datastore Resource Entity-Tag Change" # XXX done except entity-changed #new 'B.3.3. "fields" Parameter'