Skip to content

Commit

Permalink
Yang model change for bridge midplane (#281)
Browse files Browse the repository at this point in the history
### Why I did it
The yang model for bridge-midplane is not aligned with the actual implementation present in sonic-net/sonic-buildimage#18178, 
This PR is to align the yang model to change `bridge_midplane` to `bridge-midplane` since this is the value used in the `systemd-networkd` in CONFIG_DB so that the yang validation does not fail

#### How I did it
Changed `bridge_midplane` to `bridge-midplane` at all locations
  • Loading branch information
gpunathilell authored Sep 21, 2024
1 parent 95f4400 commit 0f5c591
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sonic_data_client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func TestGetDpuAddress(t *testing.T) {
t.Errorf("get DPU address should failed: %v, but get %s", err, address)
}

midPlaneTable.Hset("GLOBAL", "bridge", "bridge_midplane")
midPlaneTable.Hset("GLOBAL", "bridge", "bridge-midplane")
dpusTable.Hset("dpu0", "midplane_interface", "dpu0")

// test get DPU address when DHCP_SERVER_IPV4_PORT table not ready
Expand All @@ -725,15 +725,15 @@ func TestGetDpuAddress(t *testing.T) {
t.Errorf("get DPU address should failed: %v, but get %s", err, address)
}

dhcpPortTable.Hset("bridge_midplane|dpu0", "invalidfield", "")
dhcpPortTable.Hset("bridge-midplane|dpu0", "invalidfield", "")

// test get DPU address when DHCP_SERVER_IPV4_PORT table broken
address, err = getDpuAddress("dpu0")
if err == nil {
t.Errorf("get DPU address should failed: %v, but get %s", err, address)
}

dhcpPortTable.Hset("bridge_midplane|dpu0", "ips", "127.0.0.2,127.0.0.1")
dhcpPortTable.Hset("bridge-midplane|dpu0", "ips", "127.0.0.2,127.0.0.1")

// test get valid DPU address
address, err = getDpuAddress("dpu0")
Expand Down Expand Up @@ -789,9 +789,9 @@ func TestGetZmqClient(t *testing.T) {
var dpusTable = swsscommon.NewTable(configDb, "DPUS")
var dhcpPortTable = swsscommon.NewTable(configDb, "DHCP_SERVER_IPV4_PORT")

midPlaneTable.Hset("GLOBAL", "bridge", "bridge_midplane")
midPlaneTable.Hset("GLOBAL", "bridge", "bridge-midplane")
dpusTable.Hset("dpu0", "midplane_interface", "dpu0")
dhcpPortTable.Hset("bridge_midplane|dpu0", "ips", "127.0.0.2,127.0.0.1")
dhcpPortTable.Hset("bridge-midplane|dpu0", "ips", "127.0.0.2,127.0.0.1")

client, err := getZmqClient("dpu0", "")
if client != nil || err != nil {
Expand Down

0 comments on commit 0f5c591

Please sign in to comment.