Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2517)

Issue 97560044: Disallow network access for provider tests

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by wallyworld
Modified:
9 years, 11 months ago
Reviewers:
mp+219994, axw
Visibility:
Public.

Description

Disallow network access for provider tests Outgoing network access is disabled for provider tests. This lead to test failures for the maas provider which were fixed. The "live" Joyent provider tests were deleted as they never worked properly anyway and other issues surfaced. Part of the implementation removed the contained LoggingSuite struct from the jujutests.LiveTests and jujutests.Tests structs. The various provider tests which embed these now contain BaseSuite. https://code.launchpad.net/~wallyworld/juju-core/turn-on-network-isolation/+merge/219994 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -242 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/jujutest/livetests.go View 4 chunks +0 lines, -14 lines 2 comments Download
M environs/jujutest/tests.go View 3 chunks +0 lines, -4 lines 0 comments Download
M provider/azure/azure_test.go View 3 chunks +6 lines, -6 lines 0 comments Download
M provider/azure/config_test.go View 1 chunk +1 line, -2 lines 0 comments Download
M provider/azure/customdata_test.go View 1 chunk +1 line, -2 lines 0 comments Download
M provider/azure/instance_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M provider/common/bootstrap_test.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/common/destroy_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M provider/common/state_test.go View 1 chunk +1 line, -2 lines 0 comments Download
M provider/dummy/config_test.go View 1 chunk +2 lines, -3 lines 0 comments Download
M provider/dummy/environs_test.go View 2 chunks +38 lines, -4 lines 0 comments Download
provider/ec2/config_test.go View 3 chunks +3 lines, -4 lines 0 comments Download
M provider/ec2/image_test.go View 2 chunks +7 lines, -7 lines 0 comments Download
M provider/ec2/live_test.go View 5 chunks +6 lines, -7 lines 0 comments Download
M provider/ec2/local_test.go View 6 chunks +11 lines, -9 lines 0 comments Download
M provider/joyent/export_test.go View 1 chunk +1 line, -0 lines 0 comments Download
M provider/joyent/joyent_test.go View 1 chunk +0 lines, -1 line 0 comments Download
D provider/joyent/live_test.go View 1 chunk +0 lines, -94 lines 0 comments Download
M provider/joyent/local_test.go View 6 chunks +10 lines, -19 lines 0 comments Download
M provider/joyent/provider_test.go View 1 chunk +0 lines, -6 lines 0 comments Download
M provider/local/local_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M provider/local/prereqs_test.go View 2 chunks +3 lines, -3 lines 0 comments Download
M provider/maas/config_test.go View 1 chunk +1 line, -2 lines 0 comments Download
M provider/maas/environ_test.go View 2 chunks +5 lines, -6 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 4 chunks +8 lines, -0 lines 0 comments Download
M provider/maas/export_test.go View 2 chunks +64 lines, -0 lines 0 comments Download
M provider/maas/maas_test.go View 3 chunks +5 lines, -6 lines 0 comments Download
M provider/openstack/live_test.go View 3 chunks +5 lines, -6 lines 0 comments Download
M provider/openstack/local_test.go View 12 chunks +16 lines, -23 lines 2 comments Download
M testing/base.go View 1 chunk +1 line, -2 lines 0 comments Download
M utils/http.go View 1 chunk +5 lines, -3 lines 2 comments Download
M utils/http_test.go View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3
wallyworld
Please take a look.
9 years, 11 months ago (2014-05-19 08:23:23 UTC) #1
axw
LGTM https://codereview.appspot.com/97560044/diff/1/environs/jujutest/livetests.go File environs/jujutest/livetests.go (left): https://codereview.appspot.com/97560044/diff/1/environs/jujutest/livetests.go#oldcode46 environs/jujutest/livetests.go:46: testbase.LoggingSuite Why remove this? Under the presumption that ...
9 years, 11 months ago (2014-05-19 08:43:31 UTC) #2
wallyworld
9 years, 11 months ago (2014-05-19 09:08:43 UTC) #3
https://codereview.appspot.com/97560044/diff/1/environs/jujutest/livetests.go
File environs/jujutest/livetests.go (left):

https://codereview.appspot.com/97560044/diff/1/environs/jujutest/livetests.go...
environs/jujutest/livetests.go:46: testbase.LoggingSuite
On 2014/05/19 08:43:31, axw wrote:
> Why remove this? Under the presumption that the embedding suite will also
embed
> BaseSuite? Fair, I guess.

Yes, the embedding suite must also embed BaseSuite. tl;dr; it makes sense to me
to treat LiveTests as purely a plugin of tests to run and the containing suite
does other necessary set up.

https://codereview.appspot.com/97560044/diff/1/provider/openstack/local_test.go
File provider/openstack/local_test.go (right):

https://codereview.appspot.com/97560044/diff/1/provider/openstack/local_test....
provider/openstack/local_test.go:169: s.BaseSuite.AddSuiteCleanup(func(*gc.C) {
restoreFinishBootstrap() })
On 2014/05/19 08:43:31, axw wrote:
> No need for the explicit BaseSuite qualifier

Done.

https://codereview.appspot.com/97560044/diff/1/utils/http.go
File utils/http.go (right):

https://codereview.appspot.com/97560044/diff/1/utils/http.go#newcode122
utils/http.go:122: if !ip.IsLoopback() {
On 2014/05/19 08:43:31, axw wrote:
> ip will be nil if host is a hostname and not an IP, so this should probably
be:
>     if ip == nil || !ip.IsLoopback() {

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b