Skip to content

Commit fde71a9

Browse files
committed
[docker-sonic-vs] Set ASIC_VENDOR=vs via image ENV for vstest
BufferMgrDynamic (cfgmgr/buffermgrdyn.cpp) aborts its constructor when ASIC_VENDOR is unset ("Platform environment variable is not defined, buffermgrd won't start"), returning before loading its buffer Lua plugins. The empty SHAs then make every EVALSHA fail with NOSCRIPT, so the shared buffer pool size is never computed, m_bufferPoolReady stays false, and dynamic BUFFER_QUEUE_TABLE entries are never programmed. This breaks sonic-swss test_buffer_dynamic.py::TestBufferMgrDyn::test_changeSpeed, which restarts buffermgrd mid-test. On real platforms ASIC_VENDOR is injected at container launch by docker_image_ctl.sh (-e ASIC_VENDOR=<platform> for the swss container), but the DVS/vstest harness starts docker-sonic-vs directly, so that injection never runs. The previous per-script 'export ASIC_VENDOR=vs' in buffermgrd.sh only covered buffermgrd (not orchagent/neighorch, which also reads getenv("ASIC_VENDOR")) and was easy to drop. Set ASIC_VENDOR=vs once as an image ENV (next to PLATFORM/HWSKU) so it is present for every daemon and survives supervisorctl restarts, and remove the redundant export from buffermgrd.sh. Validated: test_changeSpeed passes (1 passed in 114.86s) with NOSCRIPT and 'Platform environment variable is not defined' counts both 0. Signed-off-by: securely1g <securely1g@users.noreply.github.com>
1 parent 61bf898 commit fde71a9

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,11 @@ FROM $BASE
200200
# Set PLATFORM and HWSKU environment variables
201201
ENV PLATFORM=x86_64-kvm_x86_64-r0
202202
ENV HWSKU=Force10-S6000
203+
# ASIC_VENDOR selects the per-platform buffer Lua plugins and gates BufferMgrDynamic
204+
# startup. On real platforms it is injected at container launch by
205+
# docker_image_ctl.sh (-e ASIC_VENDOR=<platform>), but the DVS/vstest harness
206+
# starts docker-sonic-vs directly, so set it here once for every daemon
207+
# (buffermgrd, orchagent/neighorch) and across supervisorctl restarts.
208+
ENV ASIC_VENDOR=vs
203209

204210
ENTRYPOINT ["/usr/local/bin/supervisord"]

platform/vs/docker-sonic-vs/buffermgrd.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

33
BUFFER_CALCULATION_MODE=$(redis-cli -n 4 hget "DEVICE_METADATA|localhost" buffer_model)
4-
export ASIC_VENDOR=vs
54

65
if [ "$BUFFER_CALCULATION_MODE" == "dynamic" ]; then
76
BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json"

0 commit comments

Comments
 (0)