code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def test_systemd_units_health(dcos_api_session: DcosApiSession) -> None: """ test all units and make sure the units are healthy. This test will fail if any of systemd unit is unhealthy, meaning it focuses on making sure the dcos_api_session is healthy, rather then testing dcos-diagnostics itself. """ ...
test all units and make sure the units are healthy. This test will fail if any of systemd unit is unhealthy, meaning it focuses on making sure the dcos_api_session is healthy, rather then testing dcos-diagnostics itself.
test_systemd_units_health
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def test_dcos_diagnostics_units_unit(dcos_api_session: DcosApiSession) -> None: """ test a unit response in a right format, endpoint: /system/health/v1/units/<unit> """ for master in dcos_api_session.masters: units_response = check_json(dcos_api_session.health.get('/units', node=master)) ...
test a unit response in a right format, endpoint: /system/health/v1/units/<unit>
test_dcos_diagnostics_units_unit
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def test_dcos_diagnostics_units_unit_nodes(dcos_api_session: DcosApiSession) -> None: """ test a list of nodes for a specific unit, endpoint /system/health/v1/units/<unit>/nodes """ def get_nodes_from_response(response: Any) -> List[Optional[str]]: assert 'nodes' in response, 'response must hav...
test a list of nodes for a specific unit, endpoint /system/health/v1/units/<unit>/nodes
test_dcos_diagnostics_units_unit_nodes
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def test_dcos_diagnostics_units_unit_nodes_node(dcos_api_session: DcosApiSession) -> None: """ test a specific node for a specific unit, endpoint /system/health/v1/units/<unit>/nodes/<node> """ required_node_fields = ['host_ip', 'health', 'role', 'output', 'help'] for master in dcos_api_session.mas...
test a specific node for a specific unit, endpoint /system/health/v1/units/<unit>/nodes/<node>
test_dcos_diagnostics_units_unit_nodes_node
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def test_dcos_diagnostics_report(dcos_api_session: DcosApiSession) -> None: """ test dcos-diagnostics report endpoint /system/health/v1/report """ for master in dcos_api_session.masters: report_response = check_json(dcos_api_session.health.get('/report', node=master)) assert 'Units' in r...
test dcos-diagnostics report endpoint /system/health/v1/report
test_dcos_diagnostics_report
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def test_dcos_diagnostics_bundle_create_download_delete(dcos_api_session: DcosApiSession, use_legacy_api: bool) -> None: """ test bundle create, read, delete workflow """ health_url = dcos_api_session.default_url.copy( query='cache=0', path='system/health/v1', ) diagnostics = D...
test bundle create, read, delete workflow
test_dcos_diagnostics_bundle_create_download_delete
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def _download_bundle_from_master(dcos_api_session: DcosApiSession, master_index: Any, bundle: str, diagnostics: Diagnostics) -> None: """ Download DC/OS diagnostics bundle from a master :param dcos_api_session: dcos_api_session fixture :param master_index: master index from...
Download DC/OS diagnostics bundle from a master :param dcos_api_session: dcos_api_session fixture :param master_index: master index from dcos_api_session.masters array :param bundle: bundle name to download from master :param diagnostics: DCOS Diagnostics client
_download_bundle_from_master
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_diagnostics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
Apache-2.0
def get_task_url(dcos_api_session: DcosApiSession, task_name: str, stream: bool=False) -> str: """ The function returns a logging URL for a given task :param dcos_api_session: dcos_api_session fixture :param task_name: task name :param stream: use range or stream endpoint :return: url to get the lo...
The function returns a logging URL for a given task :param dcos_api_session: dcos_api_session fixture :param task_name: task name :param stream: use range or stream endpoint :return: url to get the logs for a task
get_task_url
python
dcos/dcos
packages/dcos-integration-test/extra/test_dcos_log.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_dcos_log.py
Apache-2.0
def test_if_we_have_capabilities(dcos_api_session: DcosApiSession) -> None: """Indirectly test that Cosmos is up since this call is handled by Cosmos. """ r = dcos_api_session.get( '/capabilities', headers={ 'Accept': 'application/vnd.dcos.capabilities+json;charset=utf-8;version=...
Indirectly test that Cosmos is up since this call is handled by Cosmos.
test_if_we_have_capabilities
python
dcos/dcos
packages/dcos-integration-test/extra/test_endpoints.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_endpoints.py
Apache-2.0
def test_permissions(self) -> None: """ ZooKeeper data files are not accessible """ # Verify that a parent directory exists assert os.path.isdir('/var/lib/dcos/exhibitor/zookeeper') # Verify that snapshots and transaction logs are not accessible with pytest.raises...
ZooKeeper data files are not accessible
test_permissions
python
dcos/dcos
packages/dcos-integration-test/extra/test_exhibitor.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_exhibitor.py
Apache-2.0
def marathon_test_app_linux( host_port: int = 0, container_port: Optional[int] = None, container_type: marathon.Container = marathon.Container.NONE, network: marathon.Network = marathon.Network.HOST, healthcheck_protocol: marathon.Healthcheck = marathon.Healthcheck.HTTP, ...
Creates an app definition for the python test server which will be consistent (i.e. deployable with green health checks and desired network routability). To learn more about the test server, see in this repo: ../packages/dcos-integration-test/extra/util/python_test_server.py Args: host_port: p...
marathon_test_app_linux
python
dcos/dcos
packages/dcos-integration-test/extra/test_helpers.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_helpers.py
Apache-2.0
def marathon_test_docker_app(app_name: str, constraints: Any = None) -> tuple: """ Creates an app definition for the python test server container Args: app_name: a human readable name to identify the app for debugging. constraints: placement spec Return: (dict, str): 2-Tuple of app...
Creates an app definition for the python test server container Args: app_name: a human readable name to identify the app for debugging. constraints: placement spec Return: (dict, str): 2-Tuple of app definition (dict) and app ID (string)
marathon_test_docker_app
python
dcos/dcos
packages/dcos-integration-test/extra/test_helpers.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_helpers.py
Apache-2.0
def _generate_rsa_keypair() -> Any: """ Generate an RSA keypair. Serialize the public key in the the X.509 SubjectPublicKeyInfo/OpenSSL PEM public key format (RFC 5280). Serialize the private key in the PKCS#8 (RFC 3447) format. Returns: (private key, public key) 2-tuple, both unicode ...
Generate an RSA keypair. Serialize the public key in the the X.509 SubjectPublicKeyInfo/OpenSSL PEM public key format (RFC 5280). Serialize the private key in the PKCS#8 (RFC 3447) format. Returns: (private key, public key) 2-tuple, both unicode objects holding the serialized keys. ...
_generate_rsa_keypair
python
dcos/dcos
packages/dcos-integration-test/extra/test_iam.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_iam.py
Apache-2.0
def test_dcos_add_user(dcos_api_session: DcosApiSession, new_dcos_cli: DcosCli) -> None: """ dcos_add_user.py script adds a user to IAM using the script dcos_add_user.py. """ email_address = uuid.uuid4().hex + '@example.com' command = ['python', '/opt/mesosphere/bin/dcos_add_user.py', email_add...
dcos_add_user.py script adds a user to IAM using the script dcos_add_user.py.
test_dcos_add_user
python
dcos/dcos
packages/dcos-integration-test/extra/test_legacy_user_management.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_legacy_user_management.py
Apache-2.0
def test_files_api(dcos_api_session: DcosApiSession) -> None: ''' This test verifies that the standard output and error of a Mesos task can be read. We check that neither standard output nor error are empty files. Since the default `marathon_test_app()` does not write to its standard output the task...
This test verifies that the standard output and error of a Mesos task can be read. We check that neither standard output nor error are empty files. Since the default `marathon_test_app()` does not write to its standard output the task definition is modified to output something there.
test_files_api
python
dcos/dcos
packages/dcos-integration-test/extra/test_mesos.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_mesos.py
Apache-2.0
def reserved_disk(dcos_api_session: DcosApiSession) -> Generator: """ Set up an agent with one disk in a role. Reserve a chunk of `disk` resources on an agent for a role, and the remaining resources to another role. With that a framework in the first role will only be offered `disk` resources. ...
Set up an agent with one disk in a role. Reserve a chunk of `disk` resources on an agent for a role, and the remaining resources to another role. With that a framework in the first role will only be offered `disk` resources.
reserved_disk
python
dcos/dcos
packages/dcos-integration-test/extra/test_mesos.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_mesos.py
Apache-2.0
def test_executor_uses_domain_socket(dcos_api_session: DcosApiSession) -> None: """ This test validates that by default executors connect with the agent over domain sockets. The test launches a Marathon app with a health check which validates that the `mesos-executor` process of the task is connected t...
This test validates that by default executors connect with the agent over domain sockets. The test launches a Marathon app with a health check which validates that the `mesos-executor` process of the task is connected to the agent socket. We do not validate that any actual data is passed over the sock...
test_executor_uses_domain_socket
python
dcos/dcos
packages/dcos-integration-test/extra/test_mesos.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_mesos.py
Apache-2.0
def _tests_from_pattern(ci_pattern: str, cwd: str) -> Set[str]: """ From a CI pattern, get all tests ``pytest`` would collect. """ tests = set([]) # type: Set[str] args = [ 'pytest', '--disable-pytest-warnings', '--collect-only', ci_pattern, '-q', ] #...
From a CI pattern, get all tests ``pytest`` would collect.
_tests_from_pattern
python
dcos/dcos
packages/dcos-integration-test/extra/test_meta.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_meta.py
Apache-2.0
def test_test_groups() -> None: """ The test suite is split into various "groups". This test confirms that the groups together contain all tests, and each test is collected only once. """ test_groups_path = 'test_groups.yaml' if 'pyexecnetcache' in os.getcwd(): # We are running this ...
The test suite is split into various "groups". This test confirms that the groups together contain all tests, and each test is collected only once.
test_test_groups
python
dcos/dcos
packages/dcos-integration-test/extra/test_meta.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_meta.py
Apache-2.0
def check_tags(tags: dict, required_tag_names: set, optional_tag_names: set = set()) -> None: """Assert that tags contains only expected keys with nonempty values.""" keys = set(tags.keys()) assert keys & required_tag_names == required_tag_names, 'Not all required tags were set' assert keys - required_t...
Assert that tags contains only expected keys with nonempty values.
check_tags
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_ping(dcos_api_session: DcosApiSession) -> None: """ Test that the dcos-metrics service is up on master and agents.""" nodes = get_master_and_agents(dcos_api_session) for node in nodes: response = dcos_api_session.metrics.get('/ping', node=node) assert response.status_code =...
Test that the dcos-metrics service is up on master and agents.
test_metrics_ping
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agents_prom(dcos_api_session: DcosApiSession) -> None: """Telegraf Prometheus endpoint is reachable on master and agents.""" nodes = get_master_and_agents(dcos_api_session) for node in nodes: response = dcos_api_session.session.request('GET', 'http://' + node + ':61091/metrics') ...
Telegraf Prometheus endpoint is reachable on master and agents.
test_metrics_agents_prom
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_metrics_prom(dcos_api_session: DcosApiSession, node: str) -> Any: """Gets metrics from prometheus port on node and returns the response. Retries on non-200 status for up to 300 seconds. """ response = dcos_api_session.session.request( 'GET', 'http://{}:61091/metrics'.format(node)) ...
Gets metrics from prometheus port on node and returns the response. Retries on non-200 status for up to 300 seconds.
get_metrics_prom
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_procstat(dcos_api_session: DcosApiSession) -> None: """Assert that procstat metrics are present on master and agent nodes.""" nodes = get_master_and_agents(dcos_api_session) for node in nodes: @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def che...
Assert that procstat metrics are present on master and agent nodes.
test_metrics_procstat
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agents_mesos(dcos_api_session: DcosApiSession) -> None: """Assert that mesos metrics on agents are present.""" nodes = get_agents(dcos_api_session) for node in nodes: @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_mesos_metrics() -> None...
Assert that mesos metrics on agents are present.
test_metrics_agents_mesos
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_mesos(dcos_api_session: DcosApiSession) -> None: """Assert that mesos metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_mesos_metrics() -> None: response = get_metrics_prom(dcos_api_session, dcos_api_session....
Assert that mesos metrics on master are present.
test_metrics_master_mesos
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agents_mesos_overlay(dcos_api_session: DcosApiSession) -> None: """Assert that mesos agent overlay module metrics on master and agents are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def _check_mesos_overlay_metrics() -> None: response = ge...
Assert that mesos agent overlay module metrics on master and agents are present.
test_metrics_agents_mesos_overlay
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_mesos_overlay(dcos_api_session: DcosApiSession) -> None: """Assert that mesos overlay module metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def _check_mesos_overlay_metrics() -> None: response = get_metrics_prom(dc...
Assert that mesos overlay module metrics on master are present.
test_metrics_master_mesos_overlay
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_zookeeper(dcos_api_session: DcosApiSession) -> None: """Assert that ZooKeeper metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_zookeeper_metrics() -> None: response = get_metrics_prom(dcos_api_session, dcos_...
Assert that ZooKeeper metrics on master are present.
test_metrics_master_zookeeper
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_cockroachdb(dcos_api_session: DcosApiSession) -> None: """Assert that CockroachDB metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_cockroachdb_metrics() -> None: response = get_metrics_prom(dcos_api_session,...
Assert that CockroachDB metrics on master are present.
test_metrics_master_cockroachdb
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_etcd(dcos_api_session: DcosApiSession) -> None: """Assert that DC/OS etcd metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def _check_etcd_metrics() -> None: response = get_metrics_prom(dcos_api_session, dcos_api_sess...
Assert that DC/OS etcd metrics on master are present.
test_metrics_master_etcd
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_calico(dcos_api_session: DcosApiSession) -> None: """Assert that DC/OS Calico metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def _check_calico_metrics() -> None: response = get_metrics_prom(dcos_api_session, dcos_a...
Assert that DC/OS Calico metrics on master are present.
test_metrics_master_calico
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agents_calico(dcos_api_session: DcosApiSession) -> None: """Assert that DC/OS Calico metrics on agents are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def _check_calico_metrics() -> None: response = get_metrics_prom(dcos_api_session, node) ...
Assert that DC/OS Calico metrics on agents are present.
test_metrics_agents_calico
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_adminrouter_nginx_vts(dcos_api_session: DcosApiSession) -> None: """Assert that Admin Router Nginx VTS metrics on master are present.""" @retrying.retry( wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME, retry_on_exception=lambda e: isinstance(e, Assertion...
Assert that Admin Router Nginx VTS metrics on master are present.
test_metrics_master_adminrouter_nginx_vts
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_exhibitor_status(dcos_api_session: DcosApiSession) -> None: """Assert that Exhibitor status metrics on master are present.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_exhibitor_metrics() -> None: response = get_metrics_prom(dcos_api_...
Assert that Exhibitor status metrics on master are present.
test_metrics_master_exhibitor_status
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_master_adminrouter_nginx_vts_processor(dcos_api_session: DcosApiSession) -> None: """Assert that processed Admin Router metrics on master are present.""" node = dcos_api_session.masters[0] # Make request to a fine-grained metrics annotated upstream of # Admin Router (IAM in this case). ...
Assert that processed Admin Router metrics on master are present.
test_metrics_master_adminrouter_nginx_vts_processor
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agents_adminrouter_nginx_vts(dcos_api_session: DcosApiSession) -> None: """Assert that Admin Router Nginx VTS metrics on agents are present.""" nodes = get_agents(dcos_api_session) for node in nodes: @retrying.retry( wait_fixed=STD_INTERVAL, stop_max_delay=M...
Assert that Admin Router Nginx VTS metrics on agents are present.
test_metrics_agents_adminrouter_nginx_vts
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agent_adminrouter_nginx_vts_processor(dcos_api_session: DcosApiSession) -> None: """Assert that processed Admin Router metrics on agent are present.""" # Make request to Admin Router on every agent to ensure metrics. state_response = dcos_api_session.get('/state', host=dcos_api_session.mast...
Assert that processed Admin Router metrics on agent are present.
test_metrics_agent_adminrouter_nginx_vts_processor
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_diagnostics(dcos_api_session: DcosApiSession) -> None: """Assert that DC/OS Diagnostics metrics on master are present.""" nodes = get_master_and_agents(dcos_api_session) for node in nodes: @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check_d...
Assert that DC/OS Diagnostics metrics on master are present.
test_metrics_diagnostics
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_fluentbit(dcos_api_session: DcosApiSession) -> None: """Ensure that fluent bit metrics are present on masters and agents""" nodes = get_master_and_agents(dcos_api_session) for node in nodes: @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def check...
Ensure that fluent bit metrics are present on masters and agents
test_metrics_fluentbit
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_agent_statsd(dcos_api_session: DcosApiSession) -> None: """Assert that statsd metrics on private agent are present.""" task_name = 'test-metrics-statsd-app' metric_name_pfx = 'test_metrics_statsd_app' marathon_app = { 'id': '/' + task_name, 'instances': 1, 'cpus'...
Assert that statsd metrics on private agent are present.
test_metrics_agent_statsd
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def deploy_and_cleanup_dcos_package(dcos_api_session: DcosApiSession, package_name: str, package_version: str, framework_name: str) -> Generator: """Deploys dcos package and waits for package teardown once the context is left""" app_id = dcos_api_session.cosmos.install_packag...
Deploys dcos package and waits for package teardown once the context is left
deploy_and_cleanup_dcos_package
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_task_metrics_metadata(dcos_api_session: DcosApiSession) -> None: """Test that task metrics have expected metadata/labels""" expanded_config = get_expanded_config() if expanded_config.get('security') == 'strict': pytest.skip('MoM disabled for strict mode') with deploy_and_cleanup_dcos_pa...
Test that task metrics have expected metadata/labels
test_task_metrics_metadata
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_executor_metrics_metadata(dcos_api_session: DcosApiSession) -> None: """Test that executor metrics have expected metadata/labels""" expanded_config = get_expanded_config() if expanded_config.get('security') == 'strict': pytest.skip('Framework disabled for strict mode') with deploy_and_...
Test that executor metrics have expected metadata/labels
test_executor_metrics_metadata
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_node(dcos_api_session: DcosApiSession) -> None: """Test that the '/system/v1/metrics/v0/node' endpoint returns the expected metrics and metric metadata. """ def expected_datapoint_response(response: dict) -> bool: """Enure that the "node" endpoint returns a "datapoints" dict. ...
Test that the '/system/v1/metrics/v0/node' endpoint returns the expected metrics and metric metadata.
test_metrics_node
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def expected_datapoint_response(response: dict) -> bool: """Enure that the "node" endpoint returns a "datapoints" dict. """ assert 'datapoints' in response, '"datapoints" dictionary not found' 'in response, got {}'.format(response) for dp in response['datapoints']: a...
Enure that the "node" endpoint returns a "datapoints" dict.
expected_datapoint_response
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def expected_dimension_response(response: dict) -> bool: """Ensure that the "node" endpoint returns a dimensions dict that contains a non-empty string for cluster_id. """ assert 'dimensions' in response, '"dimensions" object not found in' 'response, got {}'.format(response) ...
Ensure that the "node" endpoint returns a dimensions dict that contains a non-empty string for cluster_id.
expected_dimension_response
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_containers(dcos_api_session: DcosApiSession) -> None: """Assert that a Marathon app's container and app metrics can be retrieved.""" @retrying.retry(wait_fixed=STD_INTERVAL, stop_max_delay=METRICS_WAITTIME) def test_containers(app_endpoints: list) -> None: for agent in app_endpoints...
Assert that a Marathon app's container and app metrics can be retrieved.
test_metrics_containers
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_statsd_metrics_containers_app(dcos_api_session: DcosApiSession) -> None: """Assert that statsd app metrics appear in the v0 metrics API.""" task_name = 'test-statsd-metrics-containers-app' metric_name_pfx = 'test_statsd_metrics_containers_app' marathon_app = { 'id': '/' + task_name, ...
Assert that statsd app metrics appear in the v0 metrics API.
test_statsd_metrics_containers_app
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_prom_metrics_containers_app_host(dcos_api_session: DcosApiSession) -> None: """Assert that prometheus app metrics appear in the v0 metrics API.""" task_name = 'test-prom-metrics-containers-app-host' metric_name_pfx = 'test_prom_metrics_containers_app_host' marathon_app = { 'id': '/' + t...
Assert that prometheus app metrics appear in the v0 metrics API.
test_prom_metrics_containers_app_host
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_task_prom_metrics_not_filtered(dcos_api_session: DcosApiSession) -> None: """Assert that prometheus app metrics aren't filtered according to adminrouter config. This is a regression test protecting a fix for a bug that mistakenly applied filter criteria intended for adminrouter metrics to Promethe...
Assert that prometheus app metrics aren't filtered according to adminrouter config. This is a regression test protecting a fix for a bug that mistakenly applied filter criteria intended for adminrouter metrics to Prometheus-formatted metrics gathered from tasks.
test_task_prom_metrics_not_filtered
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_metrics_containers_nan(dcos_api_session: DcosApiSession) -> None: """Assert that the metrics API can handle app metric gauges with NaN values.""" task_name = 'test-metrics-containers-nan' metric_name = 'test_metrics_containers_nan' marathon_app = { 'id': '/' + task_name, 'instan...
Assert that the metrics API can handle app metric gauges with NaN values.
test_metrics_containers_nan
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def assert_app_metric_value_for_task(dcos_api_session: DcosApiSession, node: str, task_name: str, metric_name: str, metric_value: Any) -> None: """Assert the value of app metric metric_name for container task_name is metric_value. Retries on error, non-200 status, missing c...
Assert the value of app metric metric_name for container task_name is metric_value. Retries on error, non-200 status, missing container metrics, missing app metric, or unexpected app metric value for up to 5 minutes.
assert_app_metric_value_for_task
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_app_metric_for_task(dcos_api_session: DcosApiSession, node: str, task_name: str, metric_name: str) -> Any: """Return the app metric metric_name for container task_name. Retries on error, non-200 status, or missing container metrics, or missing app metric for up to 5 minutes. """ _, app_met...
Return the app metric metric_name for container task_name. Retries on error, non-200 status, or missing container metrics, or missing app metric for up to 5 minutes.
get_app_metric_for_task
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_container_ids(dcos_api_session: DcosApiSession, node: str) -> Any: """Return container IDs reported by the metrics API on node. Retries on error, non-200 status, or empty response for up to 5 minutes. """ response = dcos_api_session.metrics.get('/containers', node=node) assert response.sta...
Return container IDs reported by the metrics API on node. Retries on error, non-200 status, or empty response for up to 5 minutes.
get_container_ids
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_container_metrics(dcos_api_session: DcosApiSession, node: str, container_id: str) -> Any: """Return container_id's metrics from the metrics API on node. Returns None on 204. Retries on error, non-200 status, or missing response fields for up to 5 minutes. """ response = dcos_api_sessi...
Return container_id's metrics from the metrics API on node. Returns None on 204. Retries on error, non-200 status, or missing response fields for up to 5 minutes.
get_container_metrics
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_app_metrics(dcos_api_session: DcosApiSession, node: str, container_id: str) -> Any: """Return app metrics for container_id from the metrics API on node. Returns None on 204. Retries on error or non-200 status for up to 5 minutes. """ resp = dcos_api_session.metrics.get('/containers/' + co...
Return app metrics for container_id from the metrics API on node. Returns None on 204. Retries on error or non-200 status for up to 5 minutes.
get_app_metrics
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def get_metrics_for_task(dcos_api_session: DcosApiSession, node: str, task_name: str) -> Any: """Return (container_metrics, app_metrics) for task_name on node. Retries on error, non-200 responses, or missing metrics for task_name for up to 5 minutes. """ task_names_seen = [] # Used for exception ...
Return (container_metrics, app_metrics) for task_name on node. Retries on error, non-200 responses, or missing metrics for task_name for up to 5 minutes.
get_metrics_for_task
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_pod_application_metrics(dcos_api_session: DcosApiSession) -> None: """Launch a pod, wait for its containers to be added to the metrics service, and then verify that: 1) Container statistics metrics are provided for the executor container 2) Application metrics are exposed for the task container...
Launch a pod, wait for its containers to be added to the metrics service, and then verify that: 1) Container statistics metrics are provided for the executor container 2) Application metrics are exposed for the task container
test_pod_application_metrics
python
dcos/dcos
packages/dcos-integration-test/extra/test_metrics.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_metrics.py
Apache-2.0
def test_profile_symlink() -> None: """Assert the DC/OS profile script is symlinked from the correct source.""" expanded_config = get_expanded_config() symlink_target = expanded_config['profile_symlink_target'] expected_symlink_source = expanded_config['profile_symlink_source'] assert expected_symli...
Assert the DC/OS profile script is symlinked from the correct source.
test_profile_symlink
python
dcos/dcos
packages/dcos-integration-test/extra/test_misc.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_misc.py
Apache-2.0
def hostport(self, dcos_api_session: DcosApiSession) -> tuple: """ returns container ip and port for calico and dcos network otherwise the ones from the host """ info = self.info(dcos_api_session) task = info['app']['tasks'][0] if 'networks' in self.app and \ self...
returns container ip and port for calico and dcos network otherwise the ones from the host
hostport
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def generate_vip_app_permutations() -> list: """ Generate all possible network interface permutations for applying vips """ containers = list(marathon.Container) + [Container.POD] return [(container, vip_net, proxy_net) for container in containers for vip_net in list(marathon.Net...
Generate all possible network interface permutations for applying vips
generate_vip_app_permutations
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_ipv6(dcos_api_session: DcosApiSession, same_host: bool) -> None: ''' Testing autoip, containerip and *.mesos FQDN on ipv6 overlay network ''' (hosts, origin_app, proxy_app) = \ workload_test(dcos_api_session, marathon.Container.DOCKER, marathon.Network.USER, marathon.Netwo...
Testing autoip, containerip and *.mesos FQDN on ipv6 overlay network
test_ipv6
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def generate_vip_app_cross_usernetwork_permutations() -> list: """Generate cross user network combinations for vip""" return [(container, vip_network_name, proxy_network_name) for container in list(marathon.Container) + [Container.POD] for vip_network_name in list(InternalUserNetwork) ...
Generate cross user network combinations for vip
generate_vip_app_cross_usernetwork_permutations
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_if_dcos_l4lb_disabled(dcos_api_session: DcosApiSession) -> None: '''Test to make sure dcos_l4lb is disabled''' if lb_enabled(): pytest.skip('Load Balancer enabled') data = subprocess.check_output(['/usr/bin/env', 'ip', 'rule']) # dcos-net creates this ip rule: `9999: from 9.0.0.0/8 look...
Test to make sure dcos_l4lb is disabled
test_if_dcos_l4lb_disabled
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_ip_per_container(dcos_api_session: DcosApiSession) -> None: '''Test if we are able to connect to a task with ip-per-container mode ''' # Launch the test_server in ip-per-container mode (user network) if len(dcos_api_session.slaves) < 2: pytest.skip("IP Per Container tests require 2 priv...
Test if we are able to connect to a task with ip-per-container mode
test_ip_per_container
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_app_networking_mode_with_defined_container_port(dcos_api_session: DcosApiSession, networking_mode: marathon.Network, host_port: int) -> None: """ The Admin Router can proxy a request on the...
The Admin Router can proxy a request on the `/service/[app]` endpoint to an application running in a container in different networking modes with manually or automatically assigned host port on which is the application HTTP endpoint exposed. Networking modes are testing following configurations: ...
test_app_networking_mode_with_defined_container_port
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_l4lb(dcos_api_session: DcosApiSession) -> None: '''Test l4lb is load balancing between all the backends * create 5 apps using the same VIP * get uuid from the VIP * verify that 5 uuids have been returned * only testing if all 5 are hit at least once ''' @retrying.retry(w...
Test l4lb is load balancing between all the backends * create 5 apps using the same VIP * get uuid from the VIP * verify that 5 uuids have been returned * only testing if all 5 are hit at least once
test_l4lb
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def test_dcos_cni_l4lb(dcos_api_session: DcosApiSession) -> Any: ''' This tests the `dcos - l4lb` CNI plugins: https: // github.com / dcos / dcos - cni / tree / master / cmd / l4lb The `dcos-l4lb` CNI plugins allows containers running on networks that don't necessarily have routes to spartan in...
This tests the `dcos - l4lb` CNI plugins: https: // github.com / dcos / dcos - cni / tree / master / cmd / l4lb The `dcos-l4lb` CNI plugins allows containers running on networks that don't necessarily have routes to spartan interfaces and minuteman VIPs to consume DNS service from spartan and ...
test_dcos_cni_l4lb
python
dcos/dcos
packages/dcos-integration-test/extra/test_networking.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_networking.py
Apache-2.0
def _agent_has_resources(agent: dict, node_requirements: dict) -> bool: """Check that an agent has at least as much resources as requried for one node Args: agent: dict Info for one 'slave' from the mesos state summary node_requirements: dict Resource requirements per agent """ unreserv...
Check that an agent has at least as much resources as requried for one node Args: agent: dict Info for one 'slave' from the mesos state summary node_requirements: dict Resource requirements per agent
_agent_has_resources
python
dcos/dcos
packages/dcos-integration-test/extra/test_packaging.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_packaging.py
Apache-2.0
def _enough_resources_for_package(state_summary: dict, package_requirements: dict) -> bool: """Sanity check that there are enough unreserved_resources in a state to run a package. Args: state_summary: dict package_requirements: dict Returns: bool Notes: This is a sanit...
Sanity check that there are enough unreserved_resources in a state to run a package. Args: state_summary: dict package_requirements: dict Returns: bool Notes: This is a sanity check meant for use with pytest.mark.skipif This only verifies that there were enough res...
_enough_resources_for_package
python
dcos/dcos
packages/dcos-integration-test/extra/test_packaging.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_packaging.py
Apache-2.0
def _skipif_insufficient_resources(dcos_api_session: DcosApiSession, requirements: dict) -> None: """Can't access dcos_api_session from through the pytest.mark.skipif decorator, so call this in each test instead """ if not _enough_resources_for_package(_get_cluster_resources(dcos_api_session), requirements)...
Can't access dcos_api_session from through the pytest.mark.skipif decorator, so call this in each test instead
_skipif_insufficient_resources
python
dcos/dcos
packages/dcos-integration-test/extra/test_packaging.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_packaging.py
Apache-2.0
def test_packaging_api(dcos_api_session: DcosApiSession) -> None: """ Test the Cosmos API (/package) wrapper by installing nginx from https://github.com/mesosphere/universe/blob/version-3.x/repo/packages/N/nginx/6 The default configuration of ngnix needs only one agent and no service secrets are req...
Test the Cosmos API (/package) wrapper by installing nginx from https://github.com/mesosphere/universe/blob/version-3.x/repo/packages/N/nginx/6 The default configuration of ngnix needs only one agent and no service secrets are required even when running in a strict cluster.
test_packaging_api
python
dcos/dcos
packages/dcos-integration-test/extra/test_packaging.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_packaging.py
Apache-2.0
def test_mom_installation(dcos_api_session: DcosApiSession) -> None: """Test the Cosmos installation of marathon on marathon (MoM) """ expanded_config = get_expanded_config() if expanded_config.get('security') == 'strict': pytest.skip('MoM disabled for strict mode') if expanded_config.get('...
Test the Cosmos installation of marathon on marathon (MoM)
test_mom_installation
python
dcos/dcos
packages/dcos-integration-test/extra/test_packaging.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_packaging.py
Apache-2.0
def test_move_external_volume_to_new_agent(dcos_api_session: DcosApiSession) -> None: """Test that an external volume is successfully attached to a new agent. If the dcos_api_session has only one agent, the volume will be detached and reattached to the same agent. """ expanded_config = get_expande...
Test that an external volume is successfully attached to a new agent. If the dcos_api_session has only one agent, the volume will be detached and reattached to the same agent.
test_move_external_volume_to_new_agent
python
dcos/dcos
packages/dcos-integration-test/extra/test_rexray.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_rexray.py
Apache-2.0
def _service_discovery_test(dcos_api_session: DcosApiSession, docker_network_bridge: bool) -> None: """Service discovery integration test This test verifies if service discovery works, by comparing marathon data with information from mesos-dns and from containers themselves. This is achieved by deploy...
Service discovery integration test This test verifies if service discovery works, by comparing marathon data with information from mesos-dns and from containers themselves. This is achieved by deploying an application to marathon with two instances , and ["hostname", "UNIQUE"] constraint set. This sho...
_service_discovery_test
python
dcos/dcos
packages/dcos-integration-test/extra/test_service_discovery.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_service_discovery.py
Apache-2.0
def assert_service_discovery(dcos_api_session: DcosApiSession, app_definition: Any, net_types: list) -> None: """ net_types: List of network types: DNSHost, DNSPortMap, or DNSOverlay """ with dcos_api_session.marathon.deploy_and_cleanup(app_definition): service_points = dcos_api_session.maratho...
net_types: List of network types: DNSHost, DNSPortMap, or DNSOverlay
assert_service_discovery
python
dcos/dcos
packages/dcos-integration-test/extra/test_service_discovery.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_service_discovery.py
Apache-2.0
def test_if_search_is_working(dcos_api_session: DcosApiSession) -> None: """Test if custom set search is working. Verifies that a marathon app running on the dcos_api_session can resolve names using searching the "search" the dcos_api_session was launched with (if any). It also tests that absolute sear...
Test if custom set search is working. Verifies that a marathon app running on the dcos_api_session can resolve names using searching the "search" the dcos_api_session was launched with (if any). It also tests that absolute searches still work, and search + things that aren't sub-domains fails properly....
test_if_search_is_working
python
dcos/dcos
packages/dcos-integration-test/extra/test_service_discovery.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_service_discovery.py
Apache-2.0
def test_if_default_systctls_are_set(dcos_api_session: DcosApiSession) -> None: """This test verifies that default sysctls are set for tasks. We use a `mesos-execute` to check for the values to make sure any task from any framework would be affected by default. The job then examines the default sysctls...
This test verifies that default sysctls are set for tasks. We use a `mesos-execute` to check for the values to make sure any task from any framework would be affected by default. The job then examines the default sysctls, and returns a failure if another value is found.
test_if_default_systctls_are_set
python
dcos/dcos
packages/dcos-integration-test/extra/test_sysctl.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_sysctl.py
Apache-2.0
def test_if_ucr_app_can_be_deployed_with_image_whiteout(dcos_api_session: DcosApiSession) -> None: """Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can execute a docker image with whiteout files. Whiteouts are files with a special meaning...
Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can execute a docker image with whiteout files. Whiteouts are files with a special meaning for the layered filesystem. For more details, please see: https://github.com/docker/docker/blob/m...
test_if_ucr_app_can_be_deployed_with_image_whiteout
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_app_can_be_deployed_with_image_digest(dcos_api_session: DcosApiSession) -> None: """Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can execute a docker image by digest. """ app = { 'id': '/test-ucr-' + str(u...
Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can execute a docker image by digest.
test_if_ucr_app_can_be_deployed_with_image_digest
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_app_can_be_deployed_with_auto_cgroups(dcos_api_session: DcosApiSession) -> None: """Marathon app deployment integration test using the Mesos Containerizer. This test launches a marathon ucr app to verify the CPU and memory cgroups subsystems can be automatically loaded by the agent and the ...
Marathon app deployment integration test using the Mesos Containerizer. This test launches a marathon ucr app to verify the CPU and memory cgroups subsystems can be automatically loaded by the agent and the container specific cgroups can be correctly mounted inside the container. Please note that the ...
test_if_ucr_app_can_be_deployed_with_auto_cgroups
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_app_can_be_deployed_with_shm_in_specified_size(dcos_api_session: DcosApiSession) -> None: """Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can be launched with a specified size (1234MB) of private /dev/shm. """ app...
Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can be launched with a specified size (1234MB) of private /dev/shm.
test_if_ucr_app_can_be_deployed_with_shm_in_specified_size
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_image_entrypoint(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image default entrypoint. """ test_uuid = uuid.uuid4().hex pod_definitio...
Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image default entrypoint.
test_if_ucr_pods_can_be_deployed_with_image_entrypoint
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_scratch_image(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker scratch image. A scratch image means an image that only contains a single binary an...
Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker scratch image. A scratch image means an image that only contains a single binary and its dependencies.
test_if_ucr_pods_can_be_deployed_with_scratch_image
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_image_whiteout(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image with whiteout files. Whiteouts are files with a special meaning for the laye...
Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image with whiteout files. Whiteouts are files with a special meaning for the layered filesystem. For more details, please see: https://github.com/docker/docker/blob/master/pkg/archive/...
test_if_ucr_pods_can_be_deployed_with_image_whiteout
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_image_digest(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image by digest. """ test_uuid = uuid.uuid4().hex pod_definition = { ...
Marathon pods inside ucr deployment integration test. This test verifies that a marathon ucr pod can execute a docker image by digest.
test_if_ucr_pods_can_be_deployed_with_image_digest
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_auto_cgroups(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod to verify the CPU and memory cgroups subsystems can be automatically loaded by the agent and the container spe...
Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod to verify the CPU and memory cgroups subsystems can be automatically loaded by the agent and the container specific cgroups can be correctly mounted inside the container. Please note that the `cgroups/all` opti...
test_if_ucr_pods_can_be_deployed_with_auto_cgroups
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_be_deployed_with_non_root_user_ephemeral_volume(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod with a non-root user (nobody) and an ephemeral volume, and verifies the container in the pod can...
Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod with a non-root user (nobody) and an ephemeral volume, and verifies the container in the pod can write to the ephemeral volume. In strict mode, the parent container (i.e., the default executor) is launched as no...
test_if_ucr_pods_can_be_deployed_with_non_root_user_ephemeral_volume
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_if_ucr_pods_can_share_shm_with_childs(dcos_api_session: DcosApiSession) -> None: """Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod with a specified size (1234MB) of private /dev/shm and share it with one of its child containers but not the other one...
Marathon pods inside ucr deployment integration test. This test launches a marathon ucr pod with a specified size (1234MB) of private /dev/shm and share it with one of its child containers but not the other one, and then verifies the size of one child container's /dev/shm is 1234MB and the other's is n...
test_if_ucr_pods_can_share_shm_with_childs
python
dcos/dcos
packages/dcos-integration-test/extra/test_ucr.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ucr.py
Apache-2.0
def test_ui_service_reset(dcos_api_session: DcosApiSession) -> None: """ Test the reset endpoint of the UI Update Service. """ r = dcos_api_session.delete('/dcos-ui-update-service/api/v1/reset/') assert r.status_code == 200
Test the reset endpoint of the UI Update Service.
test_ui_service_reset
python
dcos/dcos
packages/dcos-integration-test/extra/test_ui_update_service.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_ui_update_service.py
Apache-2.0
def test_verify_units() -> None: """Test that all systemd units are valid.""" def _check_units(path: str) -> None: """Verify all the units given by `path'""" for file in glob.glob(path): cmd = subprocess.run( ["/usr/bin/systemd-analyze", "verify", "--no-pager", file],...
Test that all systemd units are valid.
test_verify_units
python
dcos/dcos
packages/dcos-integration-test/extra/test_units.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_units.py
Apache-2.0
def _check_units(path: str) -> None: """Verify all the units given by `path'""" for file in glob.glob(path): cmd = subprocess.run( ["/usr/bin/systemd-analyze", "verify", "--no-pager", file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ...
Verify all the units given by `path'
_check_units
python
dcos/dcos
packages/dcos-integration-test/extra/test_units.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_units.py
Apache-2.0
def test_socket_units() -> None: """Test that socket units configure socket files in /run/dcos that are owned by 'dcos_adminrouter'. """ def _check_unit(file: str) -> None: logging.info("Checking socket unit {}".format(file)) out = subprocess.check_output( ["/usr/bin/systemct...
Test that socket units configure socket files in /run/dcos that are owned by 'dcos_adminrouter'.
test_socket_units
python
dcos/dcos
packages/dcos-integration-test/extra/test_units.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_units.py
Apache-2.0
def test_socket_files() -> None: """Test that all socket files in /run/dcos are owned by 'dcos_adminrouter'.""" for file in glob.glob("/run/dcos/*"): path = pathlib.Path(file) if not path.is_socket(): # This is not a unix socket file, ignore. continue logging.info...
Test that all socket files in /run/dcos are owned by 'dcos_adminrouter'.
test_socket_files
python
dcos/dcos
packages/dcos-integration-test/extra/test_units.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/test_units.py
Apache-2.0
def delete_ec2_volume(name, timeout=600): """Delete an EC2 EBS volume by its "Name" tag Args: timeout: seconds to wait for volume to become available for deletion """ def _force_detach_volume(volume): log.info("Force detaching all volume attachments.") for attachment in volume....
Delete an EC2 EBS volume by its "Name" tag Args: timeout: seconds to wait for volume to become available for deletion
delete_ec2_volume
python
dcos/dcos
packages/dcos-integration-test/extra/util/delete_ec2_volume.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/util/delete_ec2_volume.py
Apache-2.0
def __init__(self, code, reason, explanation=''): """Inits RequestProcessingException with data used to build a reply to client""" self.code = code self.reason = reason self.explanation = explanation
Inits RequestProcessingException with data used to build a reply to client
__init__
python
dcos/dcos
packages/dcos-integration-test/extra/util/python_test_server.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/util/python_test_server.py
Apache-2.0
def _send_reply(self, data): """Send reply to client in JSON format Send a successful reply to the client, with reply data/body formatted/serialized as JSON. It also makes sure that headers are set right and JSON is formatted in human-readable form. Args: data: free...
Send reply to client in JSON format Send a successful reply to the client, with reply data/body formatted/serialized as JSON. It also makes sure that headers are set right and JSON is formatted in human-readable form. Args: data: free form data that should be serialized to ...
_send_reply
python
dcos/dcos
packages/dcos-integration-test/extra/util/python_test_server.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/util/python_test_server.py
Apache-2.0
def _handle_path_dns_search(self): """Respond to a dns resolution request with the dns results for a name""" def get_hostbyname_json(hostname): try: return socket.gethostbyname(hostname) except socket.gaierror as ex: return {"error": str(ex)} ...
Respond to a dns resolution request with the dns results for a name
_handle_path_dns_search
python
dcos/dcos
packages/dcos-integration-test/extra/util/python_test_server.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/util/python_test_server.py
Apache-2.0
def _handle_path_reflect(self): """Respond to request for client's IP with it's as seen by the server""" data = {"test_uuid": os.environ[TEST_UUID_VARNAME], "request_ip": self.address_string()} self._send_reply(data)
Respond to request for client's IP with it's as seen by the server
_handle_path_reflect
python
dcos/dcos
packages/dcos-integration-test/extra/util/python_test_server.py
https://github.com/dcos/dcos/blob/master/packages/dcos-integration-test/extra/util/python_test_server.py
Apache-2.0