Skip to content

Commit

Permalink
address linter
Browse files Browse the repository at this point in the history
  • Loading branch information
QxBytes committed Feb 3, 2025
1 parent d9e0ec7 commit 8c6480f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions network/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (

var errStore = errors.New("store error")

const ifName = "eth0"

func TestManager(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Manager Suite")
Expand All @@ -23,7 +25,6 @@ var _ = Describe("Test Manager", func() {
Describe("Test AddExternalInterface", func() {
Context("When adding the external interface", func() {
It("Should not write to the store", func() {
ifName := "eth0"
// accessing the store should result in an error
dataStore := &testutils.KeyValueStoreMock{
WriteError: errStore,
Expand All @@ -45,7 +46,6 @@ var _ = Describe("Test Manager", func() {
Describe("Test deleteExternalInterface", func() {
Context("When external interface not found", func() {
It("Should return nil", func() {
ifName := "eth0"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
}
Expand All @@ -56,7 +56,6 @@ var _ = Describe("Test Manager", func() {

Context("When external interface found", func() {
It("Should delete external interface", func() {
ifName := "eth0"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
}
Expand Down Expand Up @@ -102,7 +101,7 @@ var _ = Describe("Test Manager", func() {

Context("When GetModificationTime error and not rebooted", func() {
It("Should populate pointers", func() {
extIfName := "eth0"
extIfName := ifName
nwId := "nwId"
nm := &networkManager{
store: &testutils.KeyValueStoreMock{
Expand Down Expand Up @@ -159,14 +158,13 @@ var _ = Describe("Test Manager", func() {
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
}
num := nm.GetNumberOfEndpoints("eth0", "")
num := nm.GetNumberOfEndpoints(ifName, "")
Expect(num).To(Equal(0))
})
})

Context("When Networks is nil", func() {
It("Should return 0", func() {
ifName := "eth0"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
}
Expand All @@ -178,7 +176,6 @@ var _ = Describe("Test Manager", func() {

Context("When network not found", func() {
It("Should return 0", func() {
ifName := "eth0"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
}
Expand All @@ -192,7 +189,6 @@ var _ = Describe("Test Manager", func() {

Context("When endpoints is nil", func() {
It("Should return 0", func() {
ifName := "eth0"
nwId := "nwId"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
Expand All @@ -208,7 +204,6 @@ var _ = Describe("Test Manager", func() {

Context("When endpoints is found", func() {
It("Should return the length of endpoints", func() {
ifName := "eth0"
nwId := "nwId"
nm := &networkManager{
ExternalInterfaces: map[string]*externalInterface{},
Expand Down

0 comments on commit 8c6480f

Please sign in to comment.