removed utils.cmd and related node functions
This commit is contained in:
parent
f6cdeb23de
commit
c3d27eb8a5
7 changed files with 14 additions and 103 deletions
|
@ -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:
|
||||
|
|
|
@ -10,6 +10,7 @@ import pytest
|
|||
|
||||
from core.emulator.emudata import NodeOptions
|
||||
from core.emulator.enumerations import MessageFlags, NodeTypes
|
||||
from core.errors import CoreCommandError
|
||||
from core.location.mobility import BasicRangeModel, Ns2ScriptedMobility
|
||||
from core.nodes.client import VnodeClient
|
||||
|
||||
|
@ -38,7 +39,12 @@ def createclients(sessiondir, clientcls=VnodeClient, cmdchnlfilterfunc=None):
|
|||
|
||||
def ping(from_node, to_node, ip_prefixes):
|
||||
address = ip_prefixes.ip4_address(to_node)
|
||||
return from_node.node_net_cmd(["ping", "-c", "3", address])
|
||||
try:
|
||||
from_node.node_net_cmd(["ping", "-c", "3", address])
|
||||
status = 0
|
||||
except CoreCommandError as e:
|
||||
status = e.returncode
|
||||
return status
|
||||
|
||||
|
||||
class TestCore:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue