Example #1
0
def molecule(context, command, scenario=None, driver='docker'):
    """Run custom Molecule command"""
    if driver == "docker":
        raise Exception(
            "Can't run tests under Docker as 'timedatectl status' command will fail\n"
            "(see https://stackoverflow.com/a/46837044 for details)")
    test_utils.run_molecule(context, command, scenario, driver)
Example #2
0
def test(context):
    """Run all tests"""
    for scenario in test_utils.get_molecule_scenarios(context):
        for driver in ["docker", "lxd"]:
            header_text = f"Molecule test {scenario} ({driver})"
            test_utils.print_header(header_text)
            test_utils.run_molecule(context, "test", scenario, driver)
            test_utils.print_success_message(header_text)
Example #3
0
def molecule(context, command, scenario=None, driver="docker"):
    """Run custom Molecule command"""
    platform = "ubuntu" if scenario == "apt_origins" else "linux"
    test_utils.run_molecule(context,
                            command,
                            scenario,
                            driver,
                            platform=platform)
Example #4
0
def test(context):
    """Run all tests"""
    scenarios = test_utils.get_molecule_scenarios(context)
    filtered = ["backuppc", "backuppc-xs", "rsync-bpc", "apache"]
    scenarios = [scenario for scenario in scenarios if scenario not in filtered]
    for scenario in scenarios:
        for driver in ["docker", "lxd"]:
            platform = "linux" if scenario == "failing" else "ubuntu"
            header_text = f"Molecule test {scenario} ({driver})"
            test_utils.print_header(header_text)
            test_utils.run_molecule(context, "test", scenario, driver, platform)
            test_utils.print_success_message(header_text)
Example #5
0
def test(context):
    """Run all tests"""
    for scenario in test_utils.get_molecule_scenarios(context):
        for driver in ["docker", "lxd"]:
            platform = "ubuntu" if scenario == "apt_origins" else "linux"
            header_text = f"Molecule test {scenario} ({driver})"
            test_utils.print_header(header_text)
            test_utils.run_molecule(context,
                                    "test",
                                    scenario,
                                    driver,
                                    platform=platform)
            test_utils.print_success_message(header_text)
Example #6
0
def upgrade(
        context,
        backuppc_from, backuppc_xs_from, rsync_bpc_from,
        backuppc_to="latest", backuppc_xs_to="latest", rsync_bpc_to="latest",
        driver="docker"
    ):
    """Run version upgrade test"""
    test_utils.run_molecule(
        context,
        command="test",
        scenario="upgrade",
        driver=driver,
        platform="ubuntu",
        env={
            "TEST_BACKUPPC_FROM": backuppc_from,
            "TEST_BACKUPPC_XS_FROM": backuppc_xs_from,
            "TEST_RSYNC_BPC_FROM": rsync_bpc_from,
            "TEST_BACKUPPC_TO": backuppc_to,
            "TEST_BACKUPPC_XS_TO": backuppc_xs_to,
            "TEST_RSYNC_BPC_TO": rsync_bpc_to
        }
    )
Example #7
0
def molecule(context, command, scenario=None, driver='docker'):
    """Run custom Molecule command"""
    test_utils.run_molecule(context, command, scenario, driver)
Example #8
0
def converge(context):
    """Run Molecule converge using 'default' scenario for Docker"""
    test_utils.run_molecule(context, "converge")
Example #9
0
def molecule(
        context, command, scenario=None, driver="docker"
):
    """Run custom Molecule command"""
    test_utils.run_molecule(context, command, scenario, driver, platform="linux")
Example #10
0
def test(context):
    """Run all tests"""
    test_utils.run_molecule(context, "test", "default", "lxd")