Skip to content

Fix kdump unit tests by correctly mocking /proc/cmdline#351

Open
vivekverma-arista wants to merge 1 commit into
sonic-net:masterfrom
vivekverma-arista:kdump-unit-tests
Open

Fix kdump unit tests by correctly mocking /proc/cmdline#351
vivekverma-arista wants to merge 1 commit into
sonic-net:masterfrom
vivekverma-arista:kdump-unit-tests

Conversation

@vivekverma-arista
Copy link
Copy Markdown

@vivekverma-arista vivekverma-arista commented Mar 6, 2026

Fixes: #350

Refer the above issue for details.

Affected Tests

  1. hostcfgd_fips_test.py
  2. hostcfgd_logging_test.py
  3. hostcfgd_rsyslog_test.py
  4. hostcfgd_test.py

How did I fix it?

  1. The proposed fix is to properly mock cmdline for each of the tests instead of referring to the actual /proc/cmdline from the machine on which the test is running.

  2. crashkernel has been removed from /proc/cmdline as all tests except hostcfgd_test.py expect kdump to be disabled.

  3. Since only hostcfd_test.py expects kdump to be enabled, the parameter is explicitly injected to cmdline during setup phase of the test and reverted during teardown so that it doesn't affect other tests.

Signed-off-by: Vivek Kumar Verma <vivekverma@arista.com>
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vivekverma-arista
Copy link
Copy Markdown
Author

@qiluo-msft can you review?

@vivekverma-arista vivekverma-arista changed the title Fix kdump unit tests. Fix kdump unit tests by correctly mocking /proc/cmdline Mar 6, 2026
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.

Kdump unit test failures.

2 participants