def test_nexus_enable_vlan_cmd_on_different_hosts(self):

        #
        # First vlan should be configured without 'add' keyword since
        # the get call does not return 'switchport trunk allowed vlan'.
        #
        with self._mock_config_trunk(allowed_vlan_cfg_present=False):
            with self._create_resources():
                self.assertTrue(self._is_interface_initialized(
                    ['1/1', '1/2']))
                self.assertTrue(self._is_vlan_configured(
                    '1/1', '1000',
                    vlan_creation_expected=True))
                self.mock_ncclient.reset_mock()
                self.mock_top_bound_segment.return_value = BOUND_SEGMENT2

                # Second vlan should be configured without 'add' keyword since
                # the get call does not return 'switchport trunk allowed vlan'
                # since it is on the second host.
                #
                with self._mock_config_trunk(allowed_vlan_cfg_present=False):
                    with self._create_resources(name=NETWORK_NAME_2,
                                                device_id=DEVICE_ID_2,
                                                cidr=CIDR_2,
                                                host_id=COMP_HOST_NAME_2):
                        self.assertTrue(self._is_vlan_configured(
                            '1/2', '1001',
                            vlan_creation_expected=True
                        ))

                    # Return to first segment for delete port calls.
                    self.mock_top_bound_segment.return_value = BOUND_SEGMENT1

# TODO(rpothier) Add back in provider segment support.
#    def _test_nexus_providernet(self, auto_create, auto_trunk,
#                                name=P_VLAN_NAME):
#
#        cisco_config.cfg.CONF.set_override('provider_vlan_auto_create',
#            auto_create, 'ml2_cisco')
#        cisco_config.cfg.CONF.set_override('provider_vlan_auto_trunk',
#            auto_trunk, 'ml2_cisco')
#        cisco_config.cfg.CONF.set_override('provider_vlan_name_prefix',
#            name, 'ml2_cisco')
#
#        with self._create_resources(name='net1', cidr=CIDR_1):
#            name_len = const.NEXUS_MAX_VLAN_NAME_LEN - len(str(VLAN_START))
#            self.assertEqual(auto_create,
#                             self._is_in_nexus_cfg(['vlan-id-create-delete',
#                                 'vlan-name', name[:name_len]
#                                 + str(VLAN_START)]))
#            self.assertEqual(auto_trunk, self._is_in_nexus_cfg(['trunk']))
#            self.mock_ncclient.reset_mock()
#        self.assertEqual(auto_create,
#                         self._is_in_nexus_cfg(['no',
#                                                'vlan-id-create-delete']))
#        self.assertEqual(auto_trunk,
#                         self._is_in_nexus_cfg(['trunk', 'remove']))

# TODO(rpothier) Add back in provider segment support.
#    def test_nexus_providernet(self):
#        #configure a provider net segment
#        PROV_SEGMENT = {api.NETWORK_TYPE: p_const.TYPE_VLAN,
#                        api.PHYSICAL_NETWORK: PHYS_NET,
#                        api.SEGMENTATION_ID: VLAN_START,
#                        api.ID: DEVICE_ID_1,
#                        api.PROVIDER_SEGMENT: True}
#
#        # Mock port context values for provider_segments.
#        self.mock_top_bound_segment.return_value = PROV_SEGMENT
#
#        self._test_nexus_providernet(auto_create=False, auto_trunk=False)
#        self.mock_ncclient.reset_mock()
#        self._test_nexus_providernet(auto_create=False, auto_trunk=True)
#        self.mock_ncclient.reset_mock()
#        self._test_nexus_providernet(auto_create=True, auto_trunk=False)
#        self.mock_ncclient.reset_mock()
#        self._test_nexus_providernet(auto_create=True, auto_trunk=True)
#        self.mock_ncclient.reset_mock()
#        self._test_nexus_providernet(auto_create=True, auto_trunk=True,
#                                     name=P_VLAN_NAME_TOO_LONG)
Verify the syntax of the command to enable a vlan on an intf.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py/TestCiscoPortsV2.test_nexus_enable_vlan_cmd_on_different_hosts