Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion sonic_data_client/mixed_db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,15 @@ func (c *MixedDbClient) SetFullConfig(delete []*gnmipb.Path, replace []*gnmipb.U
return fmt.Errorf("Yang validation failed!")
}

return nil
if err == nil {
var sc ssc.Service
sc, err = ssc.NewDbusClient()
if err != nil {
return err
}
err = sc.ConfigReload(fileName)
}
return err
}

func (c *MixedDbClient) SetDB(delete []*gnmipb.Path, replace []*gnmipb.Update, update []*gnmipb.Update) error {
Expand Down
14 changes: 14 additions & 0 deletions test/test_gnmi_configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def test_gnmi_incremental_replace(self, test_data):
assert new_cnt == old_cnt+1, 'DBUS API is not invoked'

def test_gnmi_full(self):
ret, old_cnt = gnmi_dump("DBUS config reload")
assert ret == 0, 'Failed to read counter'

test_data = {
'field_01': '20001',
'field_02': '20002',
Expand All @@ -291,14 +294,25 @@ def test_gnmi_full(self):
config_json = json.load(cf)
assert test_data == config_json, "Wrong config file"

ret, new_cnt = gnmi_dump("DBUS config reload")
assert ret == 0, 'Failed to read counter'
assert new_cnt == old_cnt + 1, 'DBUS API is not invoked'

def test_gnmi_full_negative(self):
ret, old_cnt = gnmi_dump("DBUS config reload")
assert ret == 0, 'Failed to read counter'

delete_list = ['/sonic-db:CONFIG_DB/localhost/']
update_list = ['/sonic-db:CONFIG_DB/localhost/' + ':abc']

ret, msg = gnmi_set(delete_list, update_list, [])
assert ret != 0, 'Invalid ietf_json_val'
assert 'IETF JSON' in msg

ret, new_cnt = gnmi_dump("DBUS config reload")
assert ret == 0, 'Failed to read counter'
assert new_cnt == old_cnt, 'DBUS API should not have been invoked'

@pytest.mark.parametrize("test_data", test_data_checkpoint)
def test_gnmi_get_checkpoint(self, test_data):
if os.path.isfile(checkpoint_file):
Expand Down