'Verify multiple security groups and checks that rules
provided in the both the groups is applied onto VM'

@decorators.idempotent_id('d2f77418-fcc4-439d-b935-72eca704e293')
@decorators.attr(type='slow')
@test.services('compute', 'network')
def test_multiple_security_groups(self):

    tenant = self.primary_tenant
    ip = self._get_server_ip(tenant.access_point, floating=self.floating_ip_access)
    ssh_login = CONF.validation.image_ssh_user
    private_key = tenant.keypair['private_key']
    self.check_vm_connectivity(ip, should_connect=False)
    ruleset = dict(protocol='icmp', direction='ingress')
    self._create_security_group_rule(secgroup=tenant.security_groups['default'], **ruleset)
    self.check_vm_connectivity(ip, username=ssh_login, private_key=private_key, should_connect=True)
