daemon: update how emane is started on nodes, fixing issue with multiple interfaces running emane, added test case to check on this in the future
This commit is contained in:
parent
82d87445b6
commit
d981d88a6f
8 changed files with 227 additions and 127 deletions
|
@ -11,7 +11,7 @@ from core.emulator.data import InterfaceData, LinkOptions
|
|||
from core.emulator.distributed import DistributedServer
|
||||
from core.emulator.enumerations import NodeTypes, TransportType
|
||||
from core.errors import CoreCommandError, CoreError
|
||||
from core.executables import MOUNT, UMOUNT
|
||||
from core.executables import MOUNT, TEST, UMOUNT
|
||||
from core.nodes.base import CoreNetworkBase, CoreNodeBase
|
||||
from core.nodes.interface import CoreInterface
|
||||
from core.nodes.network import CoreNetwork, GreTap
|
||||
|
@ -55,6 +55,19 @@ class PhysicalNode(CoreNodeBase):
|
|||
|
||||
self.rmnodedir()
|
||||
|
||||
def path_exists(self, path: str) -> bool:
|
||||
"""
|
||||
Determines if a file or directory path exists.
|
||||
|
||||
:param path: path to file or directory
|
||||
:return: True if path exists, False otherwise
|
||||
"""
|
||||
try:
|
||||
self.host_cmd(f"{TEST} -e {path}")
|
||||
return True
|
||||
except CoreCommandError:
|
||||
return False
|
||||
|
||||
def termcmdstring(self, sh: str = "/bin/sh") -> str:
|
||||
"""
|
||||
Create a terminal command string.
|
||||
|
@ -291,6 +304,19 @@ class Rj45Node(CoreNodeBase):
|
|||
self.up = False
|
||||
self.restorestate()
|
||||
|
||||
def path_exists(self, path: str) -> bool:
|
||||
"""
|
||||
Determines if a file or directory path exists.
|
||||
|
||||
:param path: path to file or directory
|
||||
:return: True if path exists, False otherwise
|
||||
"""
|
||||
try:
|
||||
self.host_cmd(f"{TEST} -e {path}")
|
||||
return True
|
||||
except CoreCommandError:
|
||||
return False
|
||||
|
||||
def new_iface(
|
||||
self, net: CoreNetworkBase, iface_data: InterfaceData
|
||||
) -> CoreInterface:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue