diff --git a/test/test_type.sh b/test/test_type.sh
index 1538fbbd..2ef9a177 100755
--- a/test/test_type.sh
+++ b/test/test_type.sh
@@ -196,6 +196,14 @@ module example{
description "For testing different truth values in CLI";
type boolean;
}
+ container manc{
+ presence true;
+ description "mandatory test";
+ leaf man{
+ type string;
+ mandatory true;
+ }
+ }
}
EOF
@@ -247,7 +255,6 @@ EOF
new "netconf discard-changes"
expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^]]>]]>$"
-
new "netconf set transitive string error"
expecteof "$clixon_netconf -qf $cfg" 0 '9xx]]>]]>' "^]]>]]>"
@@ -593,6 +600,32 @@ EOF
new "netconf discard-changes"
expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^]]>]]>$"
+ #------ Mandatory
+
+ new "netconf set container w/o mandatory leaf"
+ expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' "^]]>]]>"
+
+ new "netconf validate should fail"
+ expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" 'applicationmissing-elementmanerrorMandatory variable]]>]]>'
+
+ new "netconf set container with mandatory leaf"
+ expecteof "$clixon_netconf -qf $cfg" 0 'foo]]>]]>' "^]]>]]>"
+
+ new "netconf commit"
+ expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^]]>]]>$"
+
+ new "netconf delete mandatory variable"
+ expecteof "$clixon_netconf -qf $cfg" 0 'foonone]]>]]>' '^]]>]]>$'
+
+ new "get mandatory"
+ expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' '^]]>]]>$'
+
+ new "netconf validate should fail"
+ expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" '^protocolmissing-elementmanerrorMay not remove mandatory variable]]>]]>$'
+
+ new "netconf discard-changes"
+ expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^]]>]]>$"
+
#------ minus
new "type with minus"