Open leonardhyu opened 1 year ago
done by 6f145b881c842918865938fce10a411fa187cc15
Module and all its ports are reserved by others. Got the error using the code below:
async def my_awesome_func(stop_event: asyncio.Event):
# create credential object
credentials = dataset.Credentials(
product=dataset.EProductType.VALKYRIE,
host=CHASSIS_IP)
# create chimera core controller object
controller = await MainController()
# add chimera emulator into the chassis inventory and get the ID
tester_id = await controller.add_tester(credentials=credentials)
# create tester object
tester = await controller.use(tester_id, username=USERNAME, reserve=False, debug=False)
# create module object
module = await tester.use_module(module_id=MODULE_IDX, reserve=False)
# free the module in case it is reserved by others
await module.free(should_free_sub_resources=True)
await module.reserve()
# create port object and reserver the port
port = await tester.use_port(module_id=MODULE_IDX, port_id=PORT_IDX, reserve=False)
# reserve the port
await port.reserve()
# reset port
await port.reset()
return
@fpfeng got some errors
@leonardhyu the image are not loading, dead link maybe?
Please improve resource reservation (similar functionalities are implemented in HLFUNC.mgmt but chimera-core doesn't work with xoa-driver.hlfunc, therefore, please improve as shown below)
resource.free(flag)
resource.reserve()
I guess it should be updated here?
so we can do this: