removed utils.cmd and related node functions

This commit is contained in:
Blake Harnden 2019-10-10 23:01:16 -07:00
parent f6cdeb23de
commit c3d27eb8a5
7 changed files with 14 additions and 103 deletions

View file

@ -12,7 +12,7 @@ from core.emane.ieee80211abg import EmaneIeee80211abgModel
from core.emane.rfpipe import EmaneRfPipeModel
from core.emane.tdma import EmaneTdmaModel
from core.emulator.emudata import NodeOptions
from core.errors import CoreError
from core.errors import CoreCommandError, CoreError
_EMANE_MODELS = [
EmaneIeee80211abgModel,
@ -26,7 +26,12 @@ _DIR = os.path.dirname(os.path.abspath(__file__))
def ping(from_node, to_node, ip_prefixes, count=3):
address = ip_prefixes.ip4_address(to_node)
return from_node.node_net_cmd(["ping", "-c", str(count), address])
try:
from_node.node_net_cmd(["ping", "-c", str(count), address])
status = 0
except CoreCommandError as e:
status = e.returncode
return status
class TestEmane: