> On Feb. 14, 2017, 4:23 a.m., Kirk Lund wrote: > > geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/NetstatFunction.java, > > line 127 > > <https://reviews.apache.org/r/56633/diff/1/?file=1632709#file1632709line127> > > > > It turns out that -e is not a valid option on Mac OS! > > > > If I execute netstat on Mac OS without --with-lsof, then the output is > > simply: > > > > gfsh>netstat > > ############################################## > > Host: 192.168.1.12 > > OS: Mac OS X 10.11.6 x86_64 > > Member(s): > > loc1 > > ############################################## > > > > NetstatDUnitTest passes on Mac, and there's no sign of any failures in > > gfsh or the locator/member logs. If I debug though I find that the netstat > > command does fail. Executing the same string manually shows us why: > > > > <klund@Kirks-MacBook-Pro>/Users/klund/dev/gemfire/open [1948]$ netstat > > -v -a -e > > netstat: illegal option -- e > > Usage: netstat [-AaLlnW] [-f address_family | -p protocol] > > netstat [-gilns] [-f address_family] > > netstat -i | -I interface [-w wait] [-abdgRtS] > > netstat -s [-s] [-f address_family | -p protocol] [-w wait] > > netstat -i | -I interface -s [-f address_family | -p protocol] > > netstat -m [-m] > > netstat -r [-Aaln] [-f address_family] > > netstat -rs [-s] > > > > So two problems here: 1) it's broken on Mac, 2) we clearly don't have > > test coverage to verify that netstat command works or not. So we'll need to > > fix up NetstatDUnit and probaby add soem integration tests as well.
With the latest changes, netstat and lsof are now working correctly on Mac. - Kirk ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56633/#review165438 ----------------------------------------------------------- On Feb. 15, 2017, 11:23 p.m., Kirk Lund wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56633/ > ----------------------------------------------------------- > > (Updated Feb. 15, 2017, 11:23 p.m.) > > > Review request for geode, Jinmei Liao, Jared Stewart, Kevin Duling, and Ken > Howe. > > > Bugs: GEODE-2474 > https://issues.apache.org/jira/browse/GEODE-2474 > > > Repository: geode > > > Description > ------- > > GEODE-2474: refactor code to use SystemUtils to read OS system props > > Centralize OS system property reading in SystemUtils. > > Refactor NetstatFunction and GemFireVersion to use SystemUtils. > > This fixes use of --with-lsof on Mac (manually tested). I'll add new tests to > NetstatDUnitTest and a new integration test for netstat command in a > follow-up commit & review. > > I have several changes on feature/GEODE-2474 branch which I'll separate into > multiple reviews. I'll do a final precheckin on the entire branch and then > merge the changes in after everything passes review and precheckin. > > > Diffs > ----- > > geode-core/src/main/java/org/apache/geode/internal/GemFireVersion.java > 26d4fb3c5705bffdcdbbc6c261dbe9ffd297642e > geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java > 66c158c93fecac4feb2da56f617f5efc7bba56e1 > > geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/NetstatFunction.java > 5fa30f47187972a209a781eae9024957dc80fb72 > > geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java > 48f176eabc18d3ffa56daaa7da12634a9554f39d > > Diff: https://reviews.apache.org/r/56633/diff/ > > > Testing > ------- > > SystemUtilsJUnitTest > NetstatDUnitTest > > > Thanks, > > Kirk Lund > >