anchor.diff:      [
        {connect, [parallel, {repeat, 5}], [ connect_system, connect_session ]}
       ,{service, [parallel, {repeat, 1}], [
  -					 connect_service
  -					,walk_node
  -					,interface
  -					,call_method
  -					,signal_all
  -					,signal
  -					]}
  +                                         connect_service
  +                                        ,walk_node
  +                                        ,interface
  +                                        ,call_method
  +                                        ,signal_all
  +                                        ,signal
  +                                        ]}
       ].
   
   
  
positive.code: call_method(Config) ->
      {ok, O} = dbus_proxy:start_link(?config(bus, Config), ?SERVICE, <<"/root">>),
      ?assertMatch({ok,[<<"Hello World">>,<<" from example-service.py">>]},
  		 dbus_proxy:call(O, ?IFACE, <<"HelloWorld">>, ["plop"])),
      ?assertMatch({error, {'org.freedesktop.DBus.InvalidParameters', _}},
  		 dbus_proxy:call(O, ?IFACE, <<"HelloWorld">>, [])),
      ?assertMatch({error, {'org.freedesktop.DBus.UnknownMethod', _}},
  		 dbus_proxy:call(O, ?IFACE, <<"bad_method">>, [])),
      ?assertMatch({error, {'org.freedesktop.DBus.UnknownInterface', _}},
  		 dbus_proxy:call(O, <<"net.lizenn.dbus.BadInterface">>, <<"HelloWorld">>, [])),
      ok.
  
  signal_all(Config) ->
      Fun = fun (_Sender, IfaceName, <<"SampleSignal">>, Path, _Args, Pid) ->
  		  ?debug("### Received signal: SampleSignal"),
  		  ?assertMatch({?IFACE, <<"/root">>},
  			       {IfaceName, Path}),
  		  Pid ! got_signal;
  	      (_Sender, IfaceName, <<"SampleSignal2">>, Path, _Args, Pid) ->
  		  ?debug("### Received signal: SampleSignal2"),
  		  ?assertMatch({?IFACE, <<"/root">>},
  			       {IfaceName, Path}),
  		  Pid ! got_signal2
  	  end,
      {ok, O} = dbus_proxy:start_link(?config(bus, Config), ?SERVICE, <<"/root">>),
      dbus_proxy:connect_signal(O, {Fun, self()}),
      dbus_proxy:call(O, ?IFACE, <<"HelloWorld">>, ["plop"]),
      Wait = fun([], _F) ->
  		   ok;
  	      ([ Signal | Tail ], F) ->
  		   receive Signal -> F(Tail, F)
  		   after 100 -> ?assert(false)
  		   end
  	   end,
      Wait([ got_signal, got_signal2 ], Wait),
      ok.
  
  
  signal(Config) ->
      Fun = fun (_Sender, IfaceName, <<"SampleSignal">>, Path, _Args, Pid) ->
  		  ?assertMatch({?IFACE, <<"/root">>},
  			       {IfaceName, Path}),
  		  Pid ! got_signal;
  	      (_Sender, ?IFACE, <<"SampleSignal2">>, _Path, _Args, Pid) ->
  		  Pid ! got_signal2
  	  end,
      {ok, O} = dbus_proxy:start_link(?config(bus, Config), ?SERVICE, <<"/root">>),
      dbus_proxy:connect_signal(O, ?IFACE, <<"SampleSignal">>, {Fun, self()}),
      dbus_proxy:call(O, ?IFACE, <<"HelloWorld">>, ["plop"]),
      Wait = fun ([], [], _F) ->
  		   ok;
  	       ([ Signal | Signals ], [], F) ->
  		   receive Signal -> F(lists:delete(Signal, Signals), [], F)
  		   after 100 -> ?assert(false)
  		   end;		   
  	       ([], [ BadSignal | BadSignals ], F) ->
  		   receive BadSignal -> ?assert(false)
  		   after 100 -> F([], BadSignals, F)
  		   end;		   
  	       ([ Signal | Signals ], [ BadSignal | BadSignals ], F) ->
  		   receive Signal -> F(lists:delete(Signal, Signals), [ BadSignal | BadSignals ], F);
  			   BadSignal -> ?assert(false)
  		   after 100 -> F([ Signal | Signals ], BadSignals, F)
  		   end
  	   end,
      Wait([got_signal], [got_signal2], Wait),
      ok.
  
  
negative.code: %%% CT callbacks
  %%%
  -export([suite/0,
           init_per_suite/1,
           end_per_suite/1,
           all/0,
           groups/0,
           init_per_group/2,
           end_per_group/2,
           init_per_testcase/2,
           end_per_testcase/2]).
  
  %%%
  %%% Test cases
  %%%
  -export([
           connect_system/1,
           connect_session/1,
           connect_service/1,
           walk_node/1,
           interface/1,
           call_method/1,
           signal_all/1,
           signal/1
          ]).
  
  suite() ->
      [{timetrap,{seconds,30}}].
  