'``DockerClient.add`` accepts a list of ``Volume`` instances which are
mounted within the container.'

def test_add_with_volumes(self):

    docker_dir = FilePath(self.mktemp())
    docker_dir.makedirs()
    docker_dir.child('Dockerfile').setContent('FROM    busybox\nCMD    ["/bin/sh",        "-c",    "touch    /mnt1/a;    touch    /mnt2/b"]')
    image = DockerImageBuilder(test=self, source_dir=docker_dir)
    d = image.build()
    def image_built(image_name):
        unit_name = random_name(self)
        path1 = FilePath(self.mktemp())
        path1.makedirs()
        path2 = FilePath(self.mktemp())
        path2.makedirs()
        d = self.start_container(unit_name=unit_name, image_name=image_name, volumes=[Volume(node_path=path1, container_path=FilePath('/mnt1')), Volume(node_path=path2, container_path=FilePath('/mnt2'))], expected_states=(u'inactive',))
        return d.addCallback((lambda _: (path1, path2)))
    d.addCallback(image_built)
    def started((path1, path2)):
        expected1 = path1.child('a')
        expected2 = path2.child('b')
        for _ in range(100):
            if (expected1.exists() and expected2.exists()):
                return
            else:
                time.sleep(0.1)
        self.fail('Files    never    created.')
    return d.addCallback(started)
