def test_install_marathon(): """Install the Marathon package for DC/OS. """ # Install shakedown.install_package_and_wait(PACKAGE_NAME) assert shakedown.package_installed(PACKAGE_NAME), 'Package failed to install' end_time = time.time() + WAIT_TIME_IN_SECS found = False while time.time() < end_time: found = shakedown.get_service(PACKAGE_NAME) is not None if found and shakedown.service_healthy(SERVICE_NAME): break time.sleep(1) assert found, 'Service did not register with DCOS' shakedown.deployment_wait() # Uninstall uninstall('marathon-user') shakedown.deployment_wait() # Reinstall shakedown.install_package_and_wait(PACKAGE_NAME) assert shakedown.package_installed(PACKAGE_NAME), 'Package failed to reinstall' # try: shakedown.install_package(PACKAGE_NAME) except Exception as e: pass else: # Exception is not raised -> exit code was 0 assert False, "Error: CLI returns 0 when asked to install Marathon"
def test_install_marathon(): """Install the Marathon package for DC/OS. """ # Install shakedown.install_package_and_wait(PACKAGE_NAME) assert shakedown.package_installed(PACKAGE_NAME), 'Package failed to install' end_time = time.time() + WAIT_TIME_IN_SECS found = False while time.time() < end_time: found = shakedown.get_service(PACKAGE_NAME) is not None if found and shakedown.service_healthy(SERVICE_NAME): break time.sleep(1) assert found, 'Service did not register with DCOS' shakedown.deployment_wait() # Uninstall uninstall('marathon-user') shakedown.deployment_wait() # Reinstall shakedown.install_package_and_wait(PACKAGE_NAME) assert shakedown.package_installed(PACKAGE_NAME), 'Package failed to reinstall'
def test_install_universe_package(package): """ Marathon is responsible for installing packages from the universe. This test confirms that several packages are installed into a healty state. """ shakedown.install_package_and_wait(package) assert shakedown.package_installed(package), 'Package failed to install' shakedown.deployment_wait(timeout=timedelta(minutes=5).total_seconds()) assert shakedown.service_healthy(package)
def test_install_universe_package(package): """ Marathon is responsible for installing packages from the universe. This test confirms that several packages are installed into a healty state. """ shakedown.install_package_and_wait(package) assert shakedown.package_installed(package), 'Package failed to install' common.deployment_wait(max_attempts=300) assert shakedown.service_healthy(package)
def test_install_chronos(): """ installs the latest version of chronos """ shakedown.install_package_and_wait('chronos') assert shakedown.package_installed('chronos'), 'Package failed to install' stdout, stderr, return_code = shakedown.run_dcos_command('package list') assert "chronos" in stdout uninstall()
def test_install_marathon(): """Install the Marathon package for DC/OS. """ # Install @retrying.retry(wait_fixed=1000, stop_max_attempt_number=30, retry_on_exception=DCOSException) def install_marathon(): shakedown.install_package_and_wait(PACKAGE_NAME) install_marathon() assert shakedown.package_installed( PACKAGE_NAME), 'Package failed to install' # 5000ms = 5 seconds, 5 seconds * 60 attempts = 300 seconds = WAIT_TIME_IN_SECS @retrying.retry(wait_fixed=5000, stop_max_attempt_number=60, retry_on_exception=DCOSException) def assert_service_registration(package, service): found = shakedown.get_service(package) is not None assert found and shakedown.service_healthy( service ), f"Service {package} did not register with DCOS" # NOQA E999 assert_service_registration(PACKAGE_NAME, SERVICE_NAME) shakedown.deployment_wait() # Uninstall uninstall('marathon-user') shakedown.deployment_wait() # Reinstall shakedown.install_package_and_wait(PACKAGE_NAME) assert shakedown.package_installed( PACKAGE_NAME), 'Package failed to reinstall'
def setup_module(module): if not shakedown.package_installed('spark', SOAK_SPARK_SERVICE_NAME): additional_options = { "hdfs": { "config-url": "http://api.hdfs.marathon.l4lb.thisdcos.directory/v1/endpoints" }, "security": { "kerberos": { "enabled": True, "realm": "LOCAL", "kdc": { "hostname": "kdc.marathon.autoip.dcos.thisdcos.directory", "port": 2500 } } } } utils.require_spark(service_name=SOAK_SPARK_SERVICE_NAME, additional_options=additional_options)
def test_neo4j_universe_package_install(neo_package): """ Neo4j used to be 1 of the universe packages tested above, largely because there was a bug in marathon for a short period of time which was realized through neo4j. However neo4j is so strongly different that we can't test it like the other services. It is NOT a framework so framework health checks do not work with neo4j. """ package = neo_package shakedown.install_package_and_wait(package) assert shakedown.package_installed(package), 'Package failed to install' shakedown.deployment_wait(timeout=timedelta(minutes=5).total_seconds()) marathon_client = marathon.create_client() tasks = marathon_client.get_tasks('neo4j/core') for task in tasks: assert task['healthCheckResults'][0]['lastSuccess'] is not None assert task['healthCheckResults'][0]['consecutiveFailures'] == 0
def setup_module(module): sdk_cmd.run_raw_cli("package install {} --yes --cli".format( utils.SPARK_PACKAGE_NAME)) if not shakedown.package_installed('spark', SOAK_SPARK_SERVICE_NAME): additional_options = { "hdfs": { "config-url": "http://api.{}.marathon.l4lb.thisdcos.directory/v1/endpoints". format(SOAK_HDFS_SERVICE_NAME) }, "security": { "kerberos": { "enabled": True, "realm": "LOCAL", "kdc": { "hostname": "kdc.marathon.autoip.dcos.thisdcos.directory", "port": 2500 } } } } utils.require_spark(service_name=SOAK_SPARK_SERVICE_NAME, additional_options=additional_options)
def is_mom_installed(): return shakedown.package_installed('marathon')