Skip to content

Commit

Permalink
Fix buster-backports in Dockerfile.client (#238)
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Lisovskyi <yurii.lisovskyi@plvision.eu>
  • Loading branch information
yuriilisovskyi authored Jul 26, 2024
1 parent ade30b9 commit f249b33
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/sc-standalone-deb10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/sc-standalone-deb11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion dockerfiles/buster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/buster/Dockerfile.client
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/buster/Dockerfile.saithrift-server
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/buster/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions sai.env
Original file line number Diff line number Diff line change
@@ -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
43 changes: 31 additions & 12 deletions usecases/sai-ptf/patches/0001-sai-base-test.patch
Original file line number Diff line number Diff line change
@@ -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.")
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -68,23 +68,23 @@ 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,
- bridge_id=self.default_1q_bridge,
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,
- bridge_id=self.default_1q_bridge,
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))
Expand All @@ -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)

Expand All @@ -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(
Expand All @@ -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,)

0 comments on commit f249b33

Please sign in to comment.