nightly: add tests

This commit is contained in:
Hans-Christoph Steiner 2022-11-14 23:25:21 +01:00
parent 9c0eaac121
commit 15bd7057f0
3 changed files with 178 additions and 3 deletions

View file

@ -48,6 +48,11 @@ DISTINGUISHED_NAME = 'CN=Android Debug,O=Android,C=US'
NIGHTLY = '-nightly'
def _get_keystore_secret_var(keystore):
with open(keystore, 'rb') as fp:
return base64.standard_b64encode(fp.read()).decode('ascii')
def _ssh_key_from_debug_keystore(keystore=None):
if keystore is None:
# set this here so it can be overridden in the tests
@ -450,8 +455,7 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base,
shutil.rmtree(os.path.dirname(privkey))
if options.show_secret_var:
with open(options.keystore, 'rb') as fp:
debug_keystore = base64.standard_b64encode(fp.read()).decode('ascii')
debug_keystore = _get_keystore_secret_var(options.keystore)
print(
_('\n{path} encoded for the DEBUG_KEYSTORE secret variable:').format(
path=options.keystore