コード例 #1
0
ファイル: ~test_numa_nodes.py プロジェクト: pvaduva/auto_test
def test_2_nodes_unset_numa_nodes(flavor_unset):
    LOG.tc_step("Set number of numa nodes to 2 in extra specs")
    nova_helper.set_flavor(flavor_unset, **{FlavorSpec.NUMA_NODES: 2})

    LOG.tc_step("Set numa_node.0 and numa_node.1 specs.")
    nova_helper.set_flavor(flavor_unset, **{
        FlavorSpec.NUMA_0: 0,
        FlavorSpec.NUMA_1: 1
    })
    LOG.tc_step(
        "Unset numa_node.0 and numa_node.1 specs and ensure it's successful.")
    nova_helper.unset_flavor(flavor_unset,
                             [FlavorSpec.NUMA_0, FlavorSpec.NUMA_1])

    LOG.tc_step("Set numa_node.0 and numa_node.1 specs.")
    nova_helper.set_flavor(flavor_unset, **{
        FlavorSpec.NUMA_0: 1,
        FlavorSpec.NUMA_1: 0
    })
    LOG.tc_step(
        "Unset numa_node.0, numa_node.1, and numa_nodes specs and ensure it's successful."
    )
    nova_helper.unset_flavor(
        flavor_unset,
        [FlavorSpec.NUMA_NODES, FlavorSpec.NUMA_0, FlavorSpec.NUMA_1])
コード例 #2
0
ファイル: test_mempage_size.py プロジェクト: starlingx/test
    def flavor_mem_page_size(self, request, flavor_2g):
        flavor_id = flavor_2g[0]
        mem_page_size = request.param
        skip_4k_for_ovs(mem_page_size)

        if mem_page_size is None:
            nova_helper.unset_flavor(flavor_id, FlavorSpec.MEM_PAGE_SIZE)
        else:
            nova_helper.set_flavor(flavor_id,
                                   **{FlavorSpec.MEM_PAGE_SIZE: mem_page_size})

        return mem_page_size
コード例 #3
0
ファイル: ~test_numa_nodes.py プロジェクト: pvaduva/auto_test
def test_1_node_unset_numa_nodes(flavor_unset):
    LOG.tc_step("Set number of numa nodes to 1 in extra specs")
    nova_helper.set_flavor(flavor_unset, **{FlavorSpec.NUMA_NODES: 1})

    LOG.tc_step("Set numa_node.0 spec.")
    nova_helper.set_flavor(flavor_unset, **{FlavorSpec.NUMA_0: 0})
    LOG.tc_step("Unset numa_node.0 spec and ensure it's successful.")
    nova_helper.unset_flavor(flavor_unset, FlavorSpec.NUMA_0)

    LOG.tc_step("Set numa_node.0 spec.")
    nova_helper.set_flavor(flavor_unset, **{FlavorSpec.NUMA_0: 0})
    LOG.tc_step("Unset numa_nodes spec and ensure it's successful.")
    nova_helper.unset_flavor(flavor_unset, FlavorSpec.NUMA_0)
コード例 #4
0
ファイル: ~test_numa_nodes.py プロジェクト: pvaduva/auto_test
def test_0_node_unset_numa_nodes_reject(flavor_0_node):
    LOG.tc_step(
        "Attempt to unset numa nodes spec when it's not in the spec, and verify cli is rejected."
    )
    code, output = nova_helper.unset_flavor(flavor_0_node,
                                            FlavorSpec.NUMA_NODES,
                                            fail_ok=True,
                                            check_first=False)
    assert 1 == code, "Expect nova flavor-key unset cli to be rejected. Actual: {}".format(
        output)
コード例 #5
0
ファイル: ~test_numa_nodes.py プロジェクト: pvaduva/auto_test
def test_2_nodes_unset_numa_nodes_reject(flavor_unset):
    """
    Attempt to unset hw:numa_nodes spec when hw:numa_node.1 is set, and ensure it's rejected.

    Args:
        flavor_unset (str): id of a flavor with 2 numa nodes set in the extra spec

    Setup:
        - Create a flavor with 2 vcpus and number of numa nodes set to 2 in extra specs (module level)

    Test Steps:
        - Set guest numa nodes values in flavor extra specs
        - Attempt to unset number of NUMA nodes spec (hw:numa_nodes) and ensure it's rejected.

    Teardown:
        - Delete created flavor (module level)

    """
    LOG.tc_step(
        "Set number of numa nodes to 2 and guest numa nodes values in extra specs"
    )
    nova_helper.set_flavor(
        flavor_unset, **{
            FlavorSpec.NUMA_NODES: 2,
            FlavorSpec.NUMA_0: 0,
            FlavorSpec.NUMA_1: 1
        })

    LOG.tc_step(
        "Attempt to unset numa_nodes extra spec with guest numa node extra spec, and verify cli is rejected."
    )
    code, output = nova_helper.unset_flavor(flavor_2_nodes,
                                            fail_ok=True,
                                            properties=FlavorSpec.NUMA_NODES,
                                            check_first=False)
    assert code == 1, "Expect nova flavor-key unset cli to be rejected. Actual: {}".format(
        output)