'Create a volume with a size, then create a
container that can use that volume and run lsbk to test
its size. An http server inside the container uses lsblk to
return the size of the volume when path is not "/is_http".
:param cluster: flocker cluster
:param node: node the contianer and volume will be on.'

def _test_sized_vol_container(self, cluster, node):

    client = get_docker_client(cluster, node.public_address)
    volume_name = random_name(self)
    size = integers(min_value=75, max_value=100).example()
    expression = volume_expression.example()
    size_opt = (''.join(str(size)) + expression)
    size_bytes = int(GiB(size).to_Byte().value)
    self._create_volume(client, volume_name, driver_opts={'size': size_opt})
    http_port = 8080
    container_identifier = self.run_python_container(cluster, node.public_address, {'host_config': client.create_host_config(binds=['/dev:/dev', '{}:/sizedvoldata'.format(volume_name)], port_bindings={http_port: 0}, restart_policy={'Name': 'always'}, privileged=True), 'ports': [http_port]}, SCRIPTS.child('lsblkhttp.py'), [u'/sizedvoldata'], client=client)
    host_port = extract_external_port(client, container_identifier, http_port)
    d = assert_http_server(self, node.public_address, host_port, expected_response=str(size_bytes))
    def _get_datasets(unused_arg):
        return cluster.client.list_datasets_configuration()
    d.addCallback(_get_datasets)
    def _verify_volume_metadata_size(datasets):
        dataset = next((d for d in datasets if (d.metadata.get(u'name') == volume_name)))
        self.assertEqual(int(dataset.metadata.get(u'maximum_size')), size_bytes)
    d.addCallback(_verify_volume_metadata_size)
    return d
