def initialize(self):
        # Extend extension to service mapping dict

        # TODO(sakvarma) Check if this mapping can be removed
        p_const.EXT_TO_SERVICE_MAPPING['cisco_n1kv_profile'] = (n1kv_const.
                                                                CISCO_N1KV)
        self.n1kvclient = n1kv_client.Client()

        self.sync_obj = n1kv_sync.N1kvSyncDriver(db_base_plugin_v2.
                                                 NeutronDbPluginV2())

        eventlet.spawn(self.sync_obj.do_sync)

        # Get VLAN/VXLAN network profiles name
        self.netp_name = {p_const.TYPE_VLAN: (
                              n1kv_const.DEFAULT_VLAN_NETWORK_PROFILE_NAME),
                          p_const.TYPE_VXLAN: (
                              n1kv_const.DEFAULT_VXLAN_NETWORK_PROFILE_NAME)}
        # Ensure network profiles are created on the VSM
        try:
            self._ensure_network_profiles_created_on_vsm()
        except (n1kv_exc.VSMConnectionFailed, n1kv_exc.VSMError):
            LOG.error(_LE("VSM failed to create default network profiles."))
        self.vif_type = portbindings.VIF_TYPE_OVS
        self.vif_details = {portbindings.CAP_PORT_FILTER: True,
                            portbindings.OVS_HYBRID_PLUG: True}
        self.supported_network_types = [p_const.TYPE_VLAN, p_const.TYPE_VXLAN]
    def setUp(self):
        super(TestN1kvSyncDriver, self).setUp()

        # fake n1kv_client.Client.list_md5_hashes() for getting VSM MD5
        # hashes
        list_md5_patcher = mock.patch(n1kv_client.__name__ +
                                      ".Client.list_md5_hashes")
        fake_list_md5 = list_md5_patcher.start()
        fake_list_md5.return_value = self._fake_get_vsm_md5_hashes()

        # fake SyncDriver._get_neutron_resource() for getting resources on
        # Neutron
        self.sync_driver = n1kv_sync.N1kvSyncDriver(None)
        self.sync_driver._get_neutron_resource = mock.MagicMock(
            side_effect=self._fake_get_neutron_res)