Files
infix/test/case/meta/play.py
T
Tobias WaldekranzandJoachim Wiberg be7b57412e test/case: Add meta/play
Launches an interactive ipython environment, attached to Infix nodes.
This can be used as a playground for developing tests, testing out
NETCONF operations, etc.
2023-06-30 15:33:10 +02:00

20 lines
412 B
Python
Executable File

#!/usr/bin/env -S ipython3 -i
import json
import infamy
def jq(yangdata):
print(json.dumps(yangdata, indent=True))
env = infamy.Env()
ctrl = env.ptop.get_ctrl()
infixen = env.ptop.get_infixen()
for ix in infixen:
(_, cport), (_, ixport) = env.ptop.get_path(ctrl, ix)
print(f"Attaching to {ix}:{ixport} via {ctrl}:{cport}")
exec(f"{ix} = env.attach(\"{ix}\", \"{ixport}\")")
print("\nGLHF")