bridge: add test case for release IP on error
Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user