Code review comment for lp://staging/~waigani/juju-core/lxc-trusty-autostart

Revision history for this message
Tim Penhey (thumper) wrote :

The test failed because the bot doesn't have lxc installed, and thus the lxc.RemoveDir doesn't exist.

The NetworkSuite doesn't contain the lxc suite, so there is no isolation of the RemoveDir.

In the past, the entire lxc.conf file was just networking. With the addition of the auto start, we now have to have better isolation with this test.

There are a few options, but the one that I think fits best, is to parse the conf template results and just get the results that start with 'lxc.network' as that is what the test cares about.

So, something like

obtained = []string{}
for _, value := range strings.Split(config, "\n")
  if strings.HasPrefix(value, "lxc.network") {
    obtained := append(obtained, value)
  }
}
expected := []string{
  "lxc.network.type = foo",
  "lxc.network.link = bar",
  "lxc.network.flags = up",
}
c.Assert(obtained, gc.DeepEquals, expected)

« Back to merge proposal