anchor.diff:      Connect = packet:gen_connect("connect-uname-pwd-test", [{keepalive,10}, {username, "user"},
                                                               {password, "password9"}]),
       Connack = packet:gen_connack(0),
  -    vmq_plugin_mgr:enable_module_plugin(
  +    ok = vmq_plugin_mgr:enable_module_plugin(
         auth_on_register, ?MODULE, hook_uname_password_success, 5),
       {ok, Socket} = packet:do_client_connect(Connect, Connack, []),
  -    vmq_plugin_mgr:disable_module_plugin(
  +    ok = vmq_plugin_mgr:disable_module_plugin(
         auth_on_register, ?MODULE, hook_uname_password_success, 5),
       ok = gen_tcp:close(Socket).
   
  
positive.code: invalid_id_0_311_test(_) ->
      Connect = packet:gen_connect(empty, [{keepalive,10},{proto_ver,4}]),
      Connack = packet:gen_connack(0),
      vmq_plugin_mgr:enable_module_plugin(
        auth_on_register, ?MODULE, hook_empty_client_id_proto_4, 5),
      {ok, Socket} = packet:do_client_connect(Connect, Connack, []),
      vmq_plugin_mgr:disable_module_plugin(
        auth_on_register, ?MODULE, hook_empty_client_id_proto_4, 5),
      ok = gen_tcp:close(Socket).
  
  
negative.code: -module(vmq_connect_SUITE).
  
  -compile(export_all).
  -compile(nowarn_export_all).
  
  %% ===================================================================
  %% common_test callbacks
  %% ===================================================================
  init_per_suite(_Config) ->
      cover:start(),
      vmq_test_utils:setup(),
      _Config.
  
  end_per_suite(_Config) ->
      vmq_test_utils:teardown(),
      _Config.
  
  init_per_group(mqtt, Config) ->
      Port = 1888,
      Address = "127.0.0.1",
      Opts = [],
      vmq_server_cmd:listener_start(Port, Address, Opts),
      [{address, Address},{port, Port},{opts, Opts}|Config].
  
  end_per_group(mqtt, Config) ->
      Port = proplists:get_value(port, Config),
      Address = proplists:get_value(address, Config),
      vmq_server_cmd:listener_stop(Port, Address, false),
      ok.
  
  init_per_testcase(_Case, Config) ->
      %% reset config before each test
      vmq_server_cmd:set_config(allow_anonymous, false),
      vmq_server_cmd:set_config(max_client_id_size, 23),
      vmq_config:configure_node(),
      Config.
  
  end_per_testcase(_, Config) ->
      Config.
  
  all() ->
      [
       {group, mqtt}
      ].
  
  groups() ->
      Tests = 
          [anon_denied_test,
           anon_success_test,
           invalid_id_0_test,
           invalid_id_0_311_test,
           invalid_id_missing_test,
           invalid_id_24_test,
           invalid_protonum_test,
           uname_no_password_denied_test,
           uname_password_denied_test,
           uname_password_success_test,
           change_subscriber_id_test
          ],
      [
       {mqtt, [], Tests}
      ].
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% Actual Tests
  