bridge: add test case for release IP on error

Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
This commit is contained in:
Mauricio Vasquez B
2018-07-26 21:15:10 -05:00
parent 3a7ee332be
commit 316489903b
2 changed files with 62 additions and 0 deletions

View File

@ -37,6 +37,9 @@ import (
"github.com/vishvananda/netlink"
)
// For testcases to force an error after IPAM has been performed
var debugPostIPAMError error
const defaultBrName = "cni0"
type NetConf struct {
@ -466,6 +469,11 @@ func cmdAdd(args *skel.CmdArgs) error {
result.DNS = n.DNS
// Return an error requested by testcases, if any
if debugPostIPAMError != nil {
return debugPostIPAMError
}
success = true
return types.PrintResult(result, cniVersion)