updates to attempt to support trying to run traditional services in some manner within the context of a docker node
This commit is contained in:
parent
5971950523
commit
6ab8368f1c
3 changed files with 68 additions and 14 deletions
|
@ -7,25 +7,28 @@ from core.emulator.enumerations import NodeTypes, EventTypes
|
|||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
coreemu = CoreEmu()
|
||||
session = coreemu.create_session()
|
||||
session.set_state(EventTypes.CONFIGURATION_STATE)
|
||||
|
||||
# create nodes and interfaces
|
||||
try:
|
||||
# create nodes one
|
||||
prefixes = IpPrefixes(ip4_prefix="10.83.0.0/16")
|
||||
node_one = session.add_node(_type=NodeTypes.DOCKER)
|
||||
node_two = session.add_node()
|
||||
session.services.add_services(node_one, node_one.type, ["SSH"])
|
||||
logging.info("docker node(%s): %s", node_one.name, node_one.services)
|
||||
interface_one = prefixes.create_interface(node_one)
|
||||
|
||||
# create nodes two
|
||||
node_two = session.add_node()
|
||||
interface_two = prefixes.create_interface(node_two)
|
||||
|
||||
# add link
|
||||
input("press key to continue")
|
||||
session.add_link(node_one.id, node_two.id, interface_one, interface_two)
|
||||
print(node_one.cmd_output("ifconfig"))
|
||||
print(node_two.cmd_output("ifconfig"))
|
||||
input("press key to continue")
|
||||
|
||||
# instantiate
|
||||
logging.info("INSTANTIATE")
|
||||
logging.info("docker node(%s): %s", node_one.name, node_one.services)
|
||||
session.instantiate()
|
||||
finally:
|
||||
input("continue to shutdown")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue