Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for debug generate dump tables #922

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Merge branch 'master' into SAI_DBG_GEN_DUMP_support

e789b4d
Select commit
Loading
Failed to load commit list.
Open

add support for debug generate dump tables #922

Merge branch 'master' into SAI_DBG_GEN_DUMP_support
e789b4d
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Azure.sonic-swss-common failed Sep 26, 2024 in 2h 10m 1s

Build #20240926.1 had test failures

Details

Tests

  • Failed: 2 (1.10%)
  • Passed: 178 (97.80%)
  • Other: 2 (1.10%)
  • Total: 182
Code coverage

  • 4072 of 6877 branches covered (59.21%)
  • 4714 of 5785 lines covered (81.49%)

Annotations

Check failure on line 747 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-swss-common

Build log #L747

Bash exited with code '123'.

Check failure on line 1 in test_add_remove_port

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-swss-common

test_add_remove_port

assert 1 == 0   -1   +0
Raw output
self = <test_drop_counters.TestDropCounters object at 0x7fdc38517d60>
dvs = <conftest.DockerVirtualSwitch object at 0x7fdc38552400>, testlog = None

    def test_add_remove_port(self, dvs, testlog):
        """
            This test verifies that debug counters are removed when we remove a port
            and debug counters are added each time we add ports (if debug counter is enabled)
        """
        self.setup_db(dvs)
    
        # save port info
        cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0)
        tbl = swsscommon.Table(cdb, PORT_TABLE_NAME)
        (status, fvs) = tbl.get(PORT)
        assert status == True
    
        # get counter oid
        oid = self.getPortOid(dvs, PORT)
    
        # verifies debug coutner dont exist for port
        flex_counter_table = swsscommon.Table(self.flex_db, FLEX_COUNTER_TABLE)
        status, fields = flex_counter_table.get(oid)
>       assert len(fields) == 0
E       assert 1 == 0
E         -1
E         +0

test_drop_counters.py:688: AssertionError

Check failure on line 1 in test_createAndDeleteMultipleCounters

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-swss-common

test_createAndDeleteMultipleCounters

AssertionError: assert 'SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS' in 'SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS,SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS'
Raw output
self = <test_drop_counters.TestDropCounters object at 0x7fdc3819d0d0>
dvs = <conftest.DockerVirtualSwitch object at 0x7fdc38552400>, testlog = None

    def test_createAndDeleteMultipleCounters(self, dvs, testlog):
        """
            This test verifies that creating and deleting multiple drop counters
            at the same time works correctly.
        """
        self.setup_db(dvs)
    
        asic_state_table = swsscommon.Table(self.asic_db, ASIC_STATE_TABLE)
        flex_counter_table = swsscommon.Table(self.flex_db, FLEX_COUNTER_TABLE)
    
        name1 = 'DEBUG_0'
        reason1 = 'L3_ANY'
    
        name2 = 'DEBUG_1'
        reason2 = 'ACL_ANY'
    
        self.create_drop_counter(name1, PORT_INGRESS_DROPS)
        self.add_drop_reason(name1, reason1)
    
        self.create_drop_counter(name2, PORT_INGRESS_DROPS)
        self.add_drop_reason(name2, reason2)
    
        time.sleep(5)
    
        # Verify that the flex counters are correctly tracking two different
        # drop counters.
>       self.checkFlexState([PORT_STAT_BASE, PORT_STAT_INDEX_1], PORT_DEBUG_COUNTER_LIST)

test_drop_counters.py:762: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_drop_counters.TestDropCounters object at 0x7fdc3819d0d0>
stats = ['SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS', 'SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS']
counter_list_type = 'PORT_DEBUG_COUNTER_ID_LIST'

    def checkFlexState(self, stats, counter_list_type):
        flex_counter_table = swsscommon.Table(self.flex_db, FLEX_COUNTER_TABLE)
    
        for oid in flex_counter_table.getKeys():
            attributes = self.genericGetAndAssert(flex_counter_table, oid)
            assert len(attributes) == 1
            field, tracked_stats = attributes[0]
            assert field == counter_list_type
            for stat in stats:
>               assert stat in tracked_stats
E               AssertionError: assert 'SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS' in 'SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS,SAI_PORT_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS'

test_drop_counters.py:109: AssertionError