@testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
    def test_describe_instance_attributes(self):
        instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id)

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='blockDeviceMapping')
        bdms = data.get('BlockDeviceMappings', [])
        self.assertNotEmpty(bdms)
        self.assertEqual(1, len(bdms))
        self.assertIn('DeviceName', bdms[0])
        self.assertIn('Ebs', bdms[0])

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='disableApiTermination')
        self.assertIn('DisableApiTermination', data)
        self.assertIn('Value', data['DisableApiTermination'])
        self.assertFalse(data['DisableApiTermination']['Value'])

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='groupSet')
        self.assertIn('Groups', data)
        self.assertNotEmpty(data['Groups'], data)
        self.assertTrue('GroupId' in data['Groups'][0]
                        or data['Groups'][0] in 'GroupName')
        self.assertTrue(data['Groups'][0].get('GroupId')
                        or data['Groups'][0].get('GroupName'))

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='instanceType')
        self.assertIn('InstanceType', data)
        self.assertIn('Value', data['InstanceType'])
        self.assertEqual(CONF.aws.instance_type, data['InstanceType']['Value'])

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='kernel')
        self.assertIn('KernelId', data)

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='ramdisk')
        self.assertIn('RamdiskId', data)

        data = self.client.describe_instance_attribute(
            InstanceId=instance_id, Attribute='rootDeviceName')
        self.assertIn('RootDeviceName', data)
        self.assertIn('Value', data['RootDeviceName'])
        self.assertTrue(data['RootDeviceName']['Value'])

        self.client.terminate_instances(InstanceIds=[instance_id])
        self.get_instance_waiter().wait_delete(instance_id)
dataset/ETHPy150Open openstack/ec2-api/ec2api/tests/functional/api/test_instance_attributes.py/InstanceAttributeTest.test_describe_instance_attributes/swapped operands of `in`