'Test to update admin_state_up attribute of instance port
1. Check public and project connectivity before updating
admin_state_up attribute of instance port to False
2. Check public and project connectivity after updating
admin_state_up attribute of instance port to False
3. Check public and project connectivity after updating
admin_state_up attribute of instance port to True'

@decorators.idempotent_id('f5dfcc22-45fd-409f-954c-5bd500d7890b')
@testtools.skipUnless(CONF.network_feature_enabled.port_admin_state_change, "Changing    a    port's    admin    state    is    not    supported    by    the    test    environment")
@decorators.attr(type='slow')
@test.services('compute', 'network')
def test_update_instance_port_admin_state(self):

    self._setup_network_and_servers()
    (_, server) = self.floating_ip_tuple
    server_id = server['id']
    port_id = self.os_admin.ports_client.list_ports(device_id=server_id)['ports'][0]['id']
    server_pip = server['addresses'][self.network['name']][0]['addr']
    server2 = self._create_server(self.network)
    server2_fip = self.create_floating_ip(server2)
    private_key = self._get_server_key(server2)
    ssh_client = self.get_remote_client(server2_fip['floating_ip_address'], private_key=private_key, server=server2)
    self.check_public_network_connectivity(should_connect=True, msg='before    updating    admin_state_up    of    instance    port    to    False')
    self.check_remote_connectivity(ssh_client, dest=server_pip, should_succeed=True)
    self.ports_client.update_port(port_id, admin_state_up=False)
    self.check_public_network_connectivity(should_connect=False, msg='after    updating    admin_state_up    of    instance    port    to    False', should_check_floating_ip_status=False)
    self.check_remote_connectivity(ssh_client, dest=server_pip, should_succeed=False)
    self.ports_client.update_port(port_id, admin_state_up=True)
    self.check_public_network_connectivity(should_connect=True, msg='after    updating    admin_state_up    of    instance    port    to    True')
    self.check_remote_connectivity(ssh_client, dest=server_pip, should_succeed=True)
