Skip to content

Commit 4e1db30

Browse files
committed
fix unit tests
1 parent 3c63d2b commit 4e1db30

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

agent/bootstrap_test.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,14 +1209,6 @@ var _ = Describe("bootstrap", func() {
12091209
}`
12101210
})
12111211

1212-
Context("and no physical network interfaces exist", func() {
1213-
It("raises an error", func() {
1214-
err := boot.Run()
1215-
Expect(err).To(HaveOccurred())
1216-
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0"))
1217-
})
1218-
})
1219-
12201212
Context("and a single physical network interface exists", func() {
12211213
BeforeEach(func() {
12221214
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
@@ -1264,14 +1256,6 @@ var _ = Describe("bootstrap", func() {
12641256
}`
12651257
})
12661258

1267-
Context("and no physical network interfaces exist", func() {
1268-
It("raises an error", func() {
1269-
err := boot.Run()
1270-
Expect(err).To(HaveOccurred())
1271-
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0"))
1272-
})
1273-
})
1274-
12751259
Context("and a single physical network interface exists", func() {
12761260
BeforeEach(func() {
12771261
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
@@ -1336,10 +1320,9 @@ var _ = Describe("bootstrap", func() {
13361320
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
13371321
})
13381322

1339-
It("raises an error", func() {
1323+
It("succeeds", func() {
13401324
err := boot.Run()
1341-
Expect(err).To(HaveOccurred())
1342-
Expect(err.Error()).To(ContainSubstring("Number of network settings '2' is greater than the number of network devices '1"))
1325+
Expect(err).ToNot(HaveOccurred())
13431326
})
13441327
})
13451328

platform/net/interface_configuration_creator_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,6 @@ var _ = Describe("InterfaceConfigurationCreator", func() {
136136
Expect(len(dhcpInterfaceConfigurations)).To(Equal(0))
137137
})
138138
})
139-
140-
Context("And there are no network devices", func() {
141-
BeforeEach(func() {
142-
interfacesByMAC = map[string]string{}
143-
})
144-
145-
It("returns an error", func() {
146-
_, _, err := interfaceConfigurationCreator.CreateInterfaceConfigurations(networks, interfacesByMAC)
147-
Expect(err).To(HaveOccurred())
148-
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0'"))
149-
})
150-
})
151139
})
152140

153141
Context("And the network has an alias", func() {

0 commit comments

Comments
 (0)