removed VnodeClient.icmd and VnodeClient.term
This commit is contained in:
parent
b5d71bab82
commit
69772f993c
3 changed files with 2 additions and 85 deletions
|
@ -3,7 +3,6 @@ Unit tests for testing basic CORE networks.
|
|||
"""
|
||||
|
||||
import os
|
||||
import stat
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
|
@ -12,31 +11,12 @@ 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
|
||||
|
||||
_PATH = os.path.abspath(os.path.dirname(__file__))
|
||||
_MOBILITY_FILE = os.path.join(_PATH, "mobility.scen")
|
||||
_WIRED = [NodeTypes.PEER_TO_PEER, NodeTypes.HUB, NodeTypes.SWITCH]
|
||||
|
||||
|
||||
def createclients(sessiondir, clientcls=VnodeClient, cmdchnlfilterfunc=None):
|
||||
"""
|
||||
Create clients
|
||||
|
||||
:param str sessiondir: session directory to create clients
|
||||
:param class clientcls: class to create clients from
|
||||
:param func cmdchnlfilterfunc: command channel filter function
|
||||
:return: list of created clients
|
||||
:rtype: list
|
||||
"""
|
||||
direntries = map(lambda x: os.path.join(sessiondir, x), os.listdir(sessiondir))
|
||||
cmdchnls = list(filter(lambda x: stat.S_ISSOCK(os.stat(x).st_mode), direntries))
|
||||
if cmdchnlfilterfunc:
|
||||
cmdchnls = list(filter(cmdchnlfilterfunc, cmdchnls))
|
||||
cmdchnls.sort()
|
||||
return map(lambda x: clientcls(os.path.basename(x), x), cmdchnls)
|
||||
|
||||
|
||||
def ping(from_node, to_node, ip_prefixes):
|
||||
address = ip_prefixes.ip4_address(to_node)
|
||||
try:
|
||||
|
@ -106,15 +86,8 @@ class TestCore:
|
|||
# check we are connected
|
||||
assert client.connected()
|
||||
|
||||
# check various command using vcmd module
|
||||
command = ["ls"]
|
||||
assert not client.icmd(command)
|
||||
|
||||
# check various command using command line
|
||||
assert not client.icmd(command)
|
||||
|
||||
# check module methods
|
||||
assert createclients(session.session_dir)
|
||||
# validate command
|
||||
assert client.check_cmd("echo hello") == "hello"
|
||||
|
||||
def test_netif(self, session, ip_prefixes):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue