示例#1
0
def test_slurm_nodelist_groups():
    os.environ[
        "LIBE_RESOURCES_TEST_NODE_LIST"] = "knl-[0020-0022,0137-0139,1234]"
    exp_out = [
        'knl-0020', 'knl-0021', 'knl-0022', 'knl-0137', 'knl-0138', 'knl-0139',
        'knl-1234'
    ]
    nodelist = Resources.get_slurm_nodelist(
        node_list_env="LIBE_RESOURCES_TEST_NODE_LIST")
    assert nodelist == exp_out, "Nodelist returned is does not match expected"
示例#2
0
def test_slurm_nodelist_groups_longprefix():
    os.environ[
        "LIBE_RESOURCES_TEST_NODE_LIST"] = "super-[000020-000022,000137-000139,001234,023456-023458]"
    exp_out = [
        'super-000020', 'super-000021', 'super-000022', 'super-000137',
        'super-000138', 'super-000139', 'super-001234', 'super-023456',
        'super-023457', 'super-023458'
    ]
    nodelist = Resources.get_slurm_nodelist(
        node_list_env="LIBE_RESOURCES_TEST_NODE_LIST")
    assert nodelist == exp_out, "Nodelist returned is does not match expected"
示例#3
0
def test_slurm_nodelist_bdw_seq():
    os.environ["LIBE_RESOURCES_TEST_NODE_LIST"] = "bdw-[0009-0012]"
    exp_out = ['bdw-0009', 'bdw-0010', 'bdw-0011', 'bdw-0012']
    nodelist = Resources.get_slurm_nodelist(
        node_list_env="LIBE_RESOURCES_TEST_NODE_LIST")
    assert nodelist == exp_out, "Nodelist returned is does not match expected"
示例#4
0
def test_slurm_nodelist_single():
    os.environ["LIBE_RESOURCES_TEST_NODE_LIST"] = "knl-0056"
    exp_out = ["knl-0056"]
    nodelist = Resources.get_slurm_nodelist(
        node_list_env="LIBE_RESOURCES_TEST_NODE_LIST")
    assert nodelist == exp_out, "Nodelist returned is does not match expected"