Added CLICON_LOG_DESTINATION and CLICON_LOG_FILE for al applications
This commit is contained in:
parent
26062d7003
commit
0234ed94bc
22 changed files with 498 additions and 163 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# Turn on debug on backend/cli/netconf
|
||||
# Note, restconf debug used to be tested but is no longer tested here,
|
||||
# maybe in test_restconf_internal?
|
||||
# Also some log destination tests
|
||||
# Note no restconf debug test
|
||||
|
||||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
|
@ -84,15 +84,57 @@ wait_restconf
|
|||
new "Set backend debug using netconf"
|
||||
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><debug $LIBNS><level>1</level></debug></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||
|
||||
new "Set cli debug using cli"
|
||||
# Debug
|
||||
new "cli debug cli"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -l o debug cli 1)" 0 "^$"
|
||||
|
||||
# Run cli debug
|
||||
new "get cli debug, expect 0"
|
||||
new "cli debug, expect 0"
|
||||
expectpart "$($clixon_cli -1 -f $cfg show debug cli)" 0 "CLI debug:0x0"
|
||||
|
||||
new "get cli debug expect 2"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -o CLICON_DEBUG=msg show debug cli)" 0 "CLI debug:0x2"
|
||||
new "cli debug -o single"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -o CLICON_DEBUG=msg show debug cli)" 0 "CLI debug:0x2" --not-- "CLI debug:0x20"
|
||||
|
||||
new "cli debug -o multi"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -o CLICON_DEBUG="msg app2" show debug cli)" 0 "CLI debug:0x200002"
|
||||
|
||||
new "cli debug -D multi"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -D msg -D app2 show debug cli)" 0
|
||||
|
||||
# Log destination
|
||||
new "cli log -lf<file>"
|
||||
rm -f $dir/clixon.log
|
||||
expectpart "$($clixon_cli -1 -lf$dir/clixon.log -f $cfg show version)" 0
|
||||
if [ ! -f "$dir/clixon.log" ]; then
|
||||
err "$dir/clixon.log" "No file"
|
||||
fi
|
||||
|
||||
new "cli log -lfile"
|
||||
rm -f $dir/clixon.log
|
||||
expectpart "$($clixon_cli -1 -lfile -f $cfg show version)" 0
|
||||
if [ -f "$dir/clixon.log" ]; then
|
||||
err "No file" "$dir/clixon.log"
|
||||
fi
|
||||
|
||||
new "cli log -lfile + CLICON_LOG_FILE"
|
||||
rm -f $dir/clixon.log
|
||||
expectpart "$($clixon_cli -1 -lfile -o CLICON_LOG_FILE=$dir/clixon.log -f $cfg show version)" 0
|
||||
if [ ! -f "$dir/clixon.log" ]; then
|
||||
err "$dir/clixon.log" "No file"
|
||||
fi
|
||||
|
||||
rm -f $dir/clixon.log
|
||||
new "cli log -o CLICON_LOG_DESTINATION + CLICON_LOG_FILE"
|
||||
expectpart "$($clixon_cli -1 -o CLICON_LOG_DESTINATION=file -o CLICON_LOG_FILE=$dir/clixon.log -f $cfg show version)" 0
|
||||
if [ ! -f "$dir/clixon.log" ]; then
|
||||
err "$dir/clixon.log" "No file"
|
||||
fi
|
||||
|
||||
rm -f $dir/clixon.log
|
||||
new "cli log -o CLICON_LOG_DESTINATION + CLICON_LOG_FILE multi"
|
||||
expectpart "$($clixon_cli -1 -o CLICON_LOG_DESTINATION="stdout file" -o CLICON_LOG_FILE=$dir/clixon.log -f $cfg show version)" 0
|
||||
if [ ! -f "$dir/clixon.log" ]; then
|
||||
err "$dir/clixon.log" "No file"
|
||||
fi
|
||||
|
||||
new "Set backend debug using cli"
|
||||
expectpart "$($clixon_cli -1 -f $cfg -l o debug backend 1)" 0 "^$"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue