Esempio n. 1
0
def setup():
    """Set up the file system, GPG, and database."""
    create_directories()
    init_gpg()
    init_db()
    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()
Esempio n. 2
0
def setup():
    """Set up the file system, GPG, and database."""
    create_directories()
    init_gpg()
    init_db()
    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()
Esempio n. 3
0
def setup():
    """Set up the file system, GPG, and database."""
    create_directories()
    init_gpg()
    init_db()
    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()
    # Start the Python-RQ worker if it's not already running
    if not exists(TEST_WORKER_PIDFILE):
        subprocess.Popen(["rqworker",
                          "-P", config.SECUREDROP_ROOT,
                          "--pid", TEST_WORKER_PIDFILE])
Esempio n. 4
0
def shared_setup():
    """Set up the file system, GPG, and database"""
    create_directories()
    init_gpg()
    init_db()

    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()

    # Start the Python-RQ worker if it's not already running
    if not os.path.exists(config.WORKER_PIDFILE):
        subprocess.Popen(["rqworker", "-P", config.SECUREDROP_ROOT,
                                      "--pid", config.WORKER_PIDFILE])
Esempio n. 5
0
def shared_setup():
    """Set up the file system, GPG, and database"""

    # Create directories for the file store and the GPG keyring
    for d in (config.SECUREDROP_ROOT, config.STORE_DIR, config.GPG_KEY_DIR):
        if not os.path.isdir(d):
            os.mkdir(d)

    # Initialize the GPG keyring
    gpg = gnupg.GPG(gnupghome=config.GPG_KEY_DIR)
    # Import the journalist key for testing (faster to import a pre-generated
    # key than to gen a new one every time)
    for keyfile in ("test_journalist_key.pub", "test_journalist_key.sec"):
        gpg.import_keys(open(keyfile).read())

    # Inititalize the test database
    import db; db.create_tables()

    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()
Esempio n. 6
0
def shared_setup():
    """Set up the file system, GPG, and database"""

    # Create directories for the file store and the GPG keyring
    for d in (config.SECUREDROP_ROOT, config.STORE_DIR, config.GPG_KEY_DIR):
        if not os.path.isdir(d):
            os.mkdir(d)

    # Initialize the GPG keyring
    gpg = gnupg.GPG(gnupghome=config.GPG_KEY_DIR)
    # Import the journalist key for testing (faster to import a pre-generated
    # key than to gen a new one every time)
    for keyfile in ("test_journalist_key.pub", "test_journalist_key.sec"):
        gpg.import_keys(open(keyfile).read())

    # Inititalize the test database
    import db
    db.create_tables()

    # Do tests that should always run on app startup
    crypto_util.do_runtime_tests()