Merge lp:~frankban/golxc/fix-logging-suite into lp:golxc

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 9
Proposed branch: lp:~frankban/golxc/fix-logging-suite
Merge into: lp:golxc
Diff against target: 51 lines (+11/-3)
1 file modified
golxc_test.go (+11/-3)
To merge this branch: bzr merge lp:~frankban/golxc/fix-logging-suite
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+221210@code.launchpad.net

Commit message

Replace LoggingSuite with IsolationSuite.

Description of the change

Replace LoggingSuite with IsolationSuite.

The logging package no longer exist in github.com/juju/testing.

https://codereview.appspot.com/92660046/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+221210_code.launchpad.net,

Message:
Please take a look.

Description:
Replace LoggingSuite with IsolationSuite.

The logging package no longer exist in github.com/juju/testing.

https://code.launchpad.net/~frankban/golxc/fix-logging-suite/+merge/221210

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/92660046/

Affected files (+6, -3 lines):
   A [revision details]
   M golxc_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision:
<email address hidden>

Index: golxc_test.go
=== modified file 'golxc_test.go'
--- golxc_test.go 2014-03-11 00:34:54 +0000
+++ golxc_test.go 2014-05-28 11:48:02 +0000
@@ -11,7 +11,6 @@

   "github.com/juju/testing"
   jc "github.com/juju/testing/checkers"
- "github.com/juju/testing/logging"
   . "launchpad.net/gocheck"

   "launchpad.net/golxc"
@@ -20,7 +19,7 @@
  var lxcfile = `# MIRROR to be used by ubuntu template at container
creation:
  # Leaving it undefined is fine
  #MIRROR="http://archive.ubuntu.com/ubuntu"
-# or
+# or
  #MIRROR="http://<host-ip-addr>:3142/archive.ubuntu.com/ubuntu"

  # LXC_AUTO - whether or not to start containers symlinked under
@@ -357,13 +356,14 @@
  }

  type commandArgs struct {
- logging.LoggingSuite
+ testing.IsolationSuite
  }

  var _ = Suite(&commandArgs{})

  func (s *commandArgs) TestCreateArgs(c *C) {
   s.PatchValue(&golxc.ContainerDir, c.MkDir())
+ s.PatchEnvironment("PATH", "/usr/bin") // Required by lxc-create -> tee.
   testing.PatchExecutableAsEchoArgs(c, s, "lxc-create")

   factory := golxc.Factory()
@@ -386,6 +386,7 @@
  func (s *commandArgs) TestCloneArgs(c *C) {
   dir := c.MkDir()
   s.PatchValue(&golxc.ContainerDir, dir)
+ s.PatchEnvironment("PATH", "/usr/bin") // Required by lxc-create -> tee.
   // Patch lxc-info too as clone checks to see if it is running.
   testing.PatchExecutableAsEchoArgs(c, s, "lxc-info")
   testing.PatchExecutableAsEchoArgs(c, s, "lxc-clone")

lp:~frankban/golxc/fix-logging-suite updated
10. By Francesco Banconi

Save the original path.

Revision history for this message
Francesco Banconi (frankban) wrote :
Revision history for this message
Martin Packman (gz) wrote :

LGTM. At least is explict about leaking your PATH in.

https://codereview.appspot.com/92660046/

Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Replace LoggingSuite with IsolationSuite.

The logging package no longer exist in github.com/juju/testing.

R=gz
CC=
https://codereview.appspot.com/92660046

https://codereview.appspot.com/92660046/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'golxc_test.go'
--- golxc_test.go 2014-03-11 00:34:54 +0000
+++ golxc_test.go 2014-05-28 12:05:23 +0000
@@ -11,7 +11,6 @@
1111
12 "github.com/juju/testing"12 "github.com/juju/testing"
13 jc "github.com/juju/testing/checkers"13 jc "github.com/juju/testing/checkers"
14 "github.com/juju/testing/logging"
15 . "launchpad.net/gocheck"14 . "launchpad.net/gocheck"
1615
17 "launchpad.net/golxc"16 "launchpad.net/golxc"
@@ -20,7 +19,7 @@
20var lxcfile = `# MIRROR to be used by ubuntu template at container creation:19var lxcfile = `# MIRROR to be used by ubuntu template at container creation:
21# Leaving it undefined is fine20# Leaving it undefined is fine
22#MIRROR="http://archive.ubuntu.com/ubuntu"21#MIRROR="http://archive.ubuntu.com/ubuntu"
23# or 22# or
24#MIRROR="http://<host-ip-addr>:3142/archive.ubuntu.com/ubuntu"23#MIRROR="http://<host-ip-addr>:3142/archive.ubuntu.com/ubuntu"
2524
26# LXC_AUTO - whether or not to start containers symlinked under25# LXC_AUTO - whether or not to start containers symlinked under
@@ -357,13 +356,21 @@
357}356}
358357
359type commandArgs struct {358type commandArgs struct {
360 logging.LoggingSuite359 testing.IsolationSuite
360 originalPath string
361}361}
362362
363var _ = Suite(&commandArgs{})363var _ = Suite(&commandArgs{})
364364
365func (s *commandArgs) SetUpSuite(c *C) {
366 // lxc-create requires the PATH to be set.
367 s.originalPath = os.Getenv("PATH")
368 s.IsolationSuite.SetUpSuite(c)
369}
370
365func (s *commandArgs) TestCreateArgs(c *C) {371func (s *commandArgs) TestCreateArgs(c *C) {
366 s.PatchValue(&golxc.ContainerDir, c.MkDir())372 s.PatchValue(&golxc.ContainerDir, c.MkDir())
373 s.PatchEnvironment("PATH", s.originalPath)
367 testing.PatchExecutableAsEchoArgs(c, s, "lxc-create")374 testing.PatchExecutableAsEchoArgs(c, s, "lxc-create")
368375
369 factory := golxc.Factory()376 factory := golxc.Factory()
@@ -386,6 +393,7 @@
386func (s *commandArgs) TestCloneArgs(c *C) {393func (s *commandArgs) TestCloneArgs(c *C) {
387 dir := c.MkDir()394 dir := c.MkDir()
388 s.PatchValue(&golxc.ContainerDir, dir)395 s.PatchValue(&golxc.ContainerDir, dir)
396 s.PatchEnvironment("PATH", s.originalPath)
389 // Patch lxc-info too as clone checks to see if it is running.397 // Patch lxc-info too as clone checks to see if it is running.
390 testing.PatchExecutableAsEchoArgs(c, s, "lxc-info")398 testing.PatchExecutableAsEchoArgs(c, s, "lxc-info")
391 testing.PatchExecutableAsEchoArgs(c, s, "lxc-clone")399 testing.PatchExecutableAsEchoArgs(c, s, "lxc-clone")

Subscribers

People subscribed via source and target branches