json_serializer: handled corrupted files
When the `/var/lib/usr_mgr.conf` file is either empty or corrupted
JSON, the daemon will crash and not recover. Handle this by catching
JSON load exceptions and deleting the corrupted file.
Fixes openbmc/phosphor-user-manager#19.
Tested: Added additional test cases to cover the corruption case and
update the test case to cover the non-throwing behavior.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2be787771ea3d72af924615a6eee17cf2f393e9a
3 files changed