agent: add tests for keyring presence checks