Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.cli_network_test: fix TestNetworkDefault failure on Ubuntu #2170

Conversation

chuanchang
Copy link
Contributor

@chuanchang chuanchang commented Aug 29, 2018

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 chuanchang.jia@gmail.com

Ⅰ. 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

cd test && go test -v -check.f PouchNetworkSuite.TestNetworkDefault

Ⅴ. Special notes for reviews

Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
@Letty5411
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 29, 2018
@codecov-io
Copy link

Codecov Report

Merging #2170 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2170      +/-   ##
==========================================
- Coverage   64.31%   64.28%   -0.04%     
==========================================
  Files         209      209              
  Lines       16725    16725              
==========================================
- Hits        10757    10751       -6     
- Misses       4638     4641       +3     
- Partials     1330     1333       +3
Flag Coverage Δ
#criv1alpha1test 32.97% <ø> (+0.04%) ⬆️
#criv1alpha2test 33.56% <ø> (+0.01%) ⬆️
#integrationtest 39.22% <ø> (-0.01%) ⬇️
#unittest 23.9% <ø> (ø) ⬆️
Impacted Files Coverage Δ
ctrd/image.go 77.19% <0%> (-1.76%) ⬇️
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
cri/v1alpha1/cri.go 63.05% <0%> (-0.35%) ⬇️
daemon/mgr/container.go 56.77% <0%> (ø) ⬆️
apis/server/utils.go 66.66% <0%> (+4.76%) ⬆️

@allencloud allencloud merged commit b375d4b into AliyunContainerService:master Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/network areas/test kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. os/ubuntu size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants