Skip to content

Add BMP_STATE_DB into gnmi protobuf so that table path could be subscribed. #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4815e42
Add BMP_STATE_DB into gnmi protobuf, so that table coule be subscribed.
FengPan-Frank Feb 14, 2025
9441cb1
Add BMP_STATE_DB into gnmi protobuf, so that table coule be subscribed.
FengPan-Frank Feb 14, 2025
95b110d
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 14, 2025
4fcceaf
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 14, 2025
b10aba6
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 18, 2025
2b96ccc
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 18, 2025
f289009
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 19, 2025
6960a4d
Merge branch 'sonic-net:master' into bmpdb
FengPan-Frank Feb 19, 2025
d663cd9
Merge branch 'sonic-net:master' into bmpdb
FengPan-Frank Feb 19, 2025
71a5e24
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 19, 2025
f05ce9a
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
a96084e
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
431e428
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
30c65ef
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
c9ec66a
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
0578b04
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
a3d7074
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
babbfd3
Merge branch 'sonic-net:master' into bmpdb
FengPan-Frank Feb 21, 2025
4877bc7
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 20, 2025
4d15f15
Merge branch 'bmpdb' of https://github.com/FengPan-Frank/sonic-gnmi i…
FengPan-Frank Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions proto/sonic.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions sonic_db_config/db_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,37 @@ func TestGetDb(t *testing.T) {
})
}

func TestGetBMPDb(t *testing.T) {
ns, _ := GetDbDefaultNamespace()
t.Run("Id", func(t *testing.T) {
db_id, _ := GetDbId("BMP_STATE_DB", ns)
if db_id != 20 {
t.Fatalf(`Id("") = %d, want 20, error`, db_id)
}
})
t.Run("Sock", func(t *testing.T) {
sock_path, _ := GetDbSock("BMP_STATE_DB", ns)
if sock_path != "/var/run/redis/redis.sock" {
t.Fatalf(`Sock("") = %q, want "/var/run/redis/redis.sock", error`, sock_path)
}
})
t.Run("AllNamespaces", func(t *testing.T) {
ns_list, _ := GetDbAllNamespaces()
if len(ns_list) != 1 {
t.Fatalf(`AllNamespaces("") = %q, want "1", error`, len(ns_list))
}
if ns_list[0] != ns {
t.Fatalf(`AllNamespaces("") = %q, want default, error`, ns_list[0])
}
})
t.Run("TcpAddr", func(t *testing.T) {
tcp_addr, _ := GetDbTcpAddr("BMP_STATE_DB", ns)
if tcp_addr != "127.0.0.1:6379" {
t.Fatalf(`TcpAddr("") = %q, want 127.0.0.1:6379, error`, tcp_addr)
}
})
}

func TestGetDbMultiNs(t *testing.T) {
Init()
err := test_utils.SetupMultiNamespace()
Expand Down
5 changes: 5 additions & 0 deletions testdata/database_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"id" : 7,
"separator": "|",
"instance" : "redis"
},
"BMP_STATE_DB": {
"id": 20,
"separator": "|",
"instance": "redis"
}
},
"VERSION" : "1.0"
Expand Down
Loading