Beispiel #1
0
def testGetDevList(t, env):
    """Check devlist

    FLAGS: getdevicelist all
    CODE: GETDLIST1
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server did not set EXCHGID4_FLAG_USE_PNFS_MDS")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1 << FATTR4_FS_LAYOUT_TYPE)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPE not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    for lo_type in res.resarray[-1].obj_attributes[FATTR4_FS_LAYOUT_TYPE]:
        # Send GETDEVICELIST
        ops = use_obj(
            env.opts.path) + [op.getdevicelist(lo_type, 0xffffffff, 0, "")]
        res = sess.compound(ops)
        check(res)
        # STUB - check block stuff
        dev_list = res.resarray[-1].gdlr_deviceid_list
        print dev_list
Beispiel #2
0
def testGetDevList(t, env):
    """Check devlist

    FLAGS: pnfs
    CODE: GETDLIST1
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server did not set EXCHGID4_FLAG_USE_PNFS_MDS")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1<<FATTR4_FS_LAYOUT_TYPE)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPE not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    for lo_type in res.resarray[-1].obj_attributes[FATTR4_FS_LAYOUT_TYPE]:
        # Send GETDEVICELIST
        ops = use_obj(env.opts.path) + [op.getdevicelist(lo_type, 0xffffffff, 0, "")]
        res = sess.compound(ops)
        check(res)
        # STUB - check block stuff
        dev_list = res.resarray[-1].gdlr_deviceid_list
        print dev_list
Beispiel #3
0
def testGetDevInfo(t, env):
    """Check devlist

    FLAGS: pnfs
    DEPEND: GETDLIST1
    CODE: GETDINFO1
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server did not set EXCHGID4_FLAG_USE_PNFS_MDS")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1<<FATTR4_FS_LAYOUT_TYPE)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPE not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    for lo_type in res.resarray[-1].obj_attributes[FATTR4_FS_LAYOUT_TYPE]:
        # Send GETDEVICELIST
        lo_type = LAYOUT4_BLOCK_VOLUME
        ops = use_obj(env.opts.path) + [op.getdevicelist(lo_type, 0xffffffff, 0, "")]
        res = sess.compound(ops)
        check(res)
        dev_list = res.resarray[-1].gdlr_deviceid_list
        p = BlockUnpacker("")
        for dev_id in dev_list:
            ops = use_obj(env.opts.path) + [op.getdeviceinfo(dev_id, lo_type, 0xffffffff, 0)]
            res = sess.compound(ops)
            check(res)
            if lo_type==LAYOUT4_BLOCK_VOLUME:
                p.reset(res.resarray[-1].da_addr_body)
                decode = p.unpack_pnfs_block_deviceaddr4()
                p.done()
                print decode
Beispiel #4
0
def testGetDevList(t, env):
    """Check devlist

    FLAGS: layout all
    CODE: LAYOUT2
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server can not be used as pnfs metadata server")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1 << FATTR4_FS_LAYOUT_TYPE)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPE not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    if LAYOUT4_BLOCK_VOLUME not in res.resarray[-1].obj_attributes[
            FATTR4_FS_LAYOUT_TYPE]:
        fail("layout_type does not contain BLOCK")
    # Send GETDEVICELIST
    ops = use_obj(
        env.opts.path) + [op.getdevicelist(LAYOUT4_BLOCK_VOLUME, 0, 0, "")]
    res = sess.compound(ops)
    check(res)
Beispiel #5
0
def testGetDevInfo(t, env):
    """Check devlist

    FLAGS: pnfs
    DEPEND: GETDLIST1
    CODE: GETDINFO1
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server did not set EXCHGID4_FLAG_USE_PNFS_MDS")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1<<FATTR4_FS_LAYOUT_TYPES)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPES not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    for lo_type in res.resarray[-1].obj_attributes[FATTR4_FS_LAYOUT_TYPES]:
        # Send GETDEVICELIST
        lo_type = LAYOUT4_BLOCK_VOLUME
        ops = use_obj(env.opts.path) + [op.getdevicelist(lo_type, 0xffffffff, 0, "")]
        res = sess.compound(ops)
        check(res)
        dev_list = res.resarray[-1].gdlr_deviceid_list
        p = BlockUnpacker("")
        for dev_id in dev_list:
            ops = use_obj(env.opts.path) + [op.getdeviceinfo(dev_id, lo_type, 0xffffffff, 0)]
            res = sess.compound(ops)
            check(res)
            if lo_type==LAYOUT4_BLOCK_VOLUME:
                p.reset(res.resarray[-1].da_addr_body)
                decode = p.unpack_pnfs_block_deviceaddr4()
                p.done()
                print decode
Beispiel #6
0
def testGetDevList(t, env):
    """Check devlist

    FLAGS: layout all
    CODE: LAYOUT2
    """
    # Make sure E_ID returns MDS capabilities
    c1 = env.c1.new_client(env.testname(t), flags=EXCHGID4_FLAG_USE_PNFS_MDS)
    if not c1.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
        fail("Server can not be used as pnfs metadata server")
    sess = c1.create_session()
    # Test that fs handles block layouts
    ops = use_obj(env.opts.path) + [op.getattr(1<<FATTR4_FS_LAYOUT_TYPE)]
    res = sess.compound(ops)
    check(res)
    if FATTR4_FS_LAYOUT_TYPE not in res.resarray[-1].obj_attributes:
        fail("fs_layout_type not available")
    if LAYOUT4_BLOCK_VOLUME not in res.resarray[-1].obj_attributes[FATTR4_FS_LAYOUT_TYPE]:
        fail("layout_type does not contain BLOCK")
    # Send GETDEVICELIST
    ops = use_obj(env.opts.path) + [op.getdevicelist(LAYOUT4_BLOCK_VOLUME, 0, 0, "")]
    res = sess.compound(ops)
    check(res)