Fixed a bug in port mapping tests due to os::shell refactor. Review: https://reviews.apache.org/r/37544
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ccc4c605 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ccc4c605 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ccc4c605 Branch: refs/heads/master Commit: ccc4c605378a6f7c9f1cb1d458c6d2d24613e7ae Parents: 8446734 Author: Jie Yu <[email protected]> Authored: Mon Aug 17 12:46:29 2015 -0700 Committer: Jie Yu <[email protected]> Committed: Mon Aug 17 14:27:30 2015 -0700 ---------------------------------------------------------------------- src/tests/containerizer/port_mapping_tests.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ccc4c605/src/tests/containerizer/port_mapping_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/containerizer/port_mapping_tests.cpp b/src/tests/containerizer/port_mapping_tests.cpp index d3526b8..65cf55f 100644 --- a/src/tests/containerizer/port_mapping_tests.cpp +++ b/src/tests/containerizer/port_mapping_tests.cpp @@ -961,12 +961,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_NC_HostToContainerTCP) // connection couldn't be established.. ostringstream command3; command3 << "printf hello2 | nc localhost " << invalidPort; - Try<string> invalid = os::shell(command3.str()); - ASSERT_ERROR(invalid); - - // When the above command fails, it prints an error message that - // ends with the error exit code, which happens to be 256. - EXPECT_TRUE(strings::contains(invalid.error(), "256")); + ASSERT_ERROR(os::shell(command3.str())); // Send to 'public IP' and 'port'. ostringstream command4; @@ -977,12 +972,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_NC_HostToContainerTCP) // connection couldn't be established. ostringstream command5; command5 << "printf hello4 | nc " << hostIP << " " << invalidPort; - Try<string> connect = os::shell(command5.str()); - ASSERT_ERROR(connect); - - // As above, we check that the error message contains the - // expected error code. - EXPECT_TRUE(strings::contains(connect.error(), "256")); + ASSERT_ERROR(os::shell(command5.str())); EXPECT_SOME_EQ("hello1", os::read(trafficViaLoopback)); EXPECT_SOME_EQ("hello3", os::read(trafficViaPublic));
