Skip to content

Commit e60d827

Browse files
committed
Merge remote-tracking branch 'upstream/202305' into frr_mem_com
2 parents fe25d6b + b1daba8 commit e60d827

File tree

17 files changed

+81
-162
lines changed

17 files changed

+81
-162
lines changed

Makefile.work

+3-6
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ rules/config.user:
141141

142142
include rules/config
143143
-include rules/config.user
144+
include rules/sonic-fips.mk
144145

145146
ifneq ($(DEFAULT_CONTAINER_REGISTRY),)
146147
override DEFAULT_CONTAINER_REGISTRY := $(DEFAULT_CONTAINER_REGISTRY)/
@@ -177,12 +178,6 @@ endif
177178
SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC)
178179
DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV)
179180

180-
# Support FIPS feature, armhf not supported yet
181-
ifeq ($(PLATFORM_ARCH),armhf)
182-
ENABLE_FIPS_FEATURE := n
183-
ENABLE_FIPS := n
184-
endif
185-
186181
ifeq ($(ENABLE_FIPS_FEATURE), n)
187182
ifeq ($(ENABLE_FIPS), y)
188183
$(error Cannot set fips config ENABLE_FIPS=y when ENABLE_FIPS_FEATURE=n)
@@ -216,6 +211,8 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \
216211
DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \
217212
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
218213
GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \
214+
FIPS_VERSION=$(FIPS_VERSION) \
215+
FIPS_GOLANG_VERSION=$(FIPS_GOLANG_VERSION) \
219216
j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile)
220217

221218
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \

device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Common:
2424

2525
SET_METHOD_IPMI = 'ipmitool'
2626
NULL_VAL = 'N/A'
27-
HOST_CHK_CMD = ["docker"]
2827
REF_KEY = '$ref:'
2928

3029
def __init__(self, conf=None):
@@ -184,12 +183,13 @@ def write_txt_file(self, file_path, value):
184183
return False
185184
return True
186185

187-
def is_host(self):
188-
try:
189-
subprocess.call(self.HOST_CHK_CMD, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
190-
except FileNotFoundError:
191-
return False
192-
return True
186+
def is_host():
187+
"""
188+
Test whether current process is running on the host or an docker
189+
return True for host and False for docker
190+
"""
191+
docker_env_file = '/.dockerenv'
192+
return os.path.exists(docker_env_file) is False
193193

194194
def load_json_file(self, path):
195195
"""

dockers/docker-dhcp-relay/Dockerfile.j2

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ ENV IMAGE_VERSION=$image_version
1313
# Update apt's cache of available packages
1414
RUN apt-get update
1515

16-
RUN apt-get install -y libjsoncpp-dev
17-
1816
{% if docker_dhcp_relay_debs.strip() -%}
1917
# Copy built Debian packages
2018
{{ copy_files("debs/", docker_dhcp_relay_debs.split(' '), "/debs/") }}

dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py

+19-25
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,24 @@
1717
except KeyError:
1818
pass
1919

20-
expected_counts_v6 = """\
21-
Message Type Vlan1000(RX)
22-
-------------- ---------------
23-
24-
Message Type Vlan1000(TX)
25-
-------------- ---------------
26-
27-
"""
28-
29-
expected_counts_v4 = """\
30-
Message Type Vlan1000(RX)
31-
-------------- ---------------
32-
33-
Message Type Vlan1000(TX)
34-
-------------- ---------------
20+
expected_counts = """\
21+
Message Type Vlan1000
22+
------------------- -----------
23+
Unknown
24+
Solicit
25+
Advertise
26+
Request
27+
Confirm
28+
Renew
29+
Rebind
30+
Reply
31+
Release
32+
Decline
33+
Reconfigure
34+
Information-Request
35+
Relay-Forward
36+
Relay-Reply
37+
Malformed
3538
3639
"""
3740

@@ -40,14 +43,5 @@ class TestDhcp6RelayCounters(object):
4043
def test_show_counts(self):
4144
runner = CliRunner()
4245
result = runner.invoke(show.dhcp6relay_counters.commands["counts"], ["-i Vlan1000"])
43-
print(result.output)
44-
assert result.output == expected_counts_v6
45-
46-
class TestDhcpRelayCounters(object):
47-
48-
def test_show_counts(self):
49-
runner = CliRunner()
50-
result = runner.invoke(show.dhcp4relay_counters.commands["counts"], ["-i Vlan1000"])
51-
print(result.output)
52-
assert result.output == expected_counts_v4
46+
assert result.output == expected_counts
5347

dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py

+19-103
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import click
2-
import ast
32
from natsort import natsorted
43
from tabulate import tabulate
54
import show.vlan as show_vlan
@@ -8,20 +7,13 @@
87
from swsscommon.swsscommon import ConfigDBConnector
98
from swsscommon.swsscommon import SonicV2Connector
109

10+
1111
# STATE_DB Table
12-
DHCPv4_COUNTER_TABLE = 'DHCP_COUNTER_TABLE'
1312
DHCPv6_COUNTER_TABLE = 'DHCPv6_COUNTER_TABLE'
1413

15-
# DHCPv4 Counter Messages
16-
dhcpv4_messages = [
17-
"Unknown", "Discover", "Offer", "Request", "Decline", "Ack", "Nack", "Release", "Inform"
18-
]
19-
2014
# DHCPv6 Counter Messages
21-
dhcpv6_messages = [
22-
"Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release",
23-
"Decline", "Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed"
24-
]
15+
messages = ["Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release", "Decline",
16+
"Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed"]
2517

2618
# DHCP_RELAY Config Table
2719
DHCP_RELAY = 'DHCP_RELAY'
@@ -45,75 +37,6 @@ def get_dhcp_helper_address(ctx, vlan):
4537

4638
show_vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address)
4739

48-
class DHCPv4_Counter(object):
49-
def __init__(self):
50-
self.db = SonicV2Connector(use_unix_socket_path=False)
51-
self.db.connect(self.db.STATE_DB)
52-
self.table_name = DHCPv4_COUNTER_TABLE + self.db.get_db_separator(self.db.STATE_DB)
53-
54-
def get_interface(self):
55-
""" Get all names of all interfaces in DHCPv4_COUNTER_TABLE """
56-
interfaces = []
57-
for key in self.db.keys(self.db.STATE_DB):
58-
if DHCPv4_COUNTER_TABLE in key:
59-
interfaces.append(key[21:])
60-
return interfaces
61-
62-
def get_dhcp4relay_msg_count(self, interface, dir):
63-
""" Get count of a dhcprelay message """
64-
value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir))
65-
cnts = ast.literal_eval(str(value))
66-
data = []
67-
if cnts is not None:
68-
for k, v in cnts.items():
69-
data.append([k, v])
70-
return data
71-
72-
def clear_table(self, interface):
73-
""" Reset all message counts to 0 """
74-
v4_cnts = {}
75-
for msg in dhcpv4_messages:
76-
v4_cnts[msg] = '0'
77-
self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v4_cnts))
78-
self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v4_cnts))
79-
80-
def print_dhcpv4_count(counter, intf):
81-
"""Print count of each message"""
82-
rx_data = counter.get_dhcp4relay_msg_count(intf, "RX")
83-
print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n")
84-
tx_data = counter.get_dhcp4relay_msg_count(intf, "TX")
85-
print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n")
86-
87-
#
88-
# 'dhcp4relay_counters' group ###
89-
#
90-
91-
92-
@click.group(cls=clicommon.AliasedGroup, name="dhcp4relay_counters")
93-
def dhcp4relay_counters():
94-
"""Show DHCPv4 counter"""
95-
pass
96-
97-
98-
def ipv4_counters(interface):
99-
counter = DHCPv4_Counter()
100-
counter_intf = counter.get_interface()
101-
102-
if interface:
103-
print_dhcpv4_count(counter, interface)
104-
else:
105-
for intf in counter_intf:
106-
print_dhcpv4_count(counter, intf)
107-
108-
109-
# 'counts' subcommand ("show dhcp4relay_counters counts")
110-
@dhcp4relay_counters.command('counts')
111-
@click.option('-i', '--interface', required=False)
112-
@click.option('--verbose', is_flag=True, help="Enable verbose output")
113-
def counts(interface, verbose):
114-
"""Show dhcp4relay message counts"""
115-
ipv4_counters(interface)
116-
11740

11841
class DHCPv6_Counter(object):
11942
def __init__(self):
@@ -123,37 +46,30 @@ def __init__(self):
12346

12447
def get_interface(self):
12548
""" Get all names of all interfaces in DHCPv6_COUNTER_TABLE """
126-
interfaces = []
49+
vlans = []
12750
for key in self.db.keys(self.db.STATE_DB):
12851
if DHCPv6_COUNTER_TABLE in key:
129-
interfaces.append(key[21:])
130-
return interfaces
52+
vlans.append(key[21:])
53+
return vlans
13154

132-
def get_dhcp6relay_msg_count(self, interface, dir):
55+
def get_dhcp6relay_msg_count(self, interface, msg):
13356
""" Get count of a dhcp6relay message """
134-
value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir))
135-
cnts = ast.literal_eval(str(value))
136-
data = []
137-
if cnts is not None:
138-
for k, v in cnts.items():
139-
data.append([k, v])
57+
count = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(msg))
58+
data = [str(msg), count]
14059
return data
14160

14261
def clear_table(self, interface):
14362
""" Reset all message counts to 0 """
144-
v6_cnts = {}
145-
for msg in dhcpv6_messages:
146-
v6_cnts[msg] = '0'
147-
self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v6_cnts))
148-
self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v6_cnts))
63+
for msg in messages:
64+
self.db.set(self.db.STATE_DB, self.table_name + str(interface), str(msg), '0')
14965

15066

151-
def print_dhcpv6_count(counter, intf):
67+
def print_count(counter, intf):
15268
"""Print count of each message"""
153-
rx_data = counter.get_dhcp6relay_msg_count(intf, "RX")
154-
print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n")
155-
tx_data = counter.get_dhcp6relay_msg_count(intf, "TX")
156-
print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n")
69+
data = []
70+
for i in messages:
71+
data.append(counter.get_dhcp6relay_msg_count(intf, i))
72+
print(tabulate(data, headers=["Message Type", intf], tablefmt='simple', stralign='right') + "\n")
15773

15874

15975
#
@@ -172,10 +88,10 @@ def ipv6_counters(interface):
17288
counter_intf = counter.get_interface()
17389

17490
if interface:
175-
print_dhcpv6_count(counter, interface)
91+
print_count(counter, interface)
17692
else:
17793
for intf in counter_intf:
178-
print_dhcpv6_count(counter, intf)
94+
print_count(counter, intf)
17995

18096

18197
# 'counts' subcommand ("show dhcp6relay_counters counts")
@@ -184,6 +100,7 @@ def ipv6_counters(interface):
184100
@click.option('--verbose', is_flag=True, help="Enable verbose output")
185101
def counts(interface, verbose):
186102
"""Show dhcp6relay message counts"""
103+
187104
ipv6_counters(interface)
188105

189106

@@ -282,7 +199,6 @@ def dhcp_relay_ip6counters(interface):
282199

283200

284201
def register(cli):
285-
cli.add_command(dhcp4relay_counters)
286202
cli.add_command(dhcp6relay_counters)
287203
cli.add_command(dhcp_relay_helper)
288204
cli.add_command(dhcp_relay)

files/build_templates/sonic_debian_extension.j2

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install system
244244
# Install SONiC host services package
245245
SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}})
246246
sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
247+
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install pygobject
247248
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_HOST_SERVICES_PY3_WHEEL_NAME
248249
sudo rm -rf $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
249250

files/image_config/kdump/kdump-tools

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ KDUMP_CMDLINE_APPEND="irqpoll nr_cpus=1 nousb systemd.unit=kdump-tools.service a
77

88
# Reboot crash kernel on panic
99
# Enable debug level logging of crash kernel for better visibility
10+
# Set loglevel to reduce verbosity and print only warning conditions
1011
# Disable advanced pcie features
1112
# Disable high precision event timer as on some platforms it is interfering with the kdump operation
1213
# Pass platform identifier string as part of crash kernel command line to be used by the reboot script during kdump
13-
KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__"
14+
KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug loglevel=4 hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__"
1415

1516
# Use SONiC reboot wrapper script present in /usr/local/bin post kdump
1617
PATH=/usr/local/bin:$PATH

platform/vs/docker-sonic-vs.mk

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ else
3434
$(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP)
3535
endif
3636

37+
ifeq ($(ENABLE_FIPS_FEATURE), y)
38+
$(DOCKER_SONIC_VS)_DEPENDS += $(FIPS_KRB5_ALL)
39+
endif
40+
3741
$(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \
3842
$(ARP_UPDATE_SCRIPT) \
3943
$(ARP_UPDATE_VARS_TEMPLATE) \

platform/vs/docker-sonic-vs/Dockerfile.j2

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s
99
ENV DEBIAN_FRONTEND=noninteractive
1010

1111
RUN apt-get update && apt-get install -y gnupg
12-
COPY ["sonic-dev.gpg.key", "/etc/apt/"]
13-
RUN apt-key add /etc/apt/sonic-dev.gpg.key
14-
RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list
15-
RUN apt-get update
1612

1713
RUN apt-get install -y net-tools \
1814
arping \
@@ -42,7 +38,6 @@ RUN apt-get install -y net-tools \
4238
iptables \
4339
jq \
4440
libzmq5 \
45-
libzmq3-dev \
4641
uuid-dev \
4742
# For installing Python m2crypto package
4843
# (these can be uninstalled after installation)
@@ -68,7 +63,11 @@ RUN apt-get install -y net-tools \
6863
libasan6 \
6964
{%- endif %}
7065
dbus \
71-
redis-server
66+
redis-server \
67+
# For libkrb5-dev
68+
comerr-dev \
69+
libgssrpc4 \
70+
libkdb5-10
7271

7372
# For sonic-config-engine Python 3 package
7473
# Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed.
@@ -92,6 +91,8 @@ COPY {%- for deb in docker_sonic_vs_debs.split(' ') %} debs/{{ deb }}{%- endfor
9291
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; {%- for deb in docker_sonic_vs_debs.split(' ') %} dpkg_apt /debs/{{ deb }};{%- endfor %}
9392
{%- endif %}
9493

94+
RUN apt-get install -y libzmq3-dev
95+
9596
{% if docker_sonic_vs_pydebs.strip() -%}
9697
# Copy locally-built Debian package dependencies
9798
COPY {%- for deb in docker_sonic_vs_pydebs.split(' ') %} python-debs/{{ deb }}{%- endfor %} /debs/

0 commit comments

Comments
 (0)