aboutsummaryrefslogtreecommitdiffstats
path: root/test/scripts/git_pull_or_clean.sh
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-02 15:17:21 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-08-09 13:51:40 +0000
commitc7f0fe030fec4aafad3ce0d05848da0635ead26b (patch)
tree45540da0d8d15030fc17eddbfda537466f826861 /test/scripts/git_pull_or_clean.sh
parent7119c22f82312e92cb4d0c43ac0196961532b230 (diff)
tcp: cleanup timers
Type:refactor Change-Id: I37dbc8b55827d66c2578d6ab8b86ed7e18198aa6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'test/scripts/git_pull_or_clean.sh')
0 files changed, 0 insertions, 0 deletions
{ color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/router/bin/python

from platform_cmd_link import *
import functional_general_test
from nose.tools import assert_equal
from nose.tools import assert_not_equal


class CIfObj_Test(functional_general_test.CGeneralFunctional_Test):
    test_idx = 1

    def setUp(self):
        self.if_1 = CIfObj('gig0/0/1', '1.1.1.1', '2001:DB8:0:2222:0:0:0:1', '0000.0001.0000', '0000.0001.0000', IFType.Client)
        self.if_2 = CIfObj('TenGig0/0/0', '1.1.2.1', '2001:DB8:1:2222:0:0:0:1', '0000.0002.0000', '0000.0002.0000', IFType.Server)
        CIfObj_Test.test_idx += 1

    def test_id_allocation(self):
        assert (self.if_1.get_id() < self.if_2.get_id() < CIfObj._obj_id)

    def test_isClient(self):
        assert_equal (self.if_1.is_client(), True)

    def test_isServer(self):
        assert_equal (self.if_2.is_server(), True)

    def test_get_name (self):
        assert_equal (self.if_1.get_name(), 'gig0/0/1')
        assert_equal (self.if_2.get_name(), 'TenGig0/0/0')

    def test_get_src_mac_addr (self):
        assert_equal (self.if_1.get_src_mac_addr(), '0000.0001.0000')

    def test_get_dest_mac (self):
        assert_equal (self.if_2.get_dest_mac(), '0000.0002.0000')

    def test_get_ipv4_addr (self):
        assert_equal (self.if_1.get_ipv4_addr(), '1.1.1.1' )
        assert_equal (self.if_2.get_ipv4_addr(), '1.1.2.1' ) 

    def test_get_ipv6_addr (self):
        assert_equal (self.if_1.get_ipv6_addr(), '2001:DB8:0:2222:0:0:0:1' )
        assert_equal (self.if_2.get_ipv6_addr(), '2001:DB8:1:2222:0:0:0:1' )

    def test_get_type (self):
        assert_equal (self.if_1.get_if_type(), IFType.Client)
        assert_equal (self.if_2.get_if_type(), IFType.Server)

    def tearDown(self):
        pass