Skip to content

Fix for test_cleanup to avoid sending large number of args to sudo command#2436

Merged
vaibhavhd merged 1 commit intosonic-net:masterfrom
vaibhavhd:test_cleanup_fix
Oct 31, 2020
Merged

Fix for test_cleanup to avoid sending large number of args to sudo command#2436
vaibhavhd merged 1 commit intosonic-net:masterfrom
vaibhavhd:test_cleanup_fix

Conversation

@vaibhavhd
Copy link
Copy Markdown
Contributor

Description of PR

Summary: Fix for test_cleanup to avoid sending large number of args to sudo command
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Nightly tests on one of the testbeds are failing due to:

E               "msg": "non-zero return code", 
E               "rc": 123, 
E               "start": "2020-10-28 18:45:30.609993", 
E               "stderr": "sudo: unable to execute /bin/rm: Argument list too long", 
E               "stderr_lines": [
E                   "sudo: unable to execute /bin/rm: Argument list too long"
E               ], 

How did you do it?

There is a limit to no. of args that can be sent to a cmd - getconf ARG_MAX).
The xargs command by default limits the number of arguments sent to a command. In the existing testcase rm receives all arguments passed to sudo by xargs and receives twice the env variables (from xargs and sudo) as well. This causes the failure.

Changing to sudo xargs rm will ensure the limit count.

How did you verify/test it?

Local test on a DUT:

Repro failure:
Create files and remove:

# seq -w 2097152 | xargs touch

# sudo find . -name '*' | xargs sudo rm -f
sudo: unable to execute /bin/rm: Argument list too long

Fix by letting xargs limit args sent to rm:

# sudo find . -name '*' | sudo xargs  rm -f
# ls | wc -l
0
#

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@vaibhavhd vaibhavhd requested a review from a team October 30, 2020 19:48
@vaibhavhd
Copy link
Copy Markdown
Contributor Author

Retest vsimage please

@vaibhavhd vaibhavhd merged commit ecaeb43 into sonic-net:master Oct 31, 2020
@vaibhavhd vaibhavhd deleted the test_cleanup_fix branch October 31, 2020 03:34
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…#12292)

linkmgrd:
* a5ac7f6 2022-10-05 | [Active-Active] Post link prober stats to state db  (sonic-net#140) (HEAD -> 202205, github/202205) [Jing Zhang]
* f4b0e53 2022-10-05 | [Active-Active] Retry config mux mode standby (sonic-net#139) [Jing Zhang]

utilities:
* a255838 2022-10-04 | [minigraph] new workflow for golden path (sonic-net#2396) (HEAD -> 202205, github/202205) [jingwenxie]
* 99425a8 2022-10-03 | [actions] Support Semgrep by Github Actions (sonic-net#2417) [Mai Bui]
* f41e4d1 2022-09-30 | Fix for show vxlan tunnel command display issue sonic-net#11902 (sonic-net#2391) [Senthil Bhava]
* e1d827e 2022-09-29 | [VxLAN]Fix Vxlan delete command to throw error when there are references (sonic-net#2404) [Sudharsan Dhamal Gopalarathnam]
* d77acf8 2022-09-28 | [doc] add documentation on automatic techsupport based on memory (sonic-net#2411) [Stepan Blyshchak]
* 2cfc75a 2022-09-28 | [doc] update "config feature" section with "--block" option (sonic-net#2409) [Stepan Blyshchak]
* 9dc8471 2022-09-28 | [Vxlanmgrd] [CPA] Update the vxlan_tunnel name len to be under IFNAMIZ to overcome netdev creation failure (sonic-net#2398) [Vivek]
* 342589e 2022-10-03 | Added cisco config platform commands (sonic-net#2242) (sonic-net#2418) [yucgu]

swss:
* 9d9f395 2022-10-04 | [intfmgr]: Enable `accept_untracked_na` kernel param (sonic-net#2436) (HEAD -> 202205, github/202205) [Lawrence Lee]
* 6b6d25d 2022-10-04 |  [orchdaemon]: Fixed sairedis record file rotation (sonic-net#2480) [Bryan Crossland]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants