Skip to content

Commit

Permalink
added 'verify' command for securedrop-admin, to run testinfra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Sep 16, 2020
1 parent c79ea5d commit 0c7de91
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions admin/securedrop_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,15 @@ def install_securedrop(args):
cwd=args.ansible_path)


def verify_install(args):
"""Run configuration tests against SecureDrop servers"""

sdlog.info("Running configuration tests: ")
testinfra_cmd = ["./devops/scripts/run_prod_testinfra"]
return subprocess.check_call(testinfra_cmd,
cwd=os.getcwd())


def backup_securedrop(args):
"""Perform backup of the SecureDrop Application Server.
Creates a tarball of submissions and server config, and fetches
Expand Down Expand Up @@ -1050,6 +1059,10 @@ class ArgParseFormatterCombo(argparse.ArgumentDefaultsHelpFormatter,
help=reset_admin_access.__doc__)
parse_reset_ssh.set_defaults(func=reset_admin_access)

parse_verify = subparsers.add_parser('verify',
help=verify_install.__doc__)
parse_verify.set_defaults(func=verify_install)

args = parser.parse_args(argv)
if getattr(args, 'func', None) is None:
print('Please specify an operation.\n')
Expand Down

0 comments on commit 0c7de91

Please sign in to comment.