> On Nov. 20, 2014, 5:09 p.m., Ben Mahler wrote: > > src/tests/active_user_test_helper.cpp, lines 31-60 > > <https://reviews.apache.org/r/26894/diff/2/?file=769867#file769867line31> > > > > Curious, do we have to do all this Subprocess stuff with 'whoami' or > > can we just use os::user? > > > > ``` > > Result<std::string> user = os::user(); > > > > if (user.isSome() && user.get() == expected) { > > return 0; > > } > > > > return 1; > > ``` > > > > If not, let's document why whoami is needed!
Jesus - that should work just fine, but got stuck thinking about whoami from the previous attempts. Thanks! :D > On Nov. 20, 2014, 5:09 p.m., Ben Mahler wrote: > > src/tests/active_user_test_helper.cpp, line 26 > > <https://reviews.apache.org/r/26894/diff/2/?file=769867#file769867line26> > > > > I think you'll just want to use cout and cerr, otherwise you should > > initialize glog first. > > > > Note that we usually print out Usage information without using LOG(...). Will do. > On Nov. 20, 2014, 5:09 p.m., Ben Mahler wrote: > > src/tests/active_user_test_helper.cpp, lines 21-23 > > <https://reviews.apache.org/r/26894/diff/2/?file=769867#file769867line21> > > > > How about: > > > > // This helper program takes a an expected user. > > // Returns 0 if the current username equals the expected username. > > // Returns 1 otherwise. Done. - Niklas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/26894/#review62478 ----------------------------------------------------------- On Nov. 19, 2014, 8:53 a.m., Niklas Nielsen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/26894/ > ----------------------------------------------------------- > > (Updated Nov. 19, 2014, 8:53 a.m.) > > > Review request for mesos and Ben Mahler. > > > Bugs: MESOS-1359 > https://issues.apache.org/jira/browse/MESOS-1359 > > > Repository: mesos-git > > > Description > ------- > > The 'nobody' user is restricted on some systems from shell access and broke > the task.user tests (which have been disabled since then). > With the command.shell field, the test can run the command directly. > > > Diffs > ----- > > src/Makefile.am 0fe7dd067b80cfe802201482eed63a30ac8dcbd4 > src/tests/active_user_test_helper.cpp PRE-CREATION > src/tests/slave_tests.cpp 4675dac95e7a9964bdf22259b85d6dd0081af708 > > Diff: https://reviews.apache.org/r/26894/diff/ > > > Testing > ------- > > make check on linux as root > > > Thanks, > > Niklas Nielsen > >