From fe966240a8c0beaf559ed4697a0180bc6386a94d Mon Sep 17 00:00:00 2001 From: Alex Jia Date: Wed, 29 Aug 2018 15:56:00 +0800 Subject: [PATCH] test.cli_network_test: fix TestNetworkDefault failure on Ubuntu Signed-off-by: Alex Jia --- test/cli_network_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/cli_network_test.go b/test/cli_network_test.go index da79cb4d0..c47c8fdfa 100644 --- a/test/cli_network_test.go +++ b/test/cli_network_test.go @@ -88,7 +88,13 @@ func (suite *PouchNetworkSuite) TestNetworkDefault(c *check.C) { } { cmd := "ip r |grep default" + // The command output of "ip r | grep default" contains extra "proto static" + // on Ubuntu host, which is inconsistent with output in container routeOnHost := icmd.RunCommand("bash", "-c", cmd).Stdout() + if strings.Contains(routeOnHost, "proto static") { + // keep command output consistent between Ubuntu host and container + routeOnHost = strings.Replace(routeOnHost, " proto static ", "", -1) + } // Assign the host network to a container. expct := icmd.Expected{ ExitCode: 0,