From f249b338dd2596c2c511f491720ce47ccefb779a Mon Sep 17 00:00:00 2001 From: Yurii Lisovskyi Date: Fri, 26 Jul 2024 11:15:05 +0300 Subject: [PATCH] Fix buster-backports in Dockerfile.client (#238) Signed-off-by: Yurii Lisovskyi --- .github/workflows/sc-standalone-deb10.yml | 6 +-- .github/workflows/sc-standalone-deb11.yml | 6 +-- dockerfiles/buster/Dockerfile | 2 +- dockerfiles/buster/Dockerfile.client | 2 +- .../buster/Dockerfile.saithrift-server | 2 +- dockerfiles/buster/Dockerfile.server | 2 +- sai.env | 14 +++--- .../sai-ptf/patches/0001-sai-base-test.patch | 43 +++++++++++++------ 8 files changed, 48 insertions(+), 29 deletions(-) diff --git a/.github/workflows/sc-standalone-deb10.yml b/.github/workflows/sc-standalone-deb10.yml index d88caef9..79cc0fdf 100644 --- a/.github/workflows/sc-standalone-deb10.yml +++ b/.github/workflows/sc-standalone-deb10.yml @@ -80,7 +80,7 @@ jobs: - name: Run data-driven tests run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic_dd.py - name: Run API tests - run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v -k "api/test" + run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v api/ - name: Build standalone docker image with SAI thrift run: ./build.sh -i standalone -s thrift -o deb10 @@ -100,11 +100,11 @@ jobs: run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v ut/test_vrf_ut.py ut/test_bridge_ut.py ut/test_acl_ut.py ut/test_fdb_ut.py ut/test_lag_ut.py - name: Run thrift unit tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k \ - "(test_switch_ut and not sai_map_list_t and not sai_system_port_config_list_t) or (test_port_ut and not sai_map_list_t)" + "(test_switch_ut and not sai_map_list_t and not sai_system_port_config_list_t and not (SAI_SWITCH_ATTR_DASH or SAI_SWITCH_ATTR_HA)) or (test_port_ut and not sai_map_list_t)" - name: Run thrift sairedis tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k "test_sairec" - name: Run thrift API tests - run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k "api/test" + run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v api/ - name: Run PTF tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v ../usecases/sai-ptf/SAI/ptf/saifdb.py -k FdbAttributeTest diff --git a/.github/workflows/sc-standalone-deb11.yml b/.github/workflows/sc-standalone-deb11.yml index 094e5360..46946fc1 100644 --- a/.github/workflows/sc-standalone-deb11.yml +++ b/.github/workflows/sc-standalone-deb11.yml @@ -80,7 +80,7 @@ jobs: - name: Run data-driven tests run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic_dd.py - name: Run API tests - run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v -k "api/test" + run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v api/ - name: Build standalone docker image with SAI thrift run: ./build.sh -i standalone -s thrift -o deb11 @@ -100,11 +100,11 @@ jobs: run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v ut/test_vrf_ut.py ut/test_bridge_ut.py ut/test_acl_ut.py ut/test_fdb_ut.py ut/test_lag_ut.py - name: Run thrift unit tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k \ - "(test_switch_ut and not sai_map_list_t and not sai_system_port_config_list_t) or (test_port_ut and not sai_map_list_t)" + "(test_switch_ut and not sai_map_list_t and not sai_system_port_config_list_t and not (SAI_SWITCH_ATTR_DASH or SAI_SWITCH_ATTR_HA)) or (test_port_ut and not sai_map_list_t)" - name: Run thrift sairedis tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k "test_sairec" - name: Run thrift API tests - run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k "api/test" + run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v api/ - name: Run PTF tests run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v ../usecases/sai-ptf/SAI/ptf/saifdb.py -k FdbAttributeTest diff --git a/dockerfiles/buster/Dockerfile b/dockerfiles/buster/Dockerfile index b74b163c..fe6b411b 100644 --- a/dockerfiles/buster/Dockerfile +++ b/dockerfiles/buster/Dockerfile @@ -6,7 +6,7 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bust echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list + echo "deb [arch=amd64] http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive diff --git a/dockerfiles/buster/Dockerfile.client b/dockerfiles/buster/Dockerfile.client index dec8aa2e..8523bd6e 100644 --- a/dockerfiles/buster/Dockerfile.client +++ b/dockerfiles/buster/Dockerfile.client @@ -6,7 +6,7 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bust echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list + echo "deb [arch=amd64] http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive diff --git a/dockerfiles/buster/Dockerfile.saithrift-server b/dockerfiles/buster/Dockerfile.saithrift-server index f692cfa4..89e3ff0e 100644 --- a/dockerfiles/buster/Dockerfile.saithrift-server +++ b/dockerfiles/buster/Dockerfile.saithrift-server @@ -4,7 +4,7 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bust echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list + echo "deb [arch=amd64] http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive diff --git a/dockerfiles/buster/Dockerfile.server b/dockerfiles/buster/Dockerfile.server index b0a909d6..443ca5bd 100644 --- a/dockerfiles/buster/Dockerfile.server +++ b/dockerfiles/buster/Dockerfile.server @@ -6,7 +6,7 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bust echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list + echo "deb [arch=amd64] http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive diff --git a/sai.env b/sai.env index 9b6c6010..7bc68b79 100644 --- a/sai.env +++ b/sai.env @@ -1,13 +1,13 @@ # The sonic-swss-common and sonic-sairedis commits were taken from -# sonic-buildimage master as of Nov 17, 2023 +# sonic-buildimage master as of Jul 16, 2024 # -# https://github.com/sonic-net/sonic-buildimage/tree/9f08f88 +# https://github.com/sonic-net/sonic-buildimage/tree/e2b30cc -SWSS_COMMON_ID=05e024e -SAIREDIS_ID=92da5b3 +SWSS_COMMON_ID=e37bfea +SAIREDIS_ID=a988dd1 # SAI version: -# Branch master (post v1.13) -# Oct 20, 2023 +# Branch master (post v1.14) +# Jun 13, 2024 -SAI_ID=f981a1f +SAI_ID=be52377 diff --git a/usecases/sai-ptf/patches/0001-sai-base-test.patch b/usecases/sai-ptf/patches/0001-sai-base-test.patch index afb9d678..1d53f1e3 100644 --- a/usecases/sai-ptf/patches/0001-sai-base-test.patch +++ b/usecases/sai-ptf/patches/0001-sai-base-test.patch @@ -1,8 +1,8 @@ diff --git a/ptf/sai_base_test.py b/ptf/sai_base_test.py -index 392e861..41d0127 100644 +index 501c5e9..7c1fff3 100644 --- a/ptf/sai_base_test.py +++ b/ptf/sai_base_test.py -@@ -444,7 +444,10 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -447,7 +447,10 @@ class SaiHelperBase(ThriftInterfaceDataPlane): ''' #TODO check if this is common behivor or specified after check on more platform print("For Common platform, Only check Port status.") @@ -14,7 +14,7 @@ index 392e861..41d0127 100644 # For brcm devices, need to init and setup the ports at once after start the switch. retries = 10 -@@ -452,6 +455,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -455,6 +458,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): for index, oid in enumerate(self.port_list): port_attr = sai_thrift_get_port_attribute( self.client, oid, oper_status=True) @@ -24,7 +24,7 @@ index 392e861..41d0127 100644 print("Turn up port {}".format(oid)) port_up = True if port_attr['oper_status'] != SAI_PORT_OPER_STATUS_UP: -@@ -463,12 +469,12 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -466,12 +472,12 @@ class SaiHelperBase(ThriftInterfaceDataPlane): port_up = True break time.sleep(5) @@ -39,7 +39,7 @@ index 392e861..41d0127 100644 def shell(self): -@@ -556,6 +562,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -559,6 +565,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): port=True, index=True, parent_scheduler_node=True) @@ -49,7 +49,7 @@ index 392e861..41d0127 100644 self.assertEqual(queue, q_attr['index']) self.assertEqual(self.cpu_port_hdl, q_attr['port']) -@@ -835,7 +844,7 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -847,7 +856,7 @@ class SaiHelperBase(ThriftInterfaceDataPlane): number_of_ecmp_groups=True, ecmp_members=True) @@ -58,7 +58,7 @@ index 392e861..41d0127 100644 self.printNumberOfAvaiableResources(switch_resources) return switch_resources -@@ -870,6 +879,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): +@@ -882,6 +891,9 @@ class SaiHelperBase(ThriftInterfaceDataPlane): number_of_ecmp_groups=True, ecmp_members=True) @@ -68,7 +68,7 @@ index 392e861..41d0127 100644 for key, value in available_resources.items(): if value != init_resources[key]: if debug: -@@ -915,7 +927,6 @@ class SaiHelperUtilsMixin: +@@ -927,7 +939,6 @@ class SaiHelperUtilsMixin: port_id = getattr(self, 'port%s' % port_index) port_bp = sai_thrift_create_bridge_port( self.client, @@ -76,7 +76,7 @@ index 392e861..41d0127 100644 port_id=port_id, type=SAI_BRIDGE_PORT_TYPE_PORT, admin_state=True) -@@ -937,7 +948,6 @@ class SaiHelperUtilsMixin: +@@ -949,7 +960,6 @@ class SaiHelperUtilsMixin: # add LAG to bridge lag_bp = sai_thrift_create_bridge_port( self.client, @@ -84,7 +84,7 @@ index 392e861..41d0127 100644 port_id=lag_id, type=SAI_BRIDGE_PORT_TYPE_PORT, admin_state=True) -@@ -1131,7 +1141,8 @@ class SaiHelper(SaiHelperUtilsMixin, SaiHelperBase): +@@ -1144,7 +1154,8 @@ class SaiHelper(SaiHelperUtilsMixin, SaiHelperBase): addr=sai_thrift_ip_addr_t( ip6=DEFAULT_IP_V6_PREFIX), mask=sai_thrift_ip_addr_t(ip6=DEFAULT_IP_V6_PREFIX)) @@ -94,7 +94,7 @@ index 392e861..41d0127 100644 destination=v6_default) status = sai_thrift_create_route_entry( self.client, -@@ -1139,7 +1150,8 @@ class SaiHelper(SaiHelperUtilsMixin, SaiHelperBase): +@@ -1152,7 +1163,8 @@ class SaiHelper(SaiHelperUtilsMixin, SaiHelperBase): packet_action=SAI_PACKET_ACTION_DROP) self.assertEqual(status, SAI_STATUS_SUCCESS) @@ -104,7 +104,7 @@ index 392e861..41d0127 100644 destination=sai_ipprefix(DEFAULT_IP_V4_PREFIX)) status = sai_thrift_create_route_entry( self.client, -@@ -1245,7 +1257,7 @@ class MinimalPortVlanConfig(SaiHelperBase): +@@ -1258,7 +1270,7 @@ class MinimalPortVlanConfig(SaiHelperBase): # create bridge ports for port in self.port_list: bp = sai_thrift_create_bridge_port( @@ -113,3 +113,22 @@ index 392e861..41d0127 100644 port_id=port, type=SAI_BRIDGE_PORT_TYPE_PORT, admin_state=True) +@@ -1345,7 +1357,7 @@ class PlatformSaiHelper(SaiHelper): + Class uses to extend from SaiHelper, base on the [platform] class attribute, + dynamic select a subclass from the platform_helper. + """ +- def __new__(cls, *args, **kwargs): ++ def __new__(cls, _testMethodName='', *args, **kwargs): + sai_helper_subclass_map = {subclass.platform: subclass for subclass in SaiHelper.__subclasses__()} + common_sai_helper_subclass_map = {subclass.platform: subclass for subclass in CommonSaiHelper.__subclasses__()} + pl = get_platform() +@@ -1358,6 +1370,9 @@ class PlatformSaiHelper(SaiHelper): + cur_cls = cls + while cur_cls.__base__ != PlatformSaiHelper: + cur_cls = cur_cls.__base__ ++ if cur_cls == object: ++ cur_cls = CommonSaiHelper ++ break + + cur_cls.__bases__ = (target_base_class,) +