mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Re: Review Request 53699: Add test cases to test logrotate with switch_user set to true and false.
Date Tue, 15 Nov 2016 20:36:02 GMT


> On Nov. 15, 2016, 6:41 a.m., Sivaram Kannan wrote:
> > src/tests/container_logger_tests.cpp, line 782
> > <https://reviews.apache.org/r/53699/diff/2/?file=1563499#file1563499line782>
> >
> >     Should I remove the below function?

Considering how similar these tests are (they only differ by `--switch-user` and the expected
user), instead of removing the test, you can parameterize it instead.

The syntax for doing this in glog looks like this:
```
class UserContainerLoggerTest
  : public ContainerLoggerTest,
    public WithParamInterface<bool> {};


// The tests are parameterized by whether or not `--switch-user` is true/false.
INSTANTIATE_TEST_CASE_P(
    bool,
    UserContainerLoggerTest,
::testing::Values(true, false));
```

And in the test, you can refer to the parameter via:
```
TEST_P(UserContainerLoggerTest, ...)
{
  bool param = GetParam();
}
```


- Joseph


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


On Nov. 14, 2016, 1:51 p.m., Sivaram Kannan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53699/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2016, 1:51 p.m.)
> 
> 
> Review request for mesos and Joseph Wu.
> 
> 
> Bugs: MESOS-5856
>     https://issues.apache.org/jira/browse/MESOS-5856
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add test cases to test logrotate with switch_user set to true and false.
> 
> 
> Diffs
> -----
> 
>   src/tests/container_logger_tests.cpp 1bb94a8461e481983f25a44737e4011ed5fc4b1f 
> 
> Diff: https://reviews.apache.org/r/53699/diff/
> 
> 
> Testing
> -------
> 
> Run the mesos-logrotate-logger with un-priviledged user and verify whether the logs are
getting rotated.
> Run the mesos-logrotate-logger as root user and verify whether the logs are getting rotated.
> 
> 
> Thanks,
> 
> Sivaram Kannan
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message