def testGetDevInfo(t, env): """Check devlist FLAGS: pnfs DEPEND: GETDLIST1 CODE: GETDINFO1 """ sess = env.c1.new_pnfs_client_session(env.testname(t)) # 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
def testGetDevInfo(t, env): """Check devlist FLAGS: pnfs DEPEND: GETDLIST1 CODE: GETDINFO1 """ sess = env.c1.new_pnfs_client_session(env.testname(t)) # 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)
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
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