Added YANG RPC support, with example rpc documentation and testcase (test7.sh); Extended example with ietf-routing (not only ietf-ip).
This commit is contained in:
parent
f995f1e268
commit
e56cf607a3
17 changed files with 177 additions and 112 deletions
|
|
@ -87,7 +87,7 @@ expectfn "$clixon_cli -1f $clixon_cf -l o debug level 1" ""
|
|||
expectfn "$clixon_cli -1f $clixon_cf -l o debug level 0" ""
|
||||
|
||||
new "cli downcall"
|
||||
expectfn "$clixon_cli -1f $clixon_cf -l o downcall \"This is a test =====\"" "^\"This is a test =====\"$"
|
||||
expectfn "$clixon_cli -1f $clixon_cf -l o rpc ipv4" "^<rpc-reply>"
|
||||
|
||||
new "Kill backend"
|
||||
# Check if still alive
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ clixon_netconf=clixon_netconf
|
|||
clixon_cli=clixon_cli
|
||||
|
||||
cat <<EOF > /tmp/test.yang
|
||||
module ietf-ip{
|
||||
module example{
|
||||
container x {
|
||||
list y {
|
||||
key "a b";
|
||||
|
|
|
|||
|
|
@ -9,47 +9,21 @@
|
|||
clixon_netconf=clixon_netconf
|
||||
clixon_cli=clixon_cli
|
||||
|
||||
cat <<EOF > /tmp/rpc.yang
|
||||
module ietf-ip{
|
||||
rpc fib-route {
|
||||
input {
|
||||
leaf name {
|
||||
type string;
|
||||
mandatory "true";
|
||||
}
|
||||
leaf destination-address {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
output {
|
||||
container route {
|
||||
leaf address{
|
||||
type string;
|
||||
}
|
||||
leaf address{
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# kill old backend (if any)
|
||||
new "kill old backend"
|
||||
sudo clixon_backend -zf $clixon_cf -y /tmp/rpc
|
||||
sudo clixon_backend -zf $clixon_cf
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
fi
|
||||
|
||||
new "start backend"
|
||||
# start new backend
|
||||
sudo clixon_backend -If $clixon_cf -y /tmp/rpc
|
||||
sudo clixon_backend -If $clixon_cf
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
fi
|
||||
new "netconf rpc (notyet)"
|
||||
#expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/rpc" "<rpc><fib-route><name></name></fib-route></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||
new "netconf rpc"
|
||||
expecteof "$clixon_netconf -qf $clixon_cf" "<rpc><fib-route><routing-instance-name>ipv4</routing-instance-name></fib-route></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "Kill backend"
|
||||
# Check if still alive
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ clixon_netconf=clixon_netconf
|
|||
clixon_cli=clixon_cli
|
||||
|
||||
cat <<EOF > /tmp/leafref.yang
|
||||
module ietf-ip{
|
||||
module example{
|
||||
typedef admin-status{
|
||||
type string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue