Example #1
0
def test_build_node_section():
    deref_tree = _dereference_config_tree(deepcopy(CONFIG_TREE_WITH_RENAMES))
    cfg = _build_node_section(deref_tree)['cluster']
    cluster_cfg = cfg['example_ec2']
    assert 'nodes' in cluster_cfg
    nodes_cfg = cluster_cfg['nodes']
    assert 'misc' in nodes_cfg
    assert nodes_cfg['misc']['flavor'] == 'm1.tiny'
    assert nodes_cfg['misc']['image_id'] == 'i-12345'
    assert nodes_cfg['misc']['num'] == 10
    assert nodes_cfg['misc']['min_num'] == 10
Example #2
0
def test_build_node_section():
    deref_tree = _dereference_config_tree(deepcopy(CONFIG_TREE_WITH_RENAMES))
    cfg = _build_node_section(deref_tree)['cluster']
    cluster_cfg = cfg['example_ec2']
    assert 'nodes' in cluster_cfg
    nodes_cfg = cluster_cfg['nodes']
    assert 'misc' in nodes_cfg
    assert nodes_cfg['misc']['flavor'] == 'm1.tiny'
    assert nodes_cfg['misc']['image_id'] == 'i-12345'
    assert nodes_cfg['misc']['num'] == 10
    assert nodes_cfg['misc']['min_num'] == 10
Example #3
0
def test_build_node_section_google():
    deref_tree = _dereference_config_tree(deepcopy(CONFIG_TREE_WITH_RENAMES))
    cfg = _build_node_section(deref_tree)['cluster']
    cluster_cfg = cfg['example_google']
    assert 'nodes' in cluster_cfg
    nodes_cfg = cluster_cfg['nodes']
    assert 'misc' in nodes_cfg
    assert nodes_cfg['misc']['boot_disk_size'] == '15'
    assert nodes_cfg['misc']['boot_disk_type'] == 'pd-standard'
    assert nodes_cfg['misc']['scheduling'] == "preemptible"
    assert nodes_cfg['misc']['node_name'] == "my-node"
    assert nodes_cfg['misc']['tags'] == "tag1,tag2,tag3"
def test_build_node_section_google():
    deref_tree = _dereference_config_tree(deepcopy(CONFIG_TREE_WITH_RENAMES))
    cfg = _build_node_section(deref_tree)['cluster']
    cluster_cfg = cfg['example_google']
    assert 'nodes' in cluster_cfg
    nodes_cfg = cluster_cfg['nodes']
    assert 'misc' in nodes_cfg
    assert nodes_cfg['misc']['boot_disk_size'] == '15'
    assert nodes_cfg['misc']['boot_disk_type'] == 'pd-standard'
    assert nodes_cfg['misc']['scheduling'] == "preemptible"
    assert nodes_cfg['misc']['node_name'] == "my-node"
    assert 'tags' not in nodes_cfg['misc']