anchor.diff:  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(
  +    vmq_server_cmd:set_config(allow_anonymous, false),
  +    ok = 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(
  +    ok = vmq_plugin_mgr:disable_module_plugin(
         auth_on_register, ?MODULE, hook_empty_client_id_proto_4, 5),
       ok = gen_tcp:close(Socket).
   
  
positive.code: -module(vmq_connect_SUITE).
  -export([
           %% suite/0,
           init_per_suite/1,
           end_per_suite/1,
           init_per_testcase/2,
           end_per_testcase/2,
           all/0
          ]).
  
  -export([anon_denied_test/1,
           anon_success_test/1,
           invalid_id_0_test/1,
           invalid_id_0_311_test/1,
           invalid_id_missing_test/1,
           invalid_id_24_test/1,
           invalid_protonum_test/1,
           uname_no_password_denied_test/1,
           uname_password_denied_test/1,
           uname_password_success_test/1,
           change_subscriber_id_test/1]).
  
  -export([hook_empty_client_id_proto_4/5,
           hook_uname_no_password_denied/5,
           hook_uname_password_denied/5,
           hook_uname_password_success/5,
           hook_change_subscriber_id/5,
           hook_on_register_changed_subscriber_id/3]).
  
  %% ===================================================================
  %% common_test callbacks
  %% ===================================================================
  init_per_suite(_Config) ->
      cover:start(),
      _Config.
  
  end_per_suite(_Config) ->
      _Config.
  
  init_per_testcase(_Case, Config) ->
      vmq_test_utils:setup(),
      vmq_server_cmd:set_config(allow_anonymous, false),
      vmq_server_cmd:set_config(max_client_id_size, 23),
      vmq_server_cmd:listener_start(1888, []),
      Config.
  
  end_per_testcase(_, Config) ->
      vmq_test_utils:teardown(),
      Config.
  
  all() ->
      [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].
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% Actual Tests
  
negative.code:                                  [{keepalive,10}, {username, "whatever"},
                                    {password, "whatever"}]),
      Connack = packet:gen_connack(0),
      ok = vmq_plugin_mgr:enable_module_plugin(
        auth_on_register, ?MODULE, hook_change_subscriber_id, 5),
      ok = vmq_plugin_mgr:enable_module_plugin(
        on_register, ?MODULE, hook_on_register_changed_subscriber_id, 3),
      {ok, Socket} = packet:do_client_connect(Connect, Connack, []),
      ok = vmq_plugin_mgr:disable_module_plugin(
        on_register, ?MODULE, hook_on_register_changed_subscriber_id, 3),
      ok = vmq_plugin_mgr:disable_module_plugin(
        auth_on_register, ?MODULE, hook_change_subscriber_id, 5),
      ok = gen_tcp:close(Socket).
  
  