> On July 8, 2015, 9:07 p.m., Timothy Chen wrote:
> > src/tests/docker_containerizer_tests.cpp, line 3011
> > <https://reviews.apache.org/r/36185/diff/3/?file=1002346#file1002346line3011>
> >
> >     nit: I think we should name this to reflect the test like 
> > org_apache_mesos_TestSlavePreLaunchDockerHook

The name is from mesos/src/examples/test_hook_module.cpp, so could not change 
it here.


> On July 8, 2015, 9:07 p.m., Timothy Chen wrote:
> > src/tests/docker_containerizer_tests.cpp, line 3114
> > <https://reviews.apache.org/r/36185/diff/3/?file=1002346#file1002346line3114>
> >
> >     What exactly is this test trying to verify? I don't see any hook 
> > interactions?

This test would create a file in sandbox

```cpp
LOG(INFO) << "Executing 'slavePreLaunchDockerHook'";
return os::touch(sandboxDirectory + "/foo");
```

And when the directory mount to docker, verify the file in docker exist or not

```cpp
command.set_value("test -f " + flags.docker_sandbox_directory + "/foo");
```

Currently, all hook tests are put in `./src/tests/hook_tests.cpp`. It should be 
better move this test case to that file, but this test case also depends on 
`MockDockerContainerizer` and `MockDocker`. How about move `MockDocker` and 
`MockDockerContainerizer` to `mesos/src/tests/mesos.hpp`?


- haosdent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36185/#review90992
-----------------------------------------------------------


On July 8, 2015, 5:06 p.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36185/
> -----------------------------------------------------------
> 
> (Updated July 8, 2015, 5:06 p.m.)
> 
> 
> Review request for mesos and Timothy Chen.
> 
> 
> Bugs: MESOS-2588
>     https://issues.apache.org/jira/browse/MESOS-2588
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Create pre-launch hook before a docker container launches in slave.
> 
> 
> Diffs
> -----
> 
>   include/mesos/hook.hpp 0995c249e9f07c6c4a26d1c5c369d48bb8056f1f 
>   src/examples/test_hook_module.cpp d61cd557d8e44e5089f324edf97b0335a4ededab 
>   src/hook/manager.hpp 47e8eb7d54d55049d054cf9b1225e67333f22adc 
>   src/hook/manager.cpp 0108534c1fc527a0c66d201d7a5232e80b9928bf 
>   src/slave/containerizer/docker.cpp cfb60177fe48ec0eeab12ff392c6c9f89634b92f 
>   src/tests/docker_containerizer_tests.cpp 
> a3da786c1b733e9dd4abf1d02d5dae051393d921 
> 
> Diff: https://reviews.apache.org/r/36185/diff/
> 
> 
> Testing
> -------
> 
> # Add a new unit test 
> "DockerContainerizerTest.ROOT_DOCKER_VerifySlavePreLaunchDockerHook"
> make check -j8 GTEST_FILTER=-"*"
> sudo ./bin/mesos-tests.sh --verbose 
> --gtest_filter=DockerContainerizerTest.ROOT_DOCKER_VerifySlavePreLaunchDockerHook
> 
> 
> Thanks,
> 
> haosdent huang
> 
>

Reply via email to