systestlib.random_interface

Here are the examples of the python api systestlib.random_interface taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

76 Examples 7

Example 1

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_mtu(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'ip address 111.111.111.111/24'])
            resource = dut.api('ipinterfaces')
            result = resource.set_mtu(intf, 2000)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('mtu 2000', config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 2

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree portfast'])
            resource = dut.api('stp').interfaces
            result = resource.set_portfast(intf, default=True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 3

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('interfaces').set_sflow(intf, default=True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('no sflow enable', config[0]['output'])

Example 4

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_get_interface_wo_ip_adddress(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            result = dut.api('ipinterfaces').get(intf)
            self.assertIsNone(result['address'])

Example 5

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description_negate(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'description %s' % text])
            result = dut.api('interfaces').set_description(intf, disable=True)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], '')

Example 6

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_mtu(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'ip address 111.111.111.111/24'])
            resource = dut.api('ipinterfaces')
            result = resource.set_mtu(intf, 2000)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('mtu 2000', config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 7

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_bpdugard_to_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree bpduguard enable'])
            resource = dut.api('stp').interfaces
            result = resource.set_bpduguard(intf, default=True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 8

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'shutdown'])
            result = dut.api('interfaces').default(intf)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['interfaceStatus'], 'connected')

Example 9

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_network(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree portfast'])
            resource = dut.api('stp').interfaces
            result = resource.set_portfast_type(intf, 'normal')
            self.assertTrue(result, 'dut=%s' % dut)

Example 10

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            result = dut.api('interfaces').set_description(intf, text)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], text)

Example 11

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_create_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            resource = dut.api('ipinterfaces')
            result = resource.create(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('no switchport', config[0]['output'])
            dut.config('default interface %s' % intf)

Example 12

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_enable(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'no sflow enable'])
            result = dut.api('interfaces').set_sflow(intf, True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('no sflow enable', config[0]['output'])

Example 13

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_delete_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'ip address 199.1.1.1/24'])
            resource = dut.api('ipinterfaces')
            result = resource.delete(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('ip address 199.1.1.1/24', config[0]['output'],
                             'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 14

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_delete_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'ip address 199.1.1.1/24'])
            resource = dut.api('ipinterfaces')
            result = resource.delete(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('ip address 199.1.1.1/24', config[0]['output'],
                             'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 15

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_enable(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'no sflow enable'])
            result = dut.api('interfaces').set_sflow(intf, True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('no sflow enable', config[0]['output'])

Example 16

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_bpduguard_to_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            resource = dut.api('stp').interfaces
            result = resource.set_bpduguard(intf, True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 17

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_get(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf,
                        'interface %s' % intf,
                        'description this is a test',
                        'flowcontrol send off',
                        'flowcontrol receive on',
                        'no sflow enable'])

            result = dut.api('interfaces').get(intf)

            self.assertIsInstance(result, dict)
            self.assertEqual(result['description'], 'this is a test')
            self.assertFalse(result['shutdown'])
            self.assertEqual(result['flowcontrol_send'], 'off')
            self.assertEqual(result['flowcontrol_receive'], 'on')
            self.assertFalse(result['sflow'])

Example 18

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            resource = dut.api('stp').interfaces
            result = resource.set_portfast(intf, True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 19

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_getall(self):
        for dut in self.duts:
            rintf = random_interface(dut)
            dut.config(['default interface %s' % rintf])
            result = dut.api('interfaces').getall()
            self.assertIsInstance(result, dict)
            for intf in [rintf, 'Management1']:
                self.assertIn(intf, result)

Example 20

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_edge(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            resource = dut.api('stp').interfaces
            result = resource.set_portfast_type(intf, 'edge')
            self.assertTrue(result, 'dut=%s' % dut)

Example 21

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'shutdown'])
            result = dut.api('interfaces').default(intf)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['interfaceStatus'], 'connected')

Example 22

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            result = dut.api('interfaces').set_description(intf, text)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], text)

Example 23

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_get(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('switchports').get(intf)
            self.assertIsInstance(result, dict)
            self.assertEqual(result['mode'], 'access')
            self.assertEqual(result['access_vlan'], '1')
            self.assertEqual(result['trunk_native_vlan'], '1')
            self.assertEqual(result['trunk_allowed_vlans'], '1-4094')

Example 24

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description_default(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'description %s' % text])
            result = dut.api('interfaces').set_description(intf, default=True)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], '')

Example 25

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_get(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport', 'ip address 99.98.99.99/24',
                        'mtu 1800'])
            result = dut.api('ipinterfaces').get(intf)
            values = dict(name=intf, address='99.98.99.99/24',
                          mtu=1800)
            self.assertEqual(values, result, 'dut=%s' % dut)

Example 26

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description_default(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'description %s' % text])
            result = dut.api('interfaces').set_description(intf, default=True)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], '')

Example 27

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_disable(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('interfaces').set_sflow(intf, disable=True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('no sflow enable', config[0]['output'])

Example 28

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_getall(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('switchports').getall()
            self.assertIsInstance(result, dict, 'dut=%s' % dut)
            self.assertIn(intf, result, 'dut=%s' % dut)

Example 29

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_get(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport', 'ip address 99.98.99.99/24',
                        'mtu 1800'])
            result = dut.api('ipinterfaces').get(intf)
            values = dict(name=intf, address='99.98.99.99/24',
                          mtu=1800)
            self.assertEqual(values, result, 'dut=%s' % dut)

Example 30

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_create_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            result = dut.api('switchports').create(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('no switchport', config[0]['output'],
                             'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 31

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_create_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            resource = dut.api('ipinterfaces')
            result = resource.create(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('no switchport', config[0]['output'])
            dut.config('default interface %s' % intf)

Example 32

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_address(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            resource = dut.api('ipinterfaces')
            result = resource.set_address(intf, '111.111.111.111/24')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('ip address 111.111.111.111/24',
                          config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 33

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_address(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            resource = dut.api('ipinterfaces')
            result = resource.set_address(intf, '111.111.111.111/24')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('ip address 111.111.111.111/24',
                          config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 34

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_delete_and_return_true(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('switchports').delete(intf)
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('no switchport', config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 35

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_mtu_value_as_string(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'ip address 111.111.111.111/24'])
            resource = dut.api('ipinterfaces')
            result = resource.set_mtu(intf, '2000')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('mtu 2000', config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 36

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_set_mtu_value_as_string(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'ip address 111.111.111.111/24'])
            resource = dut.api('ipinterfaces')
            result = resource.set_mtu(intf, '2000')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('mtu 2000', config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 37

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_bpdugard_to_false(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree bpduguard enable'])
            resource = dut.api('stp').interfaces
            result = resource.set_bpduguard(intf, False)
            self.assertTrue(result, 'dut=%s' % dut)

Example 38

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_disable(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('interfaces').set_sflow(intf, disable=True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('no sflow enable', config[0]['output'])

Example 39

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_bpdugard_to_no(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree bpduguard enable'])
            resource = dut.api('stp').interfaces
            result = resource.set_bpduguard(intf, disable=True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 40

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_getall(self):
        for dut in self.duts:
            rintf = random_interface(dut)
            dut.config(['default interface %s' % rintf])
            result = dut.api('interfaces').getall()
            self.assertIsInstance(result, dict)
            for intf in [rintf, 'Management1']:
                self.assertIn(intf, result)

Example 41

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_false(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree portfast'])
            resource = dut.api('stp').interfaces
            result = resource.set_portfast(intf, False)
            self.assertTrue(result, 'dut=%s' % dut)

Example 42

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_set_access_vlan_to_value(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'vlan 100'])
            resource = dut.api('switchports')
            result = resource.set_access_vlan(intf, '100')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('switchport access vlan 100', config[0]['output'],
                          'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 43

Project: pyeapi
Source File: test_api_stp.py
View license
    def test_set_portfast_to_no(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'spanning-tree portfast'])
            resource = dut.api('stp').interfaces
            result = resource.set_portfast(intf, disable=True)
            self.assertTrue(result, 'dut=%s' % dut)

Example 44

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_get(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf,
                        'interface %s' % intf,
                        'description this is a test',
                        'flowcontrol send off',
                        'flowcontrol receive on',
                        'no sflow enable'])

            result = dut.api('interfaces').get(intf)

            self.assertIsInstance(result, dict)
            self.assertEqual(result['description'], 'this is a test')
            self.assertFalse(result['shutdown'])
            self.assertEqual(result['flowcontrol_send'], 'off')
            self.assertEqual(result['flowcontrol_receive'], 'on')
            self.assertFalse(result['sflow'])

Example 45

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_set_trunk_allowed_vlans(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'switchport mode trunk'])
            resource = dut.api('switchports')
            result = resource.set_trunk_allowed_vlans(intf, '1,10,100')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('switchport trunk allowed vlan 1,10,100',
                          config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 46

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_set_trunk_native_vlan(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'switchport mode trunk', 'vlan 100'])
            resource = dut.api('switchports')
            result = resource.set_trunk_native_vlan(intf, '100')
            self.assertTrue(result, 'dut=%s' % dut)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertIn('switchport trunk native vlan 100',
                          config[0]['output'], 'dut=%s' % dut)
            dut.config('default interface %s' % intf)

Example 47

Project: pyeapi
Source File: test_api_switchports.py
View license
    def test_get_returns_none(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            result = dut.api('switchports').get(intf)
            self.assertIsNone(result)

Example 48

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_description_negate(self):
        for dut in self.duts:
            text = random_string()
            intf = random_interface(dut)
            dut.config(['interface %s' % intf, 'description %s' % text])
            result = dut.api('interfaces').set_description(intf, disable=True)
            self.assertTrue(result)
            config = dut.run_commands('show interfaces %s' % intf)
            config = config[0]['interfaces'][intf]
            self.assertEqual(config['description'], '')

Example 49

Project: pyeapi
Source File: test_api_ipinterfaces.py
View license
    def test_get_interface_wo_ip_adddress(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config(['default interface %s' % intf, 'interface %s' % intf,
                        'no switchport'])
            result = dut.api('ipinterfaces').get(intf)
            self.assertIsNone(result['address'])

Example 50

Project: pyeapi
Source File: test_api_interfaces.py
View license
    def test_set_sflow_default(self):
        for dut in self.duts:
            intf = random_interface(dut)
            dut.config('default interface %s' % intf)
            result = dut.api('interfaces').set_sflow(intf, default=True)
            self.assertTrue(result)
            config = dut.run_commands('show running-config interfaces %s' %
                                      intf, 'text')
            self.assertNotIn('no sflow enable', config[0]['output'])