コード例 #1
0
def test_custom_graph(env, admin_remote, puppet_file_new_owner):
    """Test to check the noop run feature for custom graph

    Steps to reproduce:
    1. Change owner of /etc/logrotate.d/apache2 on controller
    2. Create a custom graph by copying the default graph and upload it
    3. Execute 'fuel2 graph execute -t custom'
    4. Wait for task finishing
    5. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    6. Check that result contains the expected data
    7. Delete data for apache from custom graph
    8. Execute 'fuel2 graph execute -t custom'
    9. Wait for task finishing
    10. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    11. Check that result does not contains data
    """

    node = puppet_file_new_owner['node']
    # Custom graph = default
    noop_common.create_and_upload_custom_graph(admin_remote, env)
    task = noop_common.run_noop_graph_execute(admin_remote, env, nodes=[node],
                                              g_type='custom')
    msg = ("u'message': u'current_value {0}, "
           "should be root (noop)'".format(puppet_file_new_owner['new_owner']))
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)

    # Custom graph = default without data related to apache
    noop_common.create_and_upload_custom_graph(admin_remote, env,
                                               modify='delete_apache')
    task = noop_common.run_noop_graph_execute(admin_remote, env, nodes=[node],
                                              g_type='custom')
    assert not noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                         node.id, msg,
                                                         is_expected=False)
コード例 #2
0
def test_remove_default_router(env, admin_remote, without_router):
    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("Routers/Neutron_router[router04]/ensure', "
           "u'message': u'current_value absent, should be present (noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #3
0
def test_clear_router_gateway(env, admin_remote, clear_router_gateway):
    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("Routers/Neutron_router[router04]/gateway_network_name', "
           "u'message': u'current_value , should be admin_floating_net "
           "(noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #4
0
def test_change_nova_conf_on_compute(env, admin_remote, nova_conf_on_cmpt):
    """Test to check the noop run feature for os config file

    Steps to reproduce:
    1. Change parameter in target config file
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """
    node, changes = nova_conf_on_cmpt
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("Nova_config[{0}/{1}]/value', u'message': u'current_value {2}, "
           "should be False (noop)").format(*changes[0])
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #5
0
def test_change_puppet_file_mod(env, admin_remote, puppet_file_new_mod):
    """Test to check the noop run feature for puppet file metadata

    Steps to reproduce:
    1. Change permissions of /etc/logrotate.d/apache2
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """
    node = puppet_file_new_mod['node']
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("u'message': u'current_value {0}, "
           "should be 0644 (noop)'".format(puppet_file_new_mod['new_mod']))
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #6
0
def test_change_cinder_conf(env, admin_remote, cinder_conf):
    """Test to check the noop run feature for os config file

    Steps to reproduce:
    1. Change parameter in target config file
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """
    node, changes = cinder_conf
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg_tmpl = "Cinder_config[{0}/{1}]/value', u'message': u'current_value {2}"
    for change in changes:
        assert noop_common.is_message_in_summary_results(
            admin_remote, task.id, node.id, msg_tmpl.format(*change))
コード例 #7
0
def test_delete_cirros_image(env, admin_remote, delete_cirros_image):
    """Test to check the noop run feature for deleted cirros image

    Steps to reproduce:
    1. Delete the cirros image
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """

    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("/Exec[upload_cirros_shell]/returns', u'message': "
           "u'current_value notrun, should be 0 (noop)")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #8
0
def test_change_ceilometer_config(env, fuel, admin_remote, ceilometer_conf):
    """Test to check the noop run feature for os config file

    Steps to reproduce:
    1. Change parameter in target config file
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """
    node, changes = ceilometer_conf
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("Ceilometer_config[{0}/{1}]/value', "
           "u'message': u'current_value [\"{2}\"], "
           "should be [\"/var/log/ceilometer\"] (noop)'".format(*changes[0]))
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #9
0
def test_rename_network(env, admin_remote, rename_network):
    """Test to check the noop run feature for renamed network

    Steps to reproduce:
    1. Rename admin_floating_net network
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """

    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("/Neutron_network[admin_floating_net]/ensure', u'message': "
           "u'current_value absent, should be present (noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #10
0
def test_delete_project(env, admin_remote, delete_project):
    """Test to check the noop run feature for deleted project

    Steps to reproduce:
    1. Delete project 'services'
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """

    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("/Keystone_tenant[services]/ensure', u'message': "
           "u'current_value absent, should be present (noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #11
0
def test_disable_user(env, admin_remote, disable_user):
    """Test to check the noop run feature for disabled user

    Steps to reproduce:
    1. Disable user 'glare'
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """

    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("/Keystone_user[glare]/enabled', u'message': "
           "u'current_value false, should be true (noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)
コード例 #12
0
def test_remove_service(env, admin_remote, remove_service):
    """Test to check the noop run feature for removed service

    Steps to reproduce:
    1. Delete the service p_heat-engine on controller
    2. Execute 'deploy noop'
    3. Wait for task finishing
    4. Execute 'fuel deployment-tasks --tid <task_id> --include-summary'
    5. Check that result contains the expected data
    """

    node = env.primary_controller
    task = noop_common.run_noop_nodes_deploy(admin_remote, env, nodes=[node])
    msg = ("/Pcmk_resource[p_heat-engine]/ensure', u'message': "
           "u'current_value absent, should be present (noop)'")
    assert noop_common.is_message_in_summary_results(admin_remote, task.id,
                                                     node.id, msg)