Skip to content

Commit 887b296

Browse files
committed
test: randomize MAC addresses used in the unit-tests
The theory is that makes the unit-test flaky for network controllers. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 6063fbf commit 887b296

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.conform.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-09-02T13:10:04Z by kres 784fa1f.
3+
# Generated on 2025-11-13T15:58:14Z by kres e1d6dac.
44

55
policies:
66
- type: commit
@@ -12,7 +12,7 @@ policies:
1212
gitHubOrganization: siderolabs
1313
spellcheck:
1414
locale: US
15-
maximumOfOneCommit: true
15+
maximumOfOneCommit: false
1616
header:
1717
length: 89
1818
imperative: true

internal/app/machined/pkg/controllers/network/link_spec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (suite *LinkSpecSuite) TestDummy() {
7474
suite.Create(res)
7575
}
7676

77-
newHardwareAddr := net.HardwareAddr{0x2e, 0x3c, 0x4d, 0x5e, 0x6f, 0x70}
77+
newHardwareAddr := net.HardwareAddr{0x02, 0x00, 0x00, 0x00, byte(rand.IntN(256)), byte(rand.IntN(256))}
7878

7979
ctest.AssertResource(suite, dummyInterface, func(r *network.LinkStatus, asrt *assert.Assertions) {
8080
asrt.Equal("dummy", r.TypedSpec().Kind)
@@ -102,7 +102,7 @@ func (suite *LinkSpecSuite) TestDummy() {
102102
func (suite *LinkSpecSuite) TestDummyWithMAC() {
103103
dummyInterface := suite.uniqueDummyInterface()
104104

105-
newHardwareAddr := net.HardwareAddr{0x2e, 0x3c, 0x4d, 0x5e, 0x6f, 0x70}
105+
newHardwareAddr := net.HardwareAddr{0x02, 0x00, 0x00, 0x00, byte(rand.IntN(256)), byte(rand.IntN(256))}
106106

107107
dummy := network.NewLinkSpec(network.NamespaceName, dummyInterface)
108108
*dummy.TypedSpec() = network.LinkSpecSpec{

0 commit comments

Comments
 (0)