示例#1
0
def suite(t_case, t_cls):
    test_inc.gen_test_op_lst(t_cls)

    test_case = {}

    # basic add test dut1
    test_case[0] = [11,33,13,15,17,19,21,35,23,25,27,29,31]

    # basic del test dut2
    test_case[1] = [30,28,26,24,36,22,20,18,16,14,34,12,32]

    if t_case:
        t_sel = eval (t_case)
    else:
        t_sel = 0

    if type(t_sel) == types.ListType:
        print 'Running Custom Test Case, %s' % (t_sel)
        test_flst = map  (lambda x: test_inc.TEST_OP_LST[x], t_sel)
    elif t_sel in test_case:
        test_flst = map (lambda x: test_inc.TEST_OP_LST[x], test_case[t_sel])
        print 'Running Test Case %d, %s' % (t_sel, test_case[t_sel])
    else:
        test_flst = ['test_case_not_found']
        t_cls.t_case = test_case
        t_cls.t_sel  = t_sel

    return unittest.TestSuite(map(t_cls, test_flst))
def suite(t_case, t_cls):
    test_inc.gen_test_op_lst(t_cls)

    test_case = {}

    # basic test
    test_case[0] = [1, 2, 3, 4, 5, 6]
    test_case[1] = [1, 3]
    test_case[2] = [4, 2]

    if t_case:
        t_sel = eval(t_case)
    else:
        t_sel = 0

    if type(t_sel) == types.ListType:
        print 'Running Custom Test Case, %s' % (t_sel)
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], t_sel)
    elif t_sel in test_case:
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], test_case[t_sel])
        print 'Running Test Case %d, %s' % (t_sel, test_case[t_sel])
    else:
        test_flst = ['test_case_not_found']
        t_cls.t_case = test_case
        t_cls.t_sel = t_sel

    return unittest.TestSuite(map(t_cls, test_flst))
def suite(t_case, t_cls):
    test_inc.gen_test_op_lst(t_cls)

    test_case = {}

    # basic test
    test_case[0] = [1, 3, 4, 2, 5, 7, 8, 6]
    #
    test_case[1] = [1, 3]
    #
    test_case[2] = [4, 2]
    # fail case: ip route command can not add ecmp route by 2 commands
    # the 2nd will replace the 1st
    test_case[3] = [1, 3, 4, 2, 5, 17, 8, 6]

    # add route to vlan device
    test_case[4] = [1, 3, 31, 32]

    if t_case:
        t_sel = eval(t_case)
    else:
        t_sel = 0

    if type(t_sel) == types.ListType:
        print 'Running Custom Test Case, %s' % (t_sel)
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], t_sel)
    elif t_sel in test_case:
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], test_case[t_sel])
        print 'Running Test Case %d, %s' % (t_sel, test_case[t_sel])
    else:
        test_flst = ['test_case_not_found']
        t_cls.t_case = test_case
        t_cls.t_sel = t_sel

    return unittest.TestSuite(map(t_cls, test_flst))
示例#4
0
def suite(t_case, t_cls):
    test_inc.gen_test_op_lst(t_cls)

    test_case = {}

    # basic test for mirror
    test_case[0] = [1, 3, 5, 6, 4, 2]

    # basic test for policy route
    test_case[1] = [7, 9, 11, 12, 10, 8]

    # test for binding two policies to one port
    test_case[2] = [1, 7, 5, 11, 21]  #2,8]

    if t_case:
        t_sel = eval(t_case)
    else:
        t_sel = 0

    if type(t_sel) == types.ListType:
        print 'Running Custom Test Case, %s' % (t_sel)
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], t_sel)
    elif t_sel in test_case:
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], test_case[t_sel])
        print 'Running Test Case %d, %s' % (t_sel, test_case[t_sel])
    else:
        test_flst = ['test_case_not_found']
        t_cls.t_case = test_case
        t_cls.t_sel = t_sel

    return unittest.TestSuite(map(t_cls, test_flst))
示例#5
0
def suite(t_case, t_cls):
    test_inc.gen_test_op_lst(t_cls)

    test_case = {}

    # basic test
    test_case[0] = [1,3,4,5,2]

    test_case[1] = [8,9,15,16,14,15,16]

    # syncd exit unexpectedly case when adding/removing vlan member
    test_case[2] = [8,15,9,16,14]

    test_case[3] = [8,15,9,14,16]

    # set pc admin status than set pc mbr port admin status test
    test_case[4] = [1,3,4,17]

    if t_case:
        t_sel = eval (t_case)
    else:
        t_sel = 0

    if type(t_sel) == types.ListType:
        print 'Running Custom Test Case, %s' % (t_sel)
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], t_sel)
    elif t_sel in test_case:
        test_flst = map(lambda x: test_inc.TEST_OP_LST[x], test_case[t_sel])
        print 'Running Test Case %d, %s' % (t_sel, test_case[t_sel])
    else:
        test_flst = ['test_case_not_found']
        t_cls.t_case = test_case
        t_cls.t_sel  = t_sel

    return unittest.TestSuite(map(t_cls, test_flst))