New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cmlutils

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmlutils - pypi Package Compare versions

Comparing version
2.2.1
to
2.3.0
+1
-1
cmlutils.egg-info/requires.txt

@@ -7,2 +7,2 @@ PyYAML

tabulate
virl2-client>=2.2.1
virl2-client>=2.6.0

@@ -106,3 +106,3 @@ import functools

def get_cml23_id(self):
def get_cml24_id(self):
return "88119b68-9d08-40c4-90f5-6dc533fd0254"

@@ -142,11 +142,11 @@

"labs/{}/topology".format(self.get_alt_id()): MockCMLServer.get_alt_topology,
"labs/{}/topology".format(self.get_cml23_id()): MockCMLServer.get_topology_23,
"labs/{}/topology".format(self.get_cml24_id()): MockCMLServer.get_topology_24,
"labs/{}/lab_element_state".format(self.get_test_id()): MockCMLServer.get_lab_element_state,
"labs/{}/lab_element_state".format(self.get_cml23_id()): MockCMLServer.get_lab_element_state_23,
"labs/{}/lab_element_state".format(self.get_cml24_id()): MockCMLServer.get_lab_element_state_24,
"system_information": MockCMLServer.get_sys_info,
"labs/{}/state".format(self.get_test_id()): "STARTED",
"labs/{}/state".format(self.get_cml23_id()): "STARTED",
"labs/{}/state".format(self.get_cml24_id()): "STARTED",
"labs/{}/state".format(self.get_alt_id()): "STOPPED",
"labs/{}/check_if_converged".format(self.get_test_id()): True,
"labs/{}/check_if_converged".format(self.get_cml23_id()): True,
"labs/{}/check_if_converged".format(self.get_cml24_id()): True,
"labs/{}/nodes/n1/check_if_converged".format(self.get_test_id()): True,

@@ -158,3 +158,3 @@ "users": MockCMLServer.get_users,

"labs/{}/download".format(self.get_test_id()): MockCMLServer.download_lab,
"labs/{}/download".format(self.get_cml23_id()): MockCMLServer.download_lab_23,
"labs/{}/download".format(self.get_cml24_id()): MockCMLServer.download_lab_24,
"labs/{}/download".format(self.get_alt_id()): MockCMLServer.download_alt_lab,

@@ -161,0 +161,0 @@ "labs/{}/pyats_testbed".format(self.get_test_id()): MockCMLServer.get_pyats_testbed,

@@ -1,15 +0,6 @@

import unittest
from click.testing import CliRunner
from . import CLIENT_VERSION, BaseCMLTest
from .mocks.github import MockGitHub # noqa
from . import BaseCMLTest
try:
from unittest.mock import patch
except ImportError:
from mock import patch # noqa
@unittest.skipIf(CLIENT_VERSION < CLIENT_VERSION.__class__("2.4.0"), "supported since 2.4.0")
class TestCMLCluster(BaseCMLTest):

@@ -16,0 +7,0 @@ def setup_mocks(self, m):

@@ -32,3 +32,3 @@ from click.testing import CliRunner

@patch("virl.cli.console.commands.call", autospec=False)
def test_cml_console_connect_23(self, call_mock):
def test_cml_console_connect_24(self, call_mock):
with self.get_context() as m:

@@ -39,4 +39,4 @@ # Mock the request to return what we expect from the API.

runner = CliRunner()
runner.invoke(virl, ["use", "--id", self.get_cml23_id()])
runner.invoke(virl, ["use", "--id", self.get_cml24_id()])
runner.invoke(virl, ["console", "rtr-1"])
call_mock.assert_called_once_with(["ssh", "-t", "admin@localhost", "open", "/Mock", "Test", "2.3/rtr-1/0"])
call_mock.assert_called_once_with(["ssh", "-t", "admin@localhost", "open", "/Mock", "Test", "2.4/rtr-1/0"])

@@ -238,23 +238,31 @@ class MockCMLServer(object):

notes: ''
timestamp: 1597805276.8213837
title: Mock Test
version: 0.0.3
version: 0.1.0
links:
- id: l0
n1: n1
n2: n0
i1: i1
i2: i0
label: rtr-1-MgmtEth0/RP0/CPU0/0<->Lab Net-port
nodes:
- id: n0
- boot_disk_size: 0
configuration: bridge0
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n0
label: Lab Net
node_definition: external_connector
ram: 0
tags: []
x: -400
y: 0
configuration: bridge0
tags: []
interfaces:
- id: i0
label: port
slot: 0
label: port
type: physical
- id: n1
label: rtr-1
node_definition: iosxrv9000
x: -200
y: -50
- boot_disk_size: 0
configuration: |-

@@ -278,4 +286,14 @@ hostname changeme

end
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n1
image_definition: iosxrv9000-6-6-2
label: rtr-1
node_definition: iosxrv9000
ram: 0
tags: []
x: -200
y: -50
interfaces:

@@ -286,22 +304,18 @@ - id: i0

- id: i1
label: MgmtEth0/RP0/CPU0/0
slot: 0
label: MgmtEth0/RP0/CPU0/0
type: physical
- id: i2
label: donotuse1
slot: 1
label: donotuse1
type: physical
- id: i3
label: donotuse2
slot: 2
label: donotuse2
type: physical
- id: i4
label: GigabitEthernet0/0/0/0
slot: 3
label: GigabitEthernet0/0/0/0
type: physical
- id: n2
label: rtr-2
node_definition: iosxrv9000
x: -200
y: -50
- boot_disk_size: 0
configuration: |-

@@ -325,4 +339,14 @@ hostname changeme

end
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n2
image_definition: iosxrv9000-6-6-2
label: rtr-2
node_definition: iosxrv9000
ram: 0
tags: []
x: -300
y: 50
interfaces:

@@ -333,23 +357,17 @@ - id: i0

- id: i1
label: MgmtEth0/RP0/CPU0/0
slot: 0
label: MgmtEth0/RP0/CPU0/0
type: physical
- id: i2
label: donotuse1
slot: 1
label: donotuse1
type: physical
- id: i3
label: donotuse2
slot: 2
label: donotuse2
type: physical
- id: i4
label: GigabitEthernet0/0/0/0
slot: 3
label: GigabitEthernet0/0/0/0
type: physical
links:
- id: l0
i1: i1
n1: n1
i2: i0
n2: n0
"""

@@ -359,3 +377,3 @@ return response

@staticmethod
def download_lab_23(req, ctx=None):
def download_lab_24(req, ctx=None):
response = """

@@ -365,23 +383,31 @@ lab:

notes: ''
timestamp: 1597805276.8213837
title: Mock Test 2.3
version: 0.0.3
title: Mock Test 2.4
version: 0.1.0
links:
- id: l0
n1: n1
n2: n0
i1: i1
i2: i0
label: rtr-1-MgmtEth0/RP0/CPU0/0<->Lab Net-port
nodes:
- id: 88119b68-9d08-40c4-90f5-6dc533fd0255
- boot_disk_size: 0
configuration: bridge0
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n0
label: Lab Net
node_definition: external_connector
ram: 0
tags: []
x: -400
y: 0
configuration: bridge0
tags: []
interfaces:
- id: i0
label: port
slot: 0
label: port
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd0256
label: rtr-1
node_definition: iosxrv9000
x: -200
y: -50
- boot_disk_size: 0
configuration: |-

@@ -405,29 +431,34 @@ hostname changeme

end
image_definition: iosxrv9000-6-6-2
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n1
label: rtr-1
node_definition: iosxrv9000
ram: 0
tags: []
x: -200
y: -50
interfaces:
- id: 88119b68-9d08-40c4-90f5-6dc533fd020a
- id: i0
label: Loopback0
type: loopback
- id: 88119b68-9d08-40c4-90f5-6dc533fd020b
- id: i1
label: MgmtEth0/RP0/CPU0/0
slot: 0
label: MgmtEth0/RP0/CPU0/0
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd020c
- id: i2
label: donotuse1
slot: 1
label: donotuse1
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd020d
- id: i3
label: donotuse2
slot: 2
label: donotuse2
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd020e
- id: i4
label: GigabitEthernet0/0/0/0
slot: 3
label: GigabitEthernet0/0/0/0
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd0257
label: rtr-2
node_definition: iosxrv9000
x: -200
y: -50
- boot_disk_size: 0
configuration: |-

@@ -451,30 +482,33 @@ hostname changeme

end
image_definition: iosxrv9000-6-6-2
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n2
label: rtr-2
node_definition: iosxrv9000
ram: 0
tags: []
x: -300
y: 50
interfaces:
- id: 88119b68-9d08-40c4-90f5-6dc533fd021a
- id: i0
label: Loopback0
type: loopback
- id: 88119b68-9d08-40c4-90f5-6dc533fd021b
- id: i1
label: MgmtEth0/RP0/CPU0/0
slot: 0
label: MgmtEth0/RP0/CPU0/0
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd021c
- id: i2
label: donotuse1
slot: 1
label: donotuse1
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd021d
- id: i3
label: donotuse2
slot: 2
label: donotuse2
type: physical
- id: 88119b68-9d08-40c4-90f5-6dc533fd021e
- id: i4
label: GigabitEthernet0/0/0/0
slot: 3
label: GigabitEthernet0/0/0/0
type: physical
links:
- id: l0
i1: i1
n1: n1
i2: i0
n2: n0
"""

@@ -489,14 +523,26 @@ return response

notes: ''
timestamp: 1595337039.0416706
title: Other Lab
version: 0.0.3
version: 0.1.0
links:
- id: l0
n1: n0
n2: n1
i1: i1
i2: i1
label: nxos9000-0-mgmt0<->xr9kv-0-MgmtEth0/RP0/CPU0/0
nodes:
- id: n0
- boot_disk_size: 0
configuration: hostname inserthostname_here
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n0
image_definition: nxosv9000-9-2-3
label: nxos9000-0
node_definition: nxosv9000
ram: 0
tags: []
x: -450
y: -50
configuration: hostname inserthostname_here
image_definition: nxosv9000-9-2-3
tags: []
interfaces:

@@ -507,22 +553,18 @@ - id: i0

- id: i1
label: mgmt0
slot: 0
label: mgmt0
type: physical
- id: i2
label: Ethernet1/1
slot: 1
label: Ethernet1/1
type: physical
- id: i3
label: Ethernet1/2
slot: 2
label: Ethernet1/2
type: physical
- id: i4
label: Ethernet1/3
slot: 3
label: Ethernet1/3
type: physical
- id: n1
label: xr9kv-0
node_definition: iosxrv9000
x: -150
y: -50
- boot_disk_size: 0
configuration: |-

@@ -546,4 +588,14 @@ hostname changeme

end
cpu_limit: 100
cpus: 0
data_volume: 0
hide_links: false
id: n1
image_definition: iosxrv9000-6-6-2
label: xr9kv-0
node_definition: iosxrv9000
ram: 0
tags: []
x: -150
y: -50
interfaces:

@@ -554,23 +606,17 @@ - id: i0

- id: i1
label: MgmtEth0/RP0/CPU0/0
slot: 0
label: MgmtEth0/RP0/CPU0/0
type: physical
- id: i2
label: donotuse1
slot: 1
label: donotuse1
type: physical
- id: i3
label: donotuse2
slot: 2
label: donotuse2
type: physical
- id: i4
label: GigabitEthernet0/0/0/0
slot: 3
label: GigabitEthernet0/0/0/0
type: physical
links:
- id: l0
i1: i1
n1: n0
i2: i1
n2: n1
"""

@@ -581,3 +627,3 @@ return response

def get_sys_info(req, ctx=None):
response = {"version": "2.4.0+build.3", "ready": True}
response = {"version": "2.6.0+build.5", "ready": True}
return response

@@ -604,4 +650,4 @@

@staticmethod
def get_lab_element_state_23(req, ctx=None):
return MockCMLServer._get_lab_element_state_23(req, ctx)
def get_lab_element_state_24(req, ctx=None):
return MockCMLServer._get_lab_element_state_24(req, ctx)

@@ -622,3 +668,3 @@ @staticmethod

@staticmethod
def _get_lab_element_state_23(req, ctx=None, n2_state="BOOTED"):
def _get_lab_element_state_24(req, ctx=None, n2_state="BOOTED"):
response = {

@@ -713,10 +759,9 @@ "nodes": {

],
"lab_notes": "",
"lab_title": "Mock Test",
"lab_description": "",
"lab_owner": "admin",
"state": "STARTED",
"created_timestamp": 1597805276.8213837,
"cluster_id": "cluster_1",
"version": "0.0.3",
"lab": {
"description": "",
"notes": "",
"owner": "00000000-0000-4000-a000-000000000000",
"title": "Mock Test",
"version": "0.1.0",
},
}

@@ -781,10 +826,9 @@ return response

],
"lab_notes": "",
"lab_title": "Other Lab",
"lab_description": "",
"lab_owner": "admin",
"state": "STOPPED",
"created_timestamp": 1595337039.0416706,
"cluster_id": "cluster_1",
"version": "0.0.3",
"lab": {
"description": "",
"notes": "",
"owner": "00000000-0000-4000-a000-000000000000",
"title": "Other Lab",
"version": "0.1.0",
},
}

@@ -794,3 +838,3 @@ return response

@staticmethod
def get_topology_23(req, ctx=None):
def get_topology_24(req, ctx=None):
response = {

@@ -896,10 +940,9 @@ "nodes": [

],
"lab_notes": "",
"lab_title": "Mock Test 2.3",
"lab_description": "",
"lab_owner": "admin",
"state": "STARTED",
"created_timestamp": 1597805276.8213837,
"cluster_id": "cluster_1",
"version": "0.0.3",
"lab": {
"description": "",
"notes": "",
"owner": "00000000-0000-4000-a000-000000000000",
"title": "Mock Test 2.4",
"version": "0.1.0",
},
}

@@ -906,0 +949,0 @@ return response

@@ -35,3 +35,3 @@ from click.testing import CliRunner

@patch("virl.cli.tmux.commands.libtmux.server.Server")
def test_cml_tmux_panes23(self, mock_server):
def test_cml_tmux_panes24(self, mock_server):
with self.get_context() as m:

@@ -48,10 +48,10 @@ # Mocking libtmux server

runner = CliRunner()
lab_id = self.get_cml23_id()
lab_id = self.get_cml24_id()
runner.invoke(virl, ["use", "--id", lab_id])
runner.invoke(virl, ["tmux"])
mock_server.assert_called_once()
mock_server.return_value.new_session.assert_called_once_with(session_name="Mock Test 2_3-8811", kill_session=True)
mock_server.return_value.new_session.assert_called_once_with(session_name="Mock Test 2_4-8811", kill_session=True)
expected_calls = [
call("printf '\\033]2;%s\\033\\\\' 'rtr-1'", suppress_history=True),
call("ssh -t admin@localhost open /Mock Test 2.3/rtr-1/0", suppress_history=True),
call("ssh -t admin@localhost open /Mock Test 2.4/rtr-1/0", suppress_history=True),
]

@@ -61,3 +61,3 @@ mock_pane.send_keys.assert_has_calls(expected_calls, any_order=True)

@patch("virl.cli.tmux.commands.libtmux.server.Server")
def test_cml_tmux_windows_23(self, mock_server):
def test_cml_tmux_windows_24(self, mock_server):
with self.get_context() as m:

@@ -72,7 +72,7 @@ # Mocking libtmux server

runner = CliRunner()
lab_id = self.get_cml23_id()
lab_id = self.get_cml24_id()
runner.invoke(virl, ["use", "--id", lab_id])
runner.invoke(virl, ["tmux", "--group", "windows"])
mock_server.assert_called_once()
mock_server.return_value.new_session.assert_called_once_with(session_name="Mock Test 2_3-8811", kill_session=True)
mock_server.return_value.new_session.assert_called_once_with(session_name="Mock Test 2_4-8811", kill_session=True)
expected_calls = [

@@ -79,0 +79,0 @@ call("rename-window", "rtr-1"),

@@ -91,10 +91,8 @@ import os

],
"lab_notes": "",
"lab_title": "Fake Lab",
"lab_description": "",
"lab_owner": "admin",
"state": "STOPPED",
"created_timestamp": 1589294717.9075089,
"cluster_id": "cluster_1",
"version": "0.0.3",
"lab": {
"notes": "",
"title": "Fake Lab",
"description": "",
"version": "0.1.0",
}
}

@@ -101,0 +99,0 @@ return response

@@ -1,1 +0,1 @@

__version__ = "2.2.1"
__version__ = "2.3.0"

@@ -8,6 +8,13 @@ import os

from virl.api import CachedLab, VIRLServer
from virl.helpers import (cache_lab, check_lab_cache, clear_current_lab,
get_cml_client, get_command, get_current_lab,
safe_join_existing_lab,
safe_join_existing_lab_by_title, set_current_lab)
from virl.helpers import (
cache_lab,
check_lab_cache,
clear_current_lab,
get_cml_client,
get_command,
get_current_lab,
safe_join_existing_lab,
safe_join_existing_lab_by_title,
set_current_lab,
)

@@ -131,2 +138,20 @@

if not lab and os.path.isfile(fname):
(lfname, lfext) = os.path.splitext(fname)
if lfext.lower() == ".unl":
# This is an EVE-NG lab. Convert it if we can.
rc = -1
try:
rc = call(["eve2cml", fname])
except FileNotFoundError:
pass
if rc != 0:
click.secho(
"ERROR: Failed to convert {} from EVE-NG to CML. Is https://pypi.org/project/eve2cml/ installed?".format(fname),
fg="red",
)
exit(rc)
fname = "{}.yaml".format(lfname)
lname = get_lab_title(fname)

@@ -133,0 +158,0 @@ click.secho("Importing lab {} from file {}".format(lname, fname))

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display