Skip to content

Commit fc60133

Browse files
Stephane Robertlindycoder
authored andcommitted
Add Arista to Global Reactor
In order to run the compliance tests
1 parent d30be21 commit fc60133

File tree

13 files changed

+74
-47
lines changed

13 files changed

+74
-47
lines changed

constraints.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44
#
55
# pip-compile --no-index --no-emit-trusted-host --output-file constraints.txt requirements.txt
66
#
7-
certifi==2018.8.24 # via requests
7+
certifi==2018.10.15 # via requests
88
chardet==3.0.4 # via requests
9-
click==6.7 # via flask
9+
click==7.0 # via flask
1010
ecdsa==0.13 # via paramiko
1111
flask==1.0.2
1212
idna==2.7 # via requests
1313
itsdangerous==0.24 # via flask
1414
jinja2==2.10 # via flask
15-
lxml==4.2.4 # via ncclient
15+
lxml==4.2.5 # via ncclient
1616
markupsafe==1.0 # via jinja2
17-
ncclient==0.6.2
17+
ncclient==0.6.3
1818
netaddr==0.7.19
1919
paramiko==1.17.6
20-
pbr==4.2.0
20+
pbr==5.0.0
2121
pycrypto==2.6.1 # via paramiko
22-
requests==2.19.1
22+
pyeapi==0.8.2
23+
requests==2.20.0
2324
selectors2==2.0.1 # via ncclient
2425
six==1.11.0 # via ncclient
25-
urllib3==1.23 # via requests
26+
urllib3==1.24 # via requests
2627
werkzeug==0.14.1 # via flask

netman/adapters/switches/arista.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
from netman.core.objects.vlan import Vlan
1010

1111

12+
def eapi(switch_descriptor):
13+
return Arista(switch_descriptor=switch_descriptor)
14+
15+
1216
class Arista(SwitchBase):
1317
def __init__(self, switch_descriptor):
1418
super(Arista, self).__init__(switch_descriptor)

netman/core/switch_factory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from netman.adapters.switches import cisco, juniper, dell, dell10g, brocade
15+
from netman.adapters.switches import cisco, juniper, dell, dell10g, brocade, arista
1616
from netman.adapters.switches.juniper.mx import netconf as mx_netconf
1717
from netman.adapters.switches.remote import RemoteSwitch
1818
from netman.core.objects.flow_control_switch import FlowControlSwitch
1919
from netman.core.objects.switch_descriptor import SwitchDescriptor
2020

2121
factories = {
22+
"arista": arista.eapi,
2223
"cisco": cisco.ssh,
2324
"brocade": brocade.ssh,
2425
"brocade_ssh": brocade.ssh,

test-constraints.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
#
55
# pip-compile --no-index --no-emit-trusted-host --output-file test-constraints.txt test-requirements.txt constraints.txt rtd-requirements.txt
66
#
7-
alabaster==0.7.11 # via sphinx
7+
alabaster==0.7.12 # via sphinx
88
appdirs==1.4.3 # via rply, twisted
99
args==0.1.0 # via clint
1010
asn1crypto==0.24.0 # via cryptography
1111
astor==0.7.1 # via hy
1212
babel==2.6.0 # via sphinx
13-
certifi==2018.8.24
13+
certifi==2018.10.15
1414
cffi==1.11.5 # via cryptography
1515
chardet==3.0.4
16-
click==6.7
16+
click==7.0
1717
clint==0.5.1 # via hy
1818
configparser==3.5.0 # via flake8
1919
constantly==15.1.0 # via twisted
2020
cryptography==2.3.1 # via twisted
2121
docutils==0.14 # via sphinx
2222
ecdsa==0.13
2323
enum34==1.1.6 # via cryptography, flake8
24-
fake-switches==1.2.5
24+
fake-switches==1.3.0
2525
flake8==3.4.1
2626
flask==1.0.2
2727
flexmock==0.10.2
@@ -35,34 +35,36 @@ imagesize==1.1.0 # via sphinx
3535
incremental==17.5.0 # via twisted
3636
ipaddress==1.0.22 # via cryptography
3737
itsdangerous==0.24
38+
jabstract==0.1.2
3839
jinja2==2.10
39-
lxml==4.2.4
40+
lxml==4.2.5
4041
markupsafe==1.0
4142
mccabe==0.6.1 # via flake8
4243
mock==2.0.0
4344
mockssh==1.4.3
44-
ncclient==0.6.2
45+
ncclient==0.6.3
4546
netaddr==0.7.19
4647
nose==1.3.7
4748
paramiko==1.17.6
48-
pbr==4.2.0
49+
pbr==5.0.0
4950
pyasn1==0.4.4 # via mockssh, twisted
5051
pycodestyle==2.3.1 # via flake8
51-
pycparser==2.18 # via cffi
52+
pycparser==2.19 # via cffi
5253
pycrypto==2.6.1
54+
pyeapi==0.8.2
5355
pyflakes==1.5.0 # via flake8
5456
pygments==2.2.0 # via sphinx
5557
pyhamcrest==1.9.0
5658
pytz==2018.5 # via babel
57-
requests==2.19.1
59+
requests==2.20.0
5860
rply==0.7.6 # via hy
5961
selectors2==2.0.1
6062
six==1.11.0
6163
snowballstemmer==1.2.1 # via sphinx
6264
sphinx==1.5.6
6365
sphinxcontrib-httpdomain==1.7.0
64-
tftpy==0.7.0 # via fake-switches
66+
tftpy==0.8.0 # via fake-switches
6567
twisted[conch]==16.6.0 # via fake-switches, mockssh
66-
urllib3==1.23
68+
urllib3==1.24
6769
werkzeug==0.14.1
6870
zope.interface==4.5.0 # via twisted

tests/adapters/compliance_tests/add_vlan_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
class AddVlanTest(ComplianceTestCase):
24-
_dev_sample = "juniper_qfx_copper"
24+
_dev_sample = "arista"
2525

2626
def test_creates_an_empty_vlan(self):
2727
self.client.add_vlan(1000)

tests/adapters/model_list.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from fake_switches.arista.arista_core import AristaSwitchCore
1516
from fake_switches.brocade.brocade_core import BrocadeSwitchCore
1617
from fake_switches.cisco.cisco_core import CiscoSwitchCore
1718
from fake_switches.cisco6500.cisco_core import Cisco6500SwitchCore
@@ -20,12 +21,31 @@
2021
from fake_switches.juniper.juniper_core import JuniperSwitchCore
2122
from fake_switches.juniper_mx.juniper_mx_core import JuniperMXSwitchCore
2223
from fake_switches.juniper_qfx_copper.juniper_qfx_copper_core import JuniperQfxCopperSwitchCore
23-
from fake_switches.ssh_service import SwitchSshService
24+
from fake_switches.transports.ssh_service import SwitchSshService
2425
from fake_switches.switch_configuration import Port, AggregatedPort
25-
from fake_switches.telnet_service import SwitchTelnetService
26+
from fake_switches.transports.telnet_service import SwitchTelnetService
27+
from fake_switches.transports.http_service import SwitchHttpService
28+
2629
from netman.core.objects.switch_descriptor import SwitchDescriptor
2730

2831
available_models = [
32+
{
33+
"switch_descriptor": SwitchDescriptor(
34+
model="arista",
35+
hostname="127.0.0.1",
36+
port=11015,
37+
username="root",
38+
password="root",
39+
),
40+
"test_port_name": "Ethernet1",
41+
"test_vrrp_track_id": "",
42+
"core_class": AristaSwitchCore,
43+
"service_class": SwitchHttpService,
44+
"ports": [
45+
Port("Ethernet1"),
46+
Port("Ethernet2"),
47+
]
48+
},
2949
{
3050
"switch_descriptor": SwitchDescriptor(
3151
model="cisco",

tests/adapters/unified_tests/bond_management_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class BondManagementTest(ConfiguredTestCase):
2222
__test__ = False
2323

24-
@skip_on_switches("cisco", "brocade", "brocade_telnet", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx")
24+
@skip_on_switches("cisco", "brocade", "brocade_telnet", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx", "arista")
2525
def test_creating_deleting_a_bond(self):
2626
self.client.add_bond(3)
2727

tests/adapters/unified_tests/dhcp_relay_server_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class DhcpRelayServerTest(ConfiguredTestCase):
2222
__test__ = False
2323

24-
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx", "dell", "dell_telnet", "dell10g", "dell10g_telnet")
24+
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "arista")
2525
def test_add_and_get_and_delete_dhcp_relay_server(self):
2626
try:
2727
self.client.add_vlan(2999, name="my-test-vlan")

tests/adapters/unified_tests/interface_management_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
class InterfaceManagementTest(ConfiguredTestCase):
1919
__test__ = False
2020

21-
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx")
21+
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx", "arista")
2222
def test_set_interface_state_off(self):
2323
self.client.set_interface_state(self.test_port, OFF)
2424

25-
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx")
25+
@skip_on_switches("juniper", "juniper_qfx_copper", "juniper_mx", "arista")
2626
def test_set_interface_state_on(self):
2727
self.client.set_interface_state(self.test_port, ON)
2828

29-
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx")
29+
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx", "arista")
3030
def test_edit_spanning_tree(self):
3131
self.client.edit_interface_spanning_tree(self.test_port, edge=True)
3232

33-
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx")
33+
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx", "arista")
3434
def test_set_interface_lldp_state(self):
3535
self.client.set_interface_lldp_state(self.test_port, enabled=True)
3636

37-
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx")
37+
@skip_on_switches("cisco", "brocade", "brocade_telnet", "juniper_mx", "arista")
3838
def test_disable_lldp(self):
3939
self.client.set_interface_lldp_state(self.test_port, enabled=False)

tests/adapters/unified_tests/ip_management_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class IpManagementTest(ConfiguredTestCase):
2626
__test__ = False
2727

28-
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx")
28+
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx", "arista")
2929
def test_adding_and_removing_ip_basic(self):
3030
self.client.add_vlan(2345)
3131

@@ -58,7 +58,7 @@ def test_adding_and_removing_ip_basic(self):
5858

5959
self.client.remove_vlan(2345)
6060

61-
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx")
61+
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx", "arista")
6262
def test_adding_unavailable_ips_and_various_errors(self):
6363
self.client.add_vlan(2345)
6464

@@ -91,7 +91,7 @@ def test_adding_unavailable_ips_and_various_errors(self):
9191

9292
self.client.remove_vlan(2345)
9393

94-
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx")
94+
@skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx", "arista")
9595
def test_handling_access_groups(self):
9696
self.client.add_vlan(2345)
9797

0 commit comments

Comments
 (0)