diff --git a/test/test_augment.sh b/test/test_augment.sh
index b4f3fe7a..fcbc9251 100755
--- a/test/test_augment.sh
+++ b/test/test_augment.sh
@@ -163,6 +163,8 @@ if [ $BE -ne 0 ]; then
new "start backend -s init -f $cfg"
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -171,7 +173,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
# mandatory-leaf See RFC7950 Sec 7.17
diff --git a/test/test_choice.sh b/test/test_choice.sh
index cfa68953..9bb5e8dc 100755
--- a/test/test_choice.sh
+++ b/test/test_choice.sh
@@ -117,6 +117,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -124,7 +127,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
# First vanilla (protocol) case
diff --git a/test/test_identity.sh b/test/test_identity.sh
index 25e91781..4759723c 100755
--- a/test/test_identity.sh
+++ b/test/test_identity.sh
@@ -151,6 +151,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -159,7 +162,6 @@ start_restconf -f $cfg
new "waiting"
wait_backend
-wait_restconf
new "Set crypto to aes"
expecteof "$clixon_netconf -qf $cfg" 0 'aes]]>]]>' '^]]>]]>$'
diff --git a/test/test_nacm.sh b/test/test_nacm.sh
index 69dcfc5b..dedf6799 100755
--- a/test/test_nacm.sh
+++ b/test/test_nacm.sh
@@ -123,6 +123,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -130,7 +133,6 @@ new "start restconf daemon (-a is enable basic authentication)"
start_restconf -f $cfg -- -a
new "waiting"
-wait_backend
wait_restconf
new "auth get"
diff --git a/test/test_nacm_default.sh b/test/test_nacm_default.sh
index 1ee6cd54..97b3c90f 100755
--- a/test/test_nacm_default.sh
+++ b/test/test_nacm_default.sh
@@ -99,6 +99,9 @@ EOF
sleep $BETIMEOUT
fi
+ new "waiting"
+ wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -106,7 +109,6 @@ EOF
start_restconf -f $cfg -- -a
new "waiting"
- wait_backend
wait_restconf
#----------- First get
diff --git a/test/test_nacm_ext.sh b/test/test_nacm_ext.sh
index 2abb1640..9cfd720e 100755
--- a/test/test_nacm_ext.sh
+++ b/test/test_nacm_ext.sh
@@ -143,6 +143,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg -- -s
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -150,7 +153,6 @@ new "start restconf daemon (-a is enable http basic auth)"
start_restconf -f $cfg -- -a
new "waiting"
-wait_backend
wait_restconf
new "auth get"
diff --git a/test/test_nacm_module_read.sh b/test/test_nacm_module_read.sh
index e4459917..9cceb59e 100755
--- a/test/test_nacm_module_read.sh
+++ b/test/test_nacm_module_read.sh
@@ -137,6 +137,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg -- -s
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -145,7 +148,6 @@ start_restconf -f $cfg -- -a
new "waiting"
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 7b1d20d6..25aa75ee 100755
--- a/test/test_nacm_module_write.sh
+++ b/test/test_nacm_module_write.sh
@@ -145,6 +145,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -152,7 +155,6 @@ new "start restconf daemon (-a is enable basic authentication)"
start_restconf -f $cfg -- -a
new "waiting"
-wait_backend
wait_restconf
# Set nacm from scratch
diff --git a/test/test_nacm_protocol.sh b/test/test_nacm_protocol.sh
index 67bd182c..123d4f91 100755
--- a/test/test_nacm_protocol.sh
+++ b/test/test_nacm_protocol.sh
@@ -146,6 +146,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -153,7 +156,6 @@ new "start restconf daemon (-a is enable basic authentication)"
start_restconf -f $cfg -- -a
new "waiting"
-wait_backend
wait_restconf
new "auth set authentication config"
diff --git a/test/test_perf.sh b/test/test_perf.sh
index 01447953..385cc1a6 100755
--- a/test/test_perf.sh
+++ b/test/test_perf.sh
@@ -79,6 +79,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg -- -s
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -86,7 +89,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "generate 'large' config with $perfnr list entries"
diff --git a/test/test_perf_state.sh b/test/test_perf_state.sh
index 4d6e8352..61a2359a 100755
--- a/test/test_perf_state.sh
+++ b/test/test_perf_state.sh
@@ -57,6 +57,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg -- -s
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -64,7 +67,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "generate 'large' config with $perfnr list entries"
diff --git a/test/test_restconf2.sh b/test/test_restconf2.sh
index 651d9098..162139a7 100755
--- a/test/test_restconf2.sh
+++ b/test/test_restconf2.sh
@@ -79,6 +79,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -86,7 +89,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "restconf POST tree without key"
diff --git a/test/test_restconf_err.sh b/test/test_restconf_err.sh
index 4a59d929..192abc71 100755
--- a/test/test_restconf_err.sh
+++ b/test/test_restconf_err.sh
@@ -125,6 +125,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -132,7 +135,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "restconf POST initial tree"
diff --git a/test/test_restconf_jukebox.sh b/test/test_restconf_jukebox.sh
index 4ce3e137..ccb1de91 100755
--- a/test/test_restconf_jukebox.sh
+++ b/test/test_restconf_jukebox.sh
@@ -74,6 +74,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f "$cfg" -- -s
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -81,7 +84,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "B.1.1. Retrieve the Top-Level API Resource root"
diff --git a/test/test_restconf_listkey.sh b/test/test_restconf_listkey.sh
index 7d1baead..24571e4d 100755
--- a/test/test_restconf_listkey.sh
+++ b/test/test_restconf_listkey.sh
@@ -77,6 +77,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -84,7 +87,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "restconf PUT add whole list entry"
diff --git a/test/test_restconf_patch.sh b/test/test_restconf_patch.sh
index 7094d4d0..afb5510e 100755
--- a/test/test_restconf_patch.sh
+++ b/test/test_restconf_patch.sh
@@ -105,6 +105,9 @@ if [ $BE -ne 0 ]; then
start_backend -s startup -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -112,7 +115,6 @@ new "start restconf daemon (-a is enable basic authentication)"
start_restconf -f $cfg -- -a
new "waiting"
-wait_backend
wait_restconf
# also in test_restconf.sh
diff --git a/test/test_restconf_startup.sh b/test/test_restconf_startup.sh
index b6d1a92e..e9fa9326 100755
--- a/test/test_restconf_startup.sh
+++ b/test/test_restconf_startup.sh
@@ -61,6 +61,9 @@ testrun(){
start_backend -s init -f $cfg -y $fyang $option
fi
+ new "waiting"
+ wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -68,7 +71,6 @@ testrun(){
start_restconf -f $cfg -y $fyang $option
new "waiting"
- wait_backend
wait_restconf
new "restconf put 42"
diff --git a/test/test_rpc.sh b/test/test_rpc.sh
index 42abdd09..1aaa5ee6 100755
--- a/test/test_rpc.sh
+++ b/test/test_rpc.sh
@@ -43,6 +43,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -50,10 +53,8 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
-
new "rpc tests"
# 1.First some positive tests vary media types
diff --git a/test/test_stream.sh b/test/test_stream.sh
index 6d897d0d..27fafd1a 100755
--- a/test/test_stream.sh
+++ b/test/test_stream.sh
@@ -114,6 +114,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -121,7 +124,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
#
diff --git a/test/test_submodule.sh b/test/test_submodule.sh
index 9a3b2182..7ee65882 100755
--- a/test/test_submodule.sh
+++ b/test/test_submodule.sh
@@ -159,6 +159,9 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -166,7 +169,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "netconfig edit main module"
diff --git a/test/test_upgrade_auto.sh b/test/test_upgrade_auto.sh
index bf0f3798..0dabb323 100755
--- a/test/test_upgrade_auto.sh
+++ b/test/test_upgrade_auto.sh
@@ -255,6 +255,9 @@ if [ $BE -ne 0 ]; then
start_backend -s $mode -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -262,7 +265,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "Check running db content"
diff --git a/test/test_upgrade_interfaces.sh b/test/test_upgrade_interfaces.sh
index a45453dc..20d071a7 100755
--- a/test/test_upgrade_interfaces.sh
+++ b/test/test_upgrade_interfaces.sh
@@ -266,6 +266,9 @@ testrun(){
start_backend -s startup -f $cfg -- -u
fi
+ new "waiting"
+ wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -273,7 +276,6 @@ testrun(){
start_restconf -f $cfg
new "waiting"
- wait_backend
wait_restconf
new "Check running db content"
diff --git a/test/test_upgrade_repair.sh b/test/test_upgrade_repair.sh
index 6e449342..9f01b0fe 100755
--- a/test/test_upgrade_repair.sh
+++ b/test/test_upgrade_repair.sh
@@ -113,6 +113,9 @@ if [ $BE -ne 0 ]; then
start_backend -s $mode -f $cfg
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -120,7 +123,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "Check running db content is failsafe"
diff --git a/test/test_yang_namespace.sh b/test/test_yang_namespace.sh
index a65afeee..60d49b1b 100755
--- a/test/test_yang_namespace.sh
+++ b/test/test_yang_namespace.sh
@@ -76,6 +76,9 @@ if [ $BE -ne 0 ]; then
fi
fi
+new "waiting"
+wait_backend
+
new "kill old restconf daemon"
sudo pkill -u $wwwuser clixon_restconf
@@ -83,7 +86,6 @@ new "start restconf daemon"
start_restconf -f $cfg
new "waiting"
-wait_backend
wait_restconf
new "netconf set x in example1"