New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arquillian Cube - Drone] Invalid bind for vnc / flv2mp4 containers running under Windows #762

Closed
georgwolf opened this Issue Jul 19, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@georgwolf
Contributor

georgwolf commented Jul 19, 2017

Issue Overview

Vnc and flv2mp4 containers are configured with invalid binds when runnig Cube-Drone under Windows using docker-machine.

Configured binding is looking like 'C:\Users....tmp1500472847216:/recording:rw but should be something like '/c/Users/.../.tmp1500472847216:/recording:rw to match the default shared path inside the docker-machine.

Steps To Reproduce
  1. Run any test using Cube-Drone under Windows (docker-machine) with vnc recording enabled.
Additional Information

Exception:

org.arquillian.cube.spi.CubeControlException: Could not create vnc
at org.arquillian.cube.spi.CubeControlException.failedCreate(CubeControlException.java:15)
at org.arquillian.cube.docker.impl.model.DockerCube.create(DockerCube.java:117)
at org.arquillian.cube.docker.drone.VncRecorderLifecycleManager.startRecording(VncRecorderLifecycleManager.java:38)
<snip>
Caused by: java.lang.IllegalArgumentException: Error parsing Bind 'C:\Users\...\.tmp1500472847216:/recording:rw'

This can be worked around using an spi (assuming test is run somewhere below the default shared directory C:\Users):

public void install(@Observes(precedence = -10) final CubeDockerConfiguration configuration) {
  if(SystemUtils.IS_OS_WINDOWS) {
    final CubeContainer vncContainer = this.seleniumContainersInstanceProducer.get().getVncContainer();
    final CubeContainer videoConverterContainer = this.seleniumContainersInstanceProducer.get().getVideoConverterContainer();
    
    vncContainer.setBinds(
        vncContainer.getBinds()
            .stream()
            .map(s -> s.replaceFirst("C:\\\\", "/c/").replace("\\", "/"))
            .collect(Collectors.toCollection(ArrayList::new)));

    videoConverterContainer.setBinds(
        videoConverterContainer.getBinds()
            .stream()
            .map(s -> s.replaceFirst("C:\\\\", "/c/").replace("\\", "/"))
            .collect(Collectors.toCollection(ArrayList::new)));
  }
}
@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Jul 21, 2017

Member

Thank you so much for this input. Well actually what I would do is put this on the construction phase of vncContainer and videoConverter so all configuration things are at the same page https://github.com/arquillian/arquillian-cube/blob/master/docker/drone/src/main/java/org/arquillian/cube/docker/drone/SeleniumContainers.java#L15

Would you like to submit a PR with these changes?

Member

lordofthejars commented Jul 21, 2017

Thank you so much for this input. Well actually what I would do is put this on the construction phase of vncContainer and videoConverter so all configuration things are at the same page https://github.com/arquillian/arquillian-cube/blob/master/docker/drone/src/main/java/org/arquillian/cube/docker/drone/SeleniumContainers.java#L15

Would you like to submit a PR with these changes?

@georgwolf

This comment has been minimized.

Show comment
Hide comment
@georgwolf

georgwolf Jul 25, 2017

Contributor

Sure, the work around was more from an enduser perspective. I'll see if I can come up with a generic solution.

Contributor

georgwolf commented Jul 25, 2017

Sure, the work around was more from an enduser perspective. I'll see if I can come up with a generic solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment