pkg/ip: Return correct error if container name provided exists, and test cases
authorPrateek Gogia <prateekgogia@hotmail.com>
Sun, 7 Aug 2016 19:24:56 +0000 (19:24 +0000)
committerPrateek Gogia <prateekgogia@hotmail.com>
Thu, 11 Aug 2016 18:51:03 +0000 (18:51 +0000)
commit3c1d4581c46aad49bc1c3fc1ead6f15b9806559a
tree7b8ddec289b33dca2188ac190e9e385d148c0468
parent22a0ddc9060350f422870db345957455d5f7a525
pkg/ip: Return correct error if container name provided exists, and test cases

If interface name for a container provided by a user is already present,
Veth creation fails with incorrect error.
If os.IsExist error is returned by makeVethPair:
* Check for peer name, if exists generate another random peer name,
* else, IsExist error is due to container interface present, return error.

Fixes #155
ip/link.go
ip/link_test.go