separate metrics code/tests; move helpers from uniter_test to util_test
drop uniter_old_test, move components into uniter_test and util_test as appropriate
testing: Update MakeEnvironment to take CofingAttrs

Update the testing factory function MakeEnvironment to take a new parameter: ConfigAttrs. ConfigAttrs is a map of environment configuration attributes which override the factory defaults.
Add network.ParsePortRangePort.
ParsePortRangePorts -> ParsePortRange.
Add network.ParsePortRanges.
Add a round-trip test for PortRange strings.
Move ParsePortRange into portrange.go.
Merge branch 'master' of https://github.com/juju/juju into makeEnv-take-config
Fix switch so it also looks in the config store.
Merge pull request #1321 from wallyworld/lp-1328958

Change the way the ubuntu user is detected

Fixes https://bugs.launchpad.net/ubuntu/+source/juju-core/+bug/1328958

Instead of looking for /home/ubuntu, we grep the passwd file to determine if the ubuntu user exists.

(Review request: http://reviews.vapour.ws/r/640/)
Tweak errors.
cmd/jujud: fixed patch race in upgrade tests

The patch to the attempt strategy used during upgrades was done just
/after/ the upgrade worker had already been started so there was a
race. The worker was occasionally getting the real attempt strategy
instead of the test one, causing long test runs and unexpected numbers
of retries.

The patch is now made before starting the worker.

Fixes LP #1389389.
Tweak implementation to use 'id'
Typo fix
mongo: check all addresses when deciding if machine is master

The recent fix for LP #1397376 meant that on MAAS the replicaset
master address no longer matches the address returned by
SelectPeerAddress - no state server thought it was the master. This
breaks upgrades among other things.

All machine addresses are no compared against the replicaset master
address.

Fixes LP #1403200.
Merge pull request #1329 from mjs/1403200-maas-upgrades

mongo: check all addresses when deciding if machine is master

The recent fix for LP #1397376 meant that on MAAS the replicaset master address no longer matches the address returned by SelectPeerAddress - no state server thought it was the master. This breaks upgrades among other things.

All machine addresses are no compared against the replicaset master address.

Fixes LP #1403200.

(Review request: http://reviews.vapour.ws/r/648/)
Merge branch 'master' of https://github.com/juju/juju into makeEnv-take-config
Merge pull request #1304 from mjs/1389389-TestUpgradeStepsFailure-intermittent-failure

cmd/jujud: fixed patch race in upgrade tests

The patch to the attempt strategy used during upgrades was done just /after/ the upgrade worker had already been started so there was a race. The worker was occasionally getting the real attempt strategy instead of the test one, causing long test runs and unexpected numbers of retries.

The patch is now made before starting the worker.

Fixes LP #1389389.

(Review request: http://reviews.vapour.ws/r/618/)
Merge pull request #1320 from howbazaar/fix-switch

Fix switch so it also looks in the config store.

Fixes https://bugs.launchpad.net/juju-core/+bug/1334768

(Review request: http://reviews.vapour.ws/r/639/)