diff --git a/test/mem.sh b/test/mem.sh index d9c0e1dd..f40f52cd 100755 --- a/test/mem.sh +++ b/test/mem.sh @@ -86,7 +86,20 @@ done testnr=0 for c in $cmds; do if [ $testnr != 0 ]; then echo; fi - echo "Mem test for $c" - echo "=================" + echo "Mem test $c begin" + length=$(echo "Mem test $c begin" | wc -c) + let i=1 + while [ $i -lt $length ]; do + echo -n "=" + let i++ + done + echo memonce $c + echo "Mem test $c done" + let i=1 + while [ $i -lt $length ]; do + echo -n "=" + let i++ + done + echo done diff --git a/test/test_augment.sh b/test/test_augment.sh index a3a9d7ef..a5a61153 100755 --- a/test/test_augment.sh +++ b/test/test_augment.sh @@ -154,7 +154,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi # mandatory-leaf See RFC7950 Sec 7.17 diff --git a/test/test_choice.sh b/test/test_choice.sh index 145f0dac..2e352993 100755 --- a/test/test_choice.sh +++ b/test/test_choice.sh @@ -124,7 +124,9 @@ new "start restconf daemon" start_restconf -f $cfg new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf + # First vanilla (protocol) case new "netconf validate empty" diff --git a/test/test_cli_history.sh b/test/test_cli_history.sh index f6c50382..034daf1d 100755 --- a/test/test_cli_history.sh +++ b/test/test_cli_history.sh @@ -48,7 +48,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "cli read and add entry to existing history" diff --git a/test/test_feature.sh b/test/test_feature.sh index 6db7c439..72ad5c71 100755 --- a/test/test_feature.sh +++ b/test/test_feature.sh @@ -85,7 +85,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "cli enabled feature" diff --git a/test/test_leafref.sh b/test/test_leafref.sh index 1c8f7eae..8179766f 100755 --- a/test/test_leafref.sh +++ b/test/test_leafref.sh @@ -87,7 +87,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "leafref base config" diff --git a/test/test_minmax.sh b/test/test_minmax.sh index 5c7faf5d..fd6da008 100755 --- a/test/test_minmax.sh +++ b/test/test_minmax.sh @@ -115,7 +115,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "minmax: minimal" diff --git a/test/test_nacm.sh b/test/test_nacm.sh index b7b914ae..042b6d75 100755 --- a/test/test_nacm.sh +++ b/test/test_nacm.sh @@ -124,12 +124,12 @@ fi new "kill old restconf daemon" sudo pkill -u www-data -f "/www-data/clixon_restconf" -sleep 1 new "start restconf daemon (-a is enable basic authentication)" start_restconf -f $cfg -- -a new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "auth get" expecteq "$(curl -u andy:bar -sS -X GET http://localhost/restconf/data/nacm-example:x)" 0 'null diff --git a/test/test_nacm_default.sh b/test/test_nacm_default.sh index 6645ef11..7bceadbf 100755 --- a/test/test_nacm_default.sh +++ b/test/test_nacm_default.sh @@ -101,14 +101,12 @@ EOF new "kill old restconf daemon" sudo pkill -u www-data -f "/www-data/clixon_restconf" - sleep 1 new "start restconf daemon (-a is enable basic authentication)" start_restconf -f $cfg -- -a new "waiting" wait_backend wait_restconf - #----------- First get case "$ret1" in diff --git a/test/test_nacm_module_read.sh b/test/test_nacm_module_read.sh index 16755175..365d6dcf 100755 --- a/test/test_nacm_module_read.sh +++ b/test/test_nacm_module_read.sh @@ -139,12 +139,12 @@ fi new "kill old restconf daemon" sudo pkill -u www-data -f "/www-data/clixon_restconf" -sleep 1 new "start restconf daemon (-a is enable basic authentication)" start_restconf -f $cfg -- -a new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_module_write.sh b/test/test_nacm_module_write.sh index d1bbe6d0..a88951e8 100755 --- a/test/test_nacm_module_write.sh +++ b/test/test_nacm_module_write.sh @@ -148,12 +148,12 @@ fi new "kill old restconf daemon" sudo pkill -u www-data -f "/www-data/clixon_restconf" -sleep 1 new "start restconf daemon (-a is enable basic authentication)" start_restconf -f $cfg -- -a new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf # Set nacm from scratch nacm(){ diff --git a/test/test_nacm_protocol.sh b/test/test_nacm_protocol.sh index c9092ac9..4aa851cd 100755 --- a/test/test_nacm_protocol.sh +++ b/test/test_nacm_protocol.sh @@ -148,12 +148,12 @@ fi new "kill old restconf daemon" sudo pkill -u www-data -f "/www-data/clixon_restconf" -sleep 1 new "start restconf daemon (-a is enable basic authentication)" start_restconf -f $cfg -- -a new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_order.sh b/test/test_order.sh index 20393f18..79a93f62 100755 --- a/test/test_order.sh +++ b/test/test_order.sh @@ -162,7 +162,7 @@ if [ $BE -ne 0 ]; then start_backend -s running -f $cfg -- -s new "waiting" - sleep $RCWAIT + wait_backend fi # STATE (should not be ordered) diff --git a/test/test_restconf_startup.sh b/test/test_restconf_startup.sh index 36037af8..2513c7a8 100755 --- a/test/test_restconf_startup.sh +++ b/test/test_restconf_startup.sh @@ -68,7 +68,8 @@ testrun(){ start_restconf -f $cfg -y $fyang $option new "waiting" - sleep $RCWAIT + wait_backend + wait_restconf new "restconf put 42" expecteq "$(curl -s -X PUT http://localhost/restconf/data/example:x/y=42 -d '{"example:y":{"a":"42","b":"42"}}')" 0 "" diff --git a/test/test_rpc.sh b/test/test_rpc.sh index 64ed55c3..8190608a 100755 --- a/test/test_rpc.sh +++ b/test/test_rpc.sh @@ -50,7 +50,9 @@ new "start restconf daemon" start_restconf -f $cfg new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf + new "rpc tests" diff --git a/test/test_startup.sh b/test/test_startup.sh index 691c7df7..afb35ed8 100755 --- a/test/test_startup.sh +++ b/test/test_startup.sh @@ -86,7 +86,7 @@ testrun(){ start_backend -s $mode -f $cfg -c $dir/extra_db new "waiting" - sleep $RCWAIT + wait_backend else new "Restart backend as eg follows: -Ff $cfg -s $mode -c $dir/extra_db # $BETIMEOUT s" sleep $BETIMEOUT diff --git a/test/test_transaction.sh b/test/test_transaction.sh index 4055cc7d..fefe6122 100755 --- a/test/test_transaction.sh +++ b/test/test_transaction.sh @@ -121,8 +121,9 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -l f$flog -- -t /x/y[a=$errnr]" start_backend -s init -f $cfg -l f$flog -- -t /x/y[a=$errnr] # -t means transaction logging + new "waiting" - sleep $RCWAIT + wait_backend fi let nr=0 diff --git a/test/test_union.sh b/test/test_union.sh index b6862ff3..7931ede3 100755 --- a/test/test_union.sh +++ b/test/test_union.sh @@ -89,7 +89,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "cli set transitive string" diff --git a/test/test_unique.sh b/test/test_unique.sh index 799a51bb..a921ff53 100755 --- a/test/test_unique.sh +++ b/test/test_unique.sh @@ -92,7 +92,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi # RFC test two-field caes diff --git a/test/test_upgrade.sh b/test/test_upgrade.sh index 03b59f7b..a3885f28 100755 --- a/test/test_upgrade.sh +++ b/test/test_upgrade.sh @@ -265,7 +265,7 @@ runtest(){ start_backend -s $mode -f $cfg -o "CLICON_XMLDB_MODSTATE=$modstate" new "waiting" - sleep $RCWAIT + wait_backend else new "Restart backend as eg follows: -Ff $cfg -s $mode -o \"CLICON_XMLDB_MODSTATE=$modstate\" ($BETIMEOUT s)" sleep $BETIMEOUT diff --git a/test/test_upgrade_auto.sh b/test/test_upgrade_auto.sh index 7991864c..11c8fd52 100755 --- a/test/test_upgrade_auto.sh +++ b/test/test_upgrade_auto.sh @@ -254,8 +254,6 @@ if [ $BE -ne 0 ]; then new "start backend -s $mode -f $cfg" start_backend -s $mode -f $cfg fi -new "waiting" -sleep $RCWAIT new "kill old restconf daemon" sudo pkill -u www-data clixon_restconf @@ -264,7 +262,8 @@ new "start restconf daemon" start_restconf -f $cfg new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "Check running db content" expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' "^$XML]]>]]>$" diff --git a/test/test_upgrade_interfaces.sh b/test/test_upgrade_interfaces.sh index c72e7b2c..5bba6688 100755 --- a/test/test_upgrade_interfaces.sh +++ b/test/test_upgrade_interfaces.sh @@ -265,8 +265,6 @@ testrun(){ new "start backend -s startup -f $cfg -- -u" start_backend -s startup -f $cfg -- -u fi - new "waiting" - sleep $RCWAIT new "kill old restconf daemon" sudo pkill -u www-data clixon_restconf @@ -275,7 +273,8 @@ testrun(){ start_restconf -f $cfg new "waiting" - sleep $RCWAIT + wait_backend + wait_restconf new "Check running db content" expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' "^$runxml]]>]]>$" diff --git a/test/test_upgrade_repair.sh b/test/test_upgrade_repair.sh index e752d1d5..a9c9bb80 100755 --- a/test/test_upgrade_repair.sh +++ b/test/test_upgrade_repair.sh @@ -112,8 +112,6 @@ if [ $BE -ne 0 ]; then new "start backend -s $mode -f $cfg" start_backend -s $mode -f $cfg fi -new "waiting" -sleep $RCWAIT new "kill old restconf daemon" sudo pkill -u www-data clixon_restconf @@ -122,7 +120,8 @@ new "start restconf daemon" start_restconf -f $cfg new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "Check running db content is failsafe" expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' "^$SAMEXML]]>]]>$" diff --git a/test/test_when_must.sh b/test/test_when_must.sh index a57c4fe4..2fc4dcf7 100755 --- a/test/test_when_must.sh +++ b/test/test_when_must.sh @@ -102,7 +102,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "when: add static route" diff --git a/test/test_yang_load.sh b/test/test_yang_load.sh index 19c826d5..df5e7195 100755 --- a/test/test_yang_load.sh +++ b/test/test_yang_load.sh @@ -85,7 +85,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "1. Set newex" @@ -134,7 +134,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set oldex" @@ -178,7 +178,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set newex" @@ -222,7 +222,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set oldex" @@ -266,7 +266,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set newex" @@ -312,7 +312,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 'str]]>]]>' '^]]>]]>$' @@ -357,7 +357,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set oldex" @@ -403,7 +403,7 @@ if [ $BE -ne 0 ]; then start_backend -s init -f $cfg new "waiting" - sleep $RCWAIT + wait_backend fi new "Set oldex" diff --git a/test/test_yang_namespace.sh b/test/test_yang_namespace.sh index d5c925eb..113d0426 100755 --- a/test/test_yang_namespace.sh +++ b/test/test_yang_namespace.sh @@ -83,7 +83,8 @@ new "start restconf daemon" start_restconf -f $cfg new "waiting" -sleep $RCWAIT +wait_backend +wait_restconf new "netconf set x in example1" expecteof "$clixon_netconf -qf $cfg" 0 '42]]>]]>' '^]]>]]>$'