def _do_test_glance_cli(self, cmd):
        self.cleanup()
        self.start_servers()

        # Add a non-public image using the given glance command line
        exitcode, out, err = execute("echo testdata | %s" % cmd)

        self.assertEqual(0, exitcode)
        image_id = out.strip()[25:]

        # Verify the attributes of the image
        headers = {'X-Auth-Token': keystone_utils.pattieblack_token}
        path = "http://%s:%d/v1/images/%s" % ("0.0.0.0", self.api_port,
                                              image_id)
        http = httplib2.Http()
        response, content = http.request(path, 'HEAD', headers=headers)
        self.assertEqual(response.status, 200)
        self.assertEqual(response['x-image-meta-name'], "MyImage")
        self.assertEqual(response['x-image-meta-is_public'], "False")
        self.assertEqual(response['x-image-meta-owner'],
                         keystone_utils.pattieblack_id)

        image_id = response['x-image-meta-id']

        # Test that we can update is_public through the CLI
        args = (self.api_port, keystone_utils.pattieblack_token, image_id)
        cmd = "bin/glance --port=%d --auth_token=%s update %s is_public=True"
        exitcode, out, err = execute(cmd % args)

        self.assertEqual(0, exitcode)
        self.assertEqual('Updated image %s' % image_id, out.strip())

        # Verify the appropriate change was made
        headers = {'X-Auth-Token': keystone_utils.pattieblack_token}
        path = "http://%s:%d/v1/images/%s" % ("0.0.0.0", self.api_port,
                                              image_id)
        http = httplib2.Http()
        response, content = http.request(path, 'HEAD', headers=headers)
        self.assertEqual(response.status, 200)
        self.assertEqual(response['x-image-meta-name'], "MyImage")
        self.assertEqual(response['x-image-meta-is_public'], "True")
        self.assertEqual(response['x-image-meta-owner'],
                         keystone_utils.pattieblack_id)

        # Test that admin can change the owner
        args = (self.api_port, keystone_utils.admin_token, image_id)
        cmd = "bin/glance --port=%d --auth_token=%s update %s owner=froggy"
        exitcode, out, err = execute(cmd % args)

        self.assertEqual(0, exitcode)
        self.assertEqual('Updated image %s' % image_id, out.strip())

        # Verify the appropriate change was made
        headers = {'X-Auth-Token': keystone_utils.admin_token}
        path = "http://%s:%d/v1/images/%s" % ("0.0.0.0", self.api_port,
                                              image_id)
        http = httplib2.Http()
        response, content = http.request(path, 'HEAD', headers=headers)
        self.assertEqual(response.status, 200)
        self.assertEqual(response['x-image-meta-name'], "MyImage")
        self.assertEqual(response['x-image-meta-is_public'], "True")
        self.assertEqual(response['x-image-meta-owner'], "froggy")

        # Test that admin can remove the owner
        args = (self.api_port, keystone_utils.admin_token, image_id)
        cmd = "bin/glance --port=%d --auth_token=%s update %s owner="
        exitcode, out, err = execute(cmd % args)

        self.assertEqual(0, exitcode)
        self.assertEqual('Updated image %s' % image_id, out.strip())

        # Verify the appropriate change was made
        headers = {'X-Auth-Token': keystone_utils.admin_token}
        path = "http://%s:%d/v1/images/%s" % ("0.0.0.0", self.api_port,
                                              image_id)
        http = httplib2.Http()
        response, content = http.request(path, 'HEAD', headers=headers)
        self.assertEqual(response.status, 200)
        self.assertEqual(response['x-image-meta-name'], "MyImage")
        self.assertEqual(response['x-image-meta-is_public'], "True")
        self.assertEqual(response['x-image-meta-owner'], '')

        self.stop_servers()
Testing the infer_shape with a matrix.
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/tests/functional/test_private_images.py/TestPrivateImagesCli._do_test_glance_cli--crossover with--dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/tensor/tests/test_extra_ops.py/test_Unique.test_infer_shape_matrix