File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,36 @@ import (
1212 "github.com/Azure/azure-container-networking/testutils"
1313)
1414
15+ var errStore = errors .New ("store error" )
16+
1517func TestManager (t * testing.T ) {
1618 RegisterFailHandler (Fail )
1719 RunSpecs (t , "Manager Suite" )
1820}
1921
2022var _ = Describe ("Test Manager" , func () {
23+ Describe ("Test AddExternalInterface" , func () {
24+ Context ("When adding the external interface" , func () {
25+ It ("Should not write to the store" , func () {
26+ ifName := "eth0"
27+ // accessing the store should result in an error
28+ dataStore := & testutils.KeyValueStoreMock {
29+ WriteError : errStore ,
30+ ReadError : errStore ,
31+ }
32+ nm := & networkManager {
33+ ExternalInterfaces : map [string ]* externalInterface {},
34+ store : dataStore ,
35+ }
36+ nm .ExternalInterfaces [ifName ] = & externalInterface {
37+ Name : ifName ,
38+ }
39+ err := nm .AddExternalInterface (ifName , "10.10.10.0/24" )
40+ Expect (err ).NotTo (HaveOccurred ())
41+ })
42+ })
43+ })
44+
2145 Describe ("Test deleteExternalInterface" , func () {
2246 Context ("When external interface not found" , func () {
2347 It ("Should return nil" , func () {
You can’t perform that action at this time.
0 commit comments