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)
commitad8a052dd3f7a848348d670953145053e2329eed
tree61d4a1937fe4228dc52e9802161a3d787453de3d
parent7c579af7898c2e50fc02de711e031408450979a3
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
pkg/ip/link.go
pkg/ip/link_test.go