File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package bridge
2
2
3
3
import (
4
4
"testing"
5
+ "time"
5
6
6
7
"github.com/stretchr/testify/assert"
7
8
"github.com/stretchr/testify/require"
@@ -88,14 +89,19 @@ func TestAttachBridgeWithMac(t *testing.T) {
88
89
}()
89
90
90
91
addrBefore := br .Attrs ().HardwareAddr
92
+ t .Logf ("initial bridge mac: %s" , addrBefore )
91
93
err = AttachNicWithMac (dummy , br )
92
94
require .NoError (t , err )
95
+ time .Sleep (100 * time .Millisecond )
93
96
94
97
l , err := netlink .LinkByName ("bro0" )
95
98
require .NoError (t , err )
96
99
br = l .(* netlink.Bridge )
97
100
addrAfter := br .Attrs ().HardwareAddr
98
101
102
+ t .Logf ("bridge mac After: %s" , addrAfter )
103
+ t .Logf ("dummy mac: %s" , dummy .Attrs ().HardwareAddr )
104
+
99
105
assert .NotEqual (t , addrBefore , addrAfter )
100
106
assert .Equal (t , dummy .Attrs ().HardwareAddr , addrAfter )
101
107
}
Original file line number Diff line number Diff line change 7
7
"github.com/stretchr/testify/require"
8
8
"github.com/threefoldtech/zos4/pkg"
9
9
"github.com/threefoldtech/zos4/pkg/gridtypes"
10
+ "github.com/threefoldtech/zos4/pkg/netlight/bridge"
10
11
"github.com/threefoldtech/zos4/pkg/netlight/namespace"
11
12
"github.com/threefoldtech/zos4/pkg/netlight/types"
12
13
)
@@ -27,6 +28,12 @@ func TestCreatePublicNS(t *testing.T) {
27
28
require .NoError (t , err )
28
29
}()
29
30
30
- err := setupPublicNS (pkg .StrIdentifier ("" ), iface )
31
+ _ , err := bridge .New ("br-pub" )
32
+ require .NoError (t , err )
33
+ defer func () {
34
+ err = bridge .Delete ("br-pub" )
35
+ require .NoError (t , err )
36
+ }()
37
+ err = setupPublicNS (pkg .StrIdentifier ("" ), iface )
31
38
require .NoError (t , err )
32
39
}
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import (
23
23
"path"
24
24
"strings"
25
25
"testing"
26
- "time"
27
26
28
27
"github.com/stretchr/testify/assert"
29
28
"github.com/stretchr/testify/require"
@@ -167,7 +166,6 @@ func basePoolTest(t *testing.T, pool Pool) {
167
166
assert .Len (t , volumes , 1 )
168
167
})
169
168
170
- time .Sleep (30 * time .Second )
171
169
t .Run ("test usage" , func (t * testing.T ) {
172
170
usage , err := pool .Usage ()
173
171
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments