> On June 23, 2016, 7:34 p.m., Neil Conway wrote: > > src/tests/persistent_volume_endpoints_tests.cpp, line 527 > > <https://reviews.apache.org/r/48968/diff/1/?file=1428709#file1428709line527> > > > > Why are we doing `create-volumes` twice but not testing > > `destroy-volumes`? > > > > Note that when we add a test for `destroy-volumes`, we should be sure > > to ensure that the test would fail if we removed the newly added validation > > code. i.e., you'll probably want to create a volume that *would* have been > > destroyed by the improperly validated / mangled `destroy-volumes` call.
Whoops, that should've been `destroy-volumes`. Thanks Neil! Good point Re: clarifying the nature of the failure. I added checks to ensure that the body of the BadRequest response has the correct content, indicating a failure due to an invalid resource. What do you think? > On June 23, 2016, 7:34 p.m., Neil Conway wrote: > > src/tests/reservation_endpoints_tests.cpp, line 863 > > <https://reviews.apache.org/r/48968/diff/1/?file=1428710#file1428710line863> > > > > Seems like this would fail regardless, no? i.e., we want to ensure the > > unreserve request would succeed (=> test would fail) without the newly > > added validation logic. Good point, see my comment above regarding destroying volumes; I did the same thing for the reservation tests. - Greg ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/48968/#review139289 ----------------------------------------------------------- On June 23, 2016, 9:29 p.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/48968/ > ----------------------------------------------------------- > > (Updated June 23, 2016, 9:29 p.m.) > > > Review request for mesos, Anand Mazumdar, Neil Conway, and Vinod Kone. > > > Bugs: MESOS-5664 > https://issues.apache.org/jira/browse/MESOS-5664 > > > Repository: mesos > > > Description > ------- > > This patch fixes a bug in which invalid resources supplied > to the master's '/reserve', '/unreserve', '/create-volumes', > and '/destroy-volumes' HTTP endpoints were silently > ignored, without returning an error as expected. > > > Diffs > ----- > > src/master/http.cpp 70f084b84db90fde20c05d2354be190f28e72996 > src/tests/persistent_volume_endpoints_tests.cpp > b66c337808af673b6f98bbc9807d5bd1cb34731e > src/tests/reservation_endpoints_tests.cpp > e029f4e1b1da434fd6eb267675528ab97370be24 > > Diff: https://reviews.apache.org/r/48968/diff/ > > > Testing > ------- > > New tests were added - `PersistentVolumeEndpointsTest.InvalidVolume` and > `ReservationEndpointsTest.InvalidResource` - to check that requests to the > affected endpoints will fail correctly when invalid resources are supplied. I > checked that these tests failed before the fix, and passed after. > > `make check` on OSX was used to test as well. > > > Thanks, > > Greg Mann > >
