Win CNM plugin unit tests fail if Agent is running on host

Bug #1806408 reported by Michał Kostrzewa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Unassigned
OpenContrail
Fix Committed
Undecided
Unassigned

Bug Description

Seems like we hardcoded IP and port to localhost:9091 in test cases, instead of using URL provided by httptest package.

2018-11-30 17:29:56.915071 | test-runner | [1543595396] [1mCore test suite [0m - 29/31 specs time="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:nonexistingNetwork by name: 404 Not Found: virtual-network default-domain:agatka:nonexistingNetwork"
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:nonexistingTenant:test_net by name: 404 Not Found: virtual-network default-domain:nonexistingTenant:test_net"
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0mtime="2018-11-30T08:29:56-08:00" level=error msg="Failed to get virtual network default-domain:agatka:test_net by name: 404 Not Found: virtual-network default-domain:agatka:test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=debug msg="Got Contrail network test_net"
2018-11-30 17:29:56.915071 | test-runner | time="2018-11-30T08:29:56-08:00" level=warning msg="Not supported DNS method "
2018-11-30 17:29:56.915071 | test-runner | [32m+ [0m [32m+ [0m [32m+ [0m [33mP [0m [33mP [0m
2018-11-30 17:29:56.915071 | test-runner | [90m------------------------------ [0m
2018-11-30 17:29:56.915071 | test-runner | [91m [1m+ Failure in Spec Setup (BeforeEach) [0.003 seconds] [0m
2018-11-30 17:29:56.915071 | test-runner | [90mCore tests [0m [0mCreateEndpoint [0m [91m [1m[BeforeEach] Controller network and local network exist [0m [0mreturns container resource allocated in controller [0m
2018-11-30 17:29:56.915071 | test-runner | [37mJ:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/core/driver_core/driver_core_test.go:244 [0m
2018-11-30 17:29:56.915071 | test-runner |
2018-11-30 17:29:56.915071 | test-runner | [91mExpected error:
2018-11-30 17:29:56.915071 | test-runner | <*net.OpError | 0xc00008e9b0>: {
2018-11-30 17:29:56.915071 | test-runner | Op: "listen",
2018-11-30 17:29:56.915071 | test-runner | Net: "tcp",
2018-11-30 17:29:56.915071 | test-runner | Source: nil,
2018-11-30 17:29:56.915071 | test-runner | Addr: {
2018-11-30 17:29:56.915071 | test-runner | IP: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1],
2018-11-30 17:29:56.915071 | test-runner | Port: 9091,
2018-11-30 17:29:56.915071 | test-runner | Zone: "",
2018-11-30 17:29:56.915071 | test-runner | },
2018-11-30 17:29:56.915071 | test-runner | Err: {Syscall: "bind", Err: 0x271d},
2018-11-30 17:29:56.915071 | test-runner | }
2018-11-30 17:29:56.915071 | test-runner | listen tcp 127.0.0.1:9091: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
2018-11-30 17:29:56.915071 | test-runner | not to have occurred [0m
2018-11-30 17:29:56.915071 | test-runner |
2018-11-30 17:29:56.915071 | test-runner | J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/core/driver_core/driver_core_test.go:464
2018-11-30 17:29:56.915071 | test-runner | [90m------------------------------ [0m
2018-11-30 17:29:56.915071 | test-runner | [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m [36mS [0m
2018-11-30 17:29:56.915071 | test-runner |
2018-11-30 17:29:56.915071 | test-runner | [91m [1mSummarizing 1 Failure: [0m
2018-11-30 17:29:56.915071 | test-runner |
2018-11-30 17:29:56.915071 | test-runner | [91m [1m[Fail] [0m [90mCore tests [0m [0mCreateEndpoint [0m [91m [1m[BeforeEach] Controller network and local network exist [0m [0mreturns container resource allocated in controller [0m
2018-11-30 17:29:56.915071 | test-runner | [37mJ:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/core/driver_core/driver_core_test.go:464 [0m
2018-11-30 17:29:56.915071 | test-runner |
2018-11-30 17:29:56.915071 | test-runner | [1m [91mRan 14 of 31 Specs in 0.012 seconds [0m
2018-11-30 17:29:56.915071 | test-runner | [1m [91mFAIL! [0m -- [32m [1m13 Passed [0m | [91m [1m1 Failed [0m | [33m [1m2 Pending [0m | [36m [1m15 Skipped [0m --- FAIL: TestCore (0.02s)
2018-11-30 17:29:56.915071 | test-runner | FAIL
2018-11-30 17:30:00.369901 | test-runner | ====================================================================================================
2018-11-30 17:30:00.389384 | test-runner | Logs from 10.7.0.95:
2018-11-30 17:30:00.723306 | test-runner | ----------------------------------------------------------------------------------------------------
2018-11-30 17:30:00.748269 | test-runner | Contents of C:\ProgramData\Contrail\var\log\contrail\contrail-cnm-plugin.log:
2018-11-30 17:30:00.764637 | test-runner | <EMPTY>
2018-11-30 17:30:00.783875 | test-runner | ====================================================================================================
CNM Plugin.Tests for module in driver_core.test.passes tests.txt
Open with Google Docs
Displaying CNM Plugin.Tests for module in driver_core.test.passes tests.txt.

2018-11-30 17:30:17.049071 | test-runner | panic: runtime error: invalid memory address or nil pointer dereference
2018-11-30 17:30:17.049071 | test-runner | [signal 0xc0000005 code=0x0 addr=0x20 pc=0x7a36cb]

goroutine 1 [running]:
net/http/httptest.(*Server).Start(0xc000042f00)
 C:/tools/go/src/net/http/httptest/server.go:107 +0x4b
github.com/onsi/gomega/ghttp.(*Server).Start(0xc000112180)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/onsi/gomega/ghttp/test_server.go:185 +0x35
github.com/Juniper/contrail-windows-docker-driver/logging_test.testServer(0xc000044180, 0x0)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/logging/logging_test.go:268 +0x90
github.com/Juniper/contrail-windows-docker-driver/logging_test.glob..func1.2()
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/logging/logging_test.go:132 +0x7b
github.com/onsi/ginkgo/internal/suite.(*Suite).PushContainerNode(0xc000090190, 0x8a1baf, 0x1b, 0xc00006ddf8, 0x0, 0xbaa116, 0x84, 0x82, 0xc000142120, 0x11c)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/onsi/ginkgo/internal/suite/suite.go:144 +0x15c
github.com/onsi/ginkgo.Context(0x8a1baf, 0x1b, 0xc00006ddf8, 0x4eed01)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/onsi/ginkgo/ginkgo_dsl.go:311 +0xb4
github.com/Juniper/contrail-windows-docker-driver/logging_test.glob..func1()
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/Juniper/contrail-windows-docker-driver/logging/logging_test.go:130 +0xd2
github.com/onsi/ginkgo/internal/suite.(*Suite).PushContainerNode(0xc000090190, 0x89980e, 0xd, 0x8b6df8, 0x0, 0xbaa116, 0x84, 0x29, 0x0, 0x0)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/onsi/ginkgo/internal/suite/suite.go:144 +0x15c
github.com/onsi/ginkgo.Describe(0x89980e, 0xd, 0x8b6df8, 0x701279)
 J:/Jenkins/workspace/WinContrail/winci-server2016-prod/src/github.com/onsi/ginkgo/ginkgo_dsl.go:282 +0xb4

2018-11-30 17:30:20.000148 | test-runner | ====================================================================================================
2018-11-30 17:30:20.027657 | test-runner | Logs from 10.7.0.95:
2018-11-30 17:30:20.288638 | test-runner | ----------------------------------------------------------------------------------------------------
2018-11-30 17:30:20.321759 | test-runner | Contents of C:\ProgramData\Contrail\var\log\contrail\contrail-cnm-plugin.log:
2018-11-30 17:30:20.340669 | test-runner | <EMPTY>
2018-11-30 17:30:20.357666 | test-runner | ====================================================================================================
CNM Plugin.Tests for module in logging.test.passes tests.txt
Open with Google Docs
Displaying CNM Plugin.Tests for module in driver_core.test.passes tests.txt.

Tags: windows
description: updated
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/47978
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/47978
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/0799f4e7b676451b70a86cc32d33b036e080f41b
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 0799f4e7b676451b70a86cc32d33b036e080f41b
Author: Michal Kostrzewa <email address hidden>
Date: Mon Dec 3 15:31:25 2018 +0100

Use testserver for Agent in unittests.

Change-Id: I2f0027b8a029e714b66f1291947c667074accd9d
Closes-Bug: #1806408

Changed in opencontrail:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.