2016-12-13 23:04:59 +00:00
|
|
|
package opts // import "github.com/docker/docker/opts"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAddressPoolOpt(t *testing.T) {
|
|
|
|
poolopt := &PoolsOpt{}
|
2022-01-20 13:11:00 +00:00
|
|
|
addresspool := "base=175.30.0.0/16,size=16"
|
|
|
|
invalidAddresspoolString := "base=175.30.0.0/16,size=16, base=175.33.0.0/16,size=24"
|
2016-12-13 23:04:59 +00:00
|
|
|
|
|
|
|
if err := poolopt.Set(addresspool); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := poolopt.Set(invalidAddresspoolString); err == nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|