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

TSC command doesn't work on the Smart Switch #21721

Open
oleksandrivantsiv opened this issue Feb 13, 2025 · 1 comment
Open

TSC command doesn't work on the Smart Switch #21721

oleksandrivantsiv opened this issue Feb 13, 2025 · 1 comment

Comments

@oleksandrivantsiv
Copy link
Collaborator

Steps to reproduce

Can be manually reproduced:

admin@sonic:~$ sudo TSC
This commmand is only supported Chassis

PR #19729 introduced an env variable SMARTSWITCH which is exported in by new script /usr/bin/platform_utils.

Only with the file existing and the SMARTSWITCH is true, the TSA/TSB/TSC can work on a smartswitch properly, otherwise it will be considered as a chassis with linecards:

https://github.com/sonic-net/sonic-buildimage/blob/master/dockers/docker-fpm-frr/base_image_files/TSC#L14

#!/bin/bash

# Source the platform_utils script
source "$(dirname "$0")/platform_utils" > /dev/null 2>&1

${SMARTSWITCH:=false}

# Restrict command to sudo users
if [ "$EUID" -ne 0 ] ; then
  echo "Root priveleges are needed for this operation"
  exit 1
fi

if [ -f /etc/sonic/chassisdb.conf ] && [ "$SMARTSWITCH" = false ] ; then
  if [[ $1 == "no-stats" ]]; then
    rexec all -c "sudo TSC no-stats"
  else
    rexec all -c "sudo TSC"
  fi
  exit 0
fi

/usr/bin/TS TSC
[[ $1 != "no-stats" ]] && portstat -p 5

if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr '[:upper:]' '[:lower:]')" == *"dualtor"* ]]
then
  echo
  show mux status
fi

But the platform_utils is not there:

admin@sonic:/$ ls /usr/bin/platform_utils
ls: cannot access '/usr/bin/platform_utils': No such file or directory

admin@sonic:/$ whereis platform_utils
platform_utils:

sonic-buildimage/rules/docker-fpm-frr.mk should be updated to include /usr/bin/platform_utils

https://github.com/sonic-net/sonic-buildimage/blob/master/rules/docker-fpm-frr.mk

Observed behavior

Test failed:

Failed: TSC return unexpected state ERROR

Expected behavior

Test should pass on smart switch.

@oleksandrivantsiv
Copy link
Collaborator Author

@prgeor, @kperumalbfn FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant