aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/ct_netconfc_SUITE_data
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-04-28 14:16:08 +0200
committerDan Gudmundsson <[email protected]>2015-05-04 15:23:07 +0200
commit1baa54479df7224985b0889562ecd5701b0805bc (patch)
treeed37c7955dec2ed4f01c852cab10e8d1391e6990 /lib/common_test/test/ct_netconfc_SUITE_data
parentff1e0b2fe44a347670a5d72c45c061fefa6abc7f (diff)
downloadotp-1baa54479df7224985b0889562ecd5701b0805bc.tar.gz
otp-1baa54479df7224985b0889562ecd5701b0805bc.tar.bz2
otp-1baa54479df7224985b0889562ecd5701b0805bc.zip
common_test: Recurse when there is more data in netconf
When several packets where receive in one packet ct_netconf failed to deliver them to the user. For example several subscritiption message could be in the buffer but only the first was sent to the user. Error handling could be improved, maybe the connection should be closed when unparseable packet arrives or timeout occurs.
Diffstat (limited to 'lib/common_test/test/ct_netconfc_SUITE_data')
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
index a145d85b1d..099deeb980 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
@@ -490,13 +490,16 @@ action(Config) ->
Data = [{myactionreturn,[{xmlns,"myns"}],["value"]}],
%% test either to receive {data,Data} or {ok,Data},
%% both need to be handled
- {Reply,RetVal} = case element(3, now()) rem 2 of
- 0 -> {{data,Data},{ok,Data}};
- 1 -> {{ok,Data},ok}
- end,
- ct:log("Client will receive {~w,Data}", [element(1,Reply)]),
- ?NS:expect_reply(action,Reply),
- RetVal = ct_netconfc:action(Client,{myaction,[{xmlns,"myns"}],[]}),
+ ct:log("Client will receive {~w,~p}", [data,Data]),
+ ct:log("Expecting ~p", [{ok, Data}]),
+ ?NS:expect_reply(action,{data, Data}),
+ {ok, Data} = ct_netconfc:action(Client,{myaction,[{xmlns,"myns"}],[]}),
+
+ ct:log("Client will receive {~w,~p}", [ok,Data]),
+ ct:log("Expecting ~p", [ok]),
+ ?NS:expect_reply(action,{ok, Data}),
+ ok = ct_netconfc:action(Client,{myaction,[{xmlns,"myns"}],[]}),
+
?NS:expect_do_reply('close-session',close,ok),
?ok = ct_netconfc:close_session(Client),
ok.