Example #1
0
def test_set_existing_number_property(env):
    config_set('core.timeout', '5', env)
    _get_value('core.timeout', 5, env)
    config_set('core.timeout', '5', env)
Example #2
0
def test_set_change_output(env):
    assert_command(['dcos', 'config', 'set', 'core.timeout', '10'],
                   stderr=b"[core.timeout]: changed from '5' to '10'\n",
                   env=env)
    config_set('core.timeout', '5', env)
Example #3
0
def test_set_existing_boolean_property(env):
    config_set('core.reporting', 'true', env)
    _get_value('core.reporting', True, env)
    config_set('core.reporting', 'true', env)
Example #4
0
def test_url_validation(env):
    key = 'package.cosmos_url'
    with update_config(key, None, env):

        config_set(key, 'http://localhost', env)
        config_set(key, 'https://localhost', env)
        config_set(key, 'http://dcos-1234', env)
        config_set(key, 'http://dcos-1234.mydomain.com', env)

        config_set(key, 'http://*****:*****@localhost:8080', env)
        config_set(key, 'http://u-ser@localhost:8080', env)
        config_set(key, 'http://user123_@localhost:8080', env)
        config_set(key, 'http://*****:*****@localhost:8080', env)
        config_set(key, 'http://*****:*****@localhost:8080', env)
        config_set(key, 'http://us%r1$3:pa#sw*rd321@localhost:8080', env)
Example #5
0
def test_set_core_property(env):
    config_set('core.reporting', 'true', env)
    _get_value('core.reporting', True, env)
    config_set('core.reporting', 'false', env)
Example #6
0
def test_set_missing_property(env):
    with update_config("package.cosmos_url", None, env=env):
        config_set('package.cosmos_url', 'http://localhost:8080', env)
        _get_value('package.cosmos_url', 'http://localhost:8080', env)
Example #7
0
def test_unset_output(env):
    assert_command(['dcos', 'config', 'unset', 'core.reporting'],
                   stderr=b'Removed [core.reporting]\n',
                   env=env)
    config_set('core.reporting', 'false', env)