lime-packages
lime-packages copied to clipboard
Shrared state Async ubus interface
This pull request adds shrare-state-async ubus interface
Since there is no Shared State async binary available in the testing environment, testing possibilities are reduced Manual testing can be done on a router with bat-hosts package using this commands:
Get bat-hosts
# ubus -S call shared-state-async getFromSharedState "{'data_type': 'bat-hosts'}"
Get an invalid data type
# ubus -S call shared-state-async getFromSharedState "{'data_type': 'bat-hosss'}"
{"error":"invalid_data_type"}
Sync valid data type with specified ipv4 address
# ubus -S call shared-state-async sync "{'data_type': 'bat-hosts' ,'peers_ip':['10.0.0.1','10.0.0.2']}'"
{"status":"success"}
Sync valid data type with invalid ipv4 address
# ubus -S call shared-state-async sync "{'data_type': 'bat-hosts' ,'peers_ip':['10.0.0.1','10.0..2']}'"
{"error":"invalid_peer_address"}
Sync invalid data type with specified ipv4 address
# ubus -S call shared-state-async sync "{'data_type': 'bat-hoss' ,'peers_ip':['10.0.0.1','10.0.0.2']}'"
{"error":"invalid_data_type"}