test.cli_network_test: fix TestNetworkDefault failure on Ubuntu #2170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The command output of "ip r | grep default" contains extra "proto static" on Ubuntu host, which is inconsistent with output in container, the actual error as follows:
FAIL: cli_network_test.go:59: PouchNetworkSuite.TestNetworkDefault cli_network_test.go:101: c.Assert(err, check.IsNil) ... value *errors.errorString = &errors.errorString{s:"\nCommand: /usr/local/bin/pouch run --name TestNetworkDefault --net host registry.hub.docker.com/library/busybox:1.28 ip r\nExitCode: 0\nError: <nil>\nStdout: default via 10.0.2.2 dev enp0s3 metric 100 \n10.0.2.0/24 dev enp0s3 scope link src 10.0.2.15 metric 100 \n169.254.0.0/16 dev enp0s8 scope link metric 1000 \n192.168.5.0/24 dev p0 scope link src 192.168.5.1 \n192.168.56.0/24 dev enp0s8 scope link src 192.168.56.101 metric 100 \n\nStderr: \n\nFailures:\nExpected stdout to contain \"default via 10.0.2.2 dev enp0s3 metric 100 \\n\""} ("\nCommand: /usr/local/bin/pouch run --name TestNetworkDefault --net host registry.hub.docker.com/library/busybox:1.28 ip r\nExitCode: 0\nError: <nil>\nStdout: default via 10.0.2.2 dev enp0s3 metric 100 \n10.0.2.0/24 dev enp0s3 scope link src 10.0.2.15 metric 100 \n169.254.0.0/16 dev enp0s8 scope link metric 1000 \n192.168.5.0/24 dev p0 scope link src 192.168.5.1 \n192.168.56.0/24 dev enp0s8 scope link src 192.168.56.101 metric 100 \n\nStderr: \n\nFailures:\nExpected stdout to contain \"default via 10.0.2.2 dev enp0s3 metric 100 \\n\"") OOPS: 0 passed, 1 FAILED --- FAIL: Test (1.46s)Signed-off-by: Alex Jia [email protected]
Ⅰ. Describe what this PR did
to remove extra "proto static" string of "ip r" output on Ubuntu host
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
None
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews