Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-27 Thread Benjamin Bannier

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

(Updated April 27, 2016, 3:15 a.m.)


Review request for mesos and Adam B.


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-27 Thread Benjamin Bannier


> On April 26, 2016, 6:45 p.m., Alexander Rukletsov wrote:
> > src/tests/slave_authorization_tests.cpp, line 251
> > 
> >
> > s/SlaveAuthorizationTest/Endpoint
> > 
> > I'd say it's more descriptive.
> 
> Benjamin Bannier wrote:
> Right now the tests will appear as e.g., 
> `SlaveAuthorizationTest/EndpointAuthorization.Endpoint/0`. I do not agree 
> that calling them `Endpoint/EndpointAuthorization.Endpoint/0` is more 
> descriptive.

I updated the test names (multiple now), they are now called e.g., 
`Endpoint/SlaveCoarseGrainedAuthorization.AuthorizationRequest/0`.


- Benjamin


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


On April 27, 2016, 10:59 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 27, 2016, 10:59 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-27 Thread Benjamin Bannier

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

(Updated April 27, 2016, 10:59 a.m.)


Review request for mesos and Adam B.


Changes
---

Addressed offline comments from alexr.

* changed name of parameterized test
* enhance fixture
* split test into smaller units


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs (updated)
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [45922, 46318, 46203, 46319, 46569]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 26, 2016, 6:22 p.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 26, 2016, 6:22 p.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Benjamin Bannier


> On April 26, 2016, 6:45 p.m., Alexander Rukletsov wrote:
> > src/tests/slave_authorization_tests.cpp, line 251
> > 
> >
> > s/SlaveAuthorizationTest/Endpoint
> > 
> > I'd say it's more descriptive.

Right now the tests will appear as e.g., 
`SlaveAuthorizationTest/EndpointAuthorization.Endpoint/0`. I do not agree that 
calling them `Endpoint/EndpointAuthorization.Endpoint/0` is more descriptive.


> On April 26, 2016, 6:45 p.m., Alexander Rukletsov wrote:
> > src/tests/slave_authorization_tests.cpp, lines 172-173
> > 
> >
> > Ooops, `{` belongs to a separate line.

Ups, fixed now.


> On April 26, 2016, 6:45 p.m., Alexander Rukletsov wrote:
> > src/tests/slave_authorization_tests.cpp, lines 218-219
> > 
> >
> > Let's not wrap it, it reduces readability!

So be it.


- Benjamin


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


On April 26, 2016, 8:22 p.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 26, 2016, 8:22 p.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Benjamin Bannier

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

(Updated April 26, 2016, 8:22 p.m.)


Review request for mesos and Adam B.


Changes
---

Stylish fixes w/ alexr's guidance.


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs (updated)
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Alexander Rukletsov

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


Fix it, then Ship it!





src/tests/slave_authorization_tests.cpp (line 172)


Ooops, `{` belongs to a separate line.



src/tests/slave_authorization_tests.cpp (line 215)


Let's not wrap it, it reduces readability!



src/tests/slave_authorization_tests.cpp (lines 244 - 249)


Does it make sense to pull it up, around L169?



src/tests/slave_authorization_tests.cpp (line 246)


s/SlaveAuthorizationTest/Endpoint

I'd say it's more descriptive.


- Alexander Rukletsov


On April 26, 2016, 7:59 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 26, 2016, 7:59 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [45922, 46318, 46203, 46319, 46569]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 26, 2016, 7:59 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 26, 2016, 7:59 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Benjamin Bannier

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

(Updated April 26, 2016, 9:59 a.m.)


Review request for mesos and Adam B.


Changes
---

Translate comment into English.


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs (updated)
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Benjamin Bannier


> On April 26, 2016, 9 a.m., Adam B wrote:
> > src/tests/slave_authorization_tests.cpp, line 171
> > 
> >
> > s/some agent's endpoint/the specified agent endpoint/

Done.


> On April 26, 2016, 9 a.m., Adam B wrote:
> > src/tests/slave_authorization_tests.cpp, line 251
> > 
> >
> > What does this parameter say/do?

This is used to construct case names and will be the prefix. I picked the same 
string as used for the fixture in this file for easier discoverablity; note 
however that since parameterized tests construct new fixture names from both 
prefix and case name on the preprocessor level, this will not result in a name 
conflict. In this case the added test cases will be called like this

SlaveAuthorizationTest/EndpointAuthorization.
  Endpoint/0  # GetParam() = "monitor/statistics"
  Endpoint/1  # GetParam() = "monitor/statistics.json"


- Benjamin


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


On April 26, 2016, 9:59 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 26, 2016, 9:59 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-26 Thread Adam B

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




src/tests/slave_authorization_tests.cpp (line 171)


s/some agent's endpoint/the specified agent endpoint/



src/tests/slave_authorization_tests.cpp (line 246)


What does this parameter say/do?


- Adam B


On April 25, 2016, 7:16 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 25, 2016, 7:16 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-25 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [45922, 46318, 46203, 46319, 46569]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 25, 2016, 2:16 p.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 25, 2016, 2:16 p.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-25 Thread Benjamin Bannier

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

(Updated April 25, 2016, 4:16 p.m.)


Review request for mesos and Adam B.


Changes
---

Renamed a var.


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs (updated)
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-25 Thread Benjamin Bannier


> On April 25, 2016, 1:31 p.m., Adam B wrote:
> > src/tests/slave_authorization_tests.cpp, line 176
> > 
> >
> > Shouldn't you give this a more generic name now that it can handle any 
> > (agent) endpoint?

Done.


- Benjamin


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


On April 25, 2016, 4:16 p.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 25, 2016, 4:16 p.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-25 Thread Adam B

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


Fix it, then Ship it!




Looks like a great generalization!
What magic. You must be a wizard.


src/tests/slave_authorization_tests.cpp (line 175)


Shouldn't you give this a more generic name now that it can handle any 
(agent) endpoint?


- Adam B


On April 25, 2016, 2:52 a.m., Benjamin Bannier wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46569/
> ---
> 
> (Updated April 25, 2016, 2:52 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-5164
> https://issues.apache.org/jira/browse/MESOS-5164
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> At the moment we only provide a harness for `GET` methods, but will
> generalize this further once we authorize `POST` requests against
> agent endpoints as well.
> 
> 
> Diffs
> -
> 
>   src/tests/slave_authorization_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/46569/diff/
> 
> 
> Testing
> ---
> 
> make check (OS X, clang trunk w/o optimization)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>



Re: Review Request 46569: Parameterized agent endpoint authorization tests on tested endpoint.

2016-04-25 Thread Benjamin Bannier

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

(Updated April 25, 2016, 11:52 a.m.)


Review request for mesos and Adam B.


Changes
---

Rebased.


Bugs: MESOS-5164
https://issues.apache.org/jira/browse/MESOS-5164


Repository: mesos


Description
---

At the moment we only provide a harness for `GET` methods, but will
generalize this further once we authorize `POST` requests against
agent endpoints as well.


Diffs (updated)
-

  src/tests/slave_authorization_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/46569/diff/


Testing
---

make check (OS X, clang trunk w/o optimization)


Thanks,

Benjamin Bannier