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

Xfstests tool & test update to support Azure file Share - SMB testing #3693

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

shekharsorot
Copy link
Contributor

@shekharsorot shekharsorot commented Mar 5, 2025

Xfstest is a file system and share testing tool that is maintained by kernel.org and is often used for performance, stability, feature operability and regression testing.

This LISA tool feature is an update to the existing Xfstests.py within Microsoft test cases and has been refactored to be able to run SMB as well as NFS tests in addition of existing set of Managed disks ( XFS, EXT3/4 and BTRFS ) as well as NVME

It's an implementation of "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git", although users can specify custom repository and forks as well with their own test cases.

It's intended to use this via custom test suites to test SMB and NFS client functionality with various SMB and NFS servers (in addition to AZFiles ) currently in use across cloud and on-premises environments (You can call XFStest to create config file for existing shares, specify custom flags in addition to existing flags and call run_test() to trigger testing // reporting.

Note: detailed docstrings are included in tool class and respective method definitions.

Non-Breaking but Major changes:

TIMEOUT changes to 6 hours to allow additional time for managed disk tests to run.
SMB // CIFS test is hardcoded for specific cases as these are well known tests for Azure Files - SMB Premium // Standard
XFStests will now always pull the 'master' branch which is the last known stable release.
"verify_azure_file_share" test case priority has been reduced back to P3 as the test takes < 60 min to complete for CIFS
Xfstests will by default generate dmesg output per case. This can be found in your runtime / log / /testss / xfstests directory for analysis.
SubtestMessages will now contain diff of input vs output file for failed cases in the additional information field. Can be used for automated reporting when test environment is not preserved.
Upon Failure of any sub test, HTML will output only the failed subtests.
In case of success ( including skipped and expunged ), HTML report will dump the list of passed test cases along with test options.

Usage:
import using "from lisa.testsuite import TestResult"

Instantiate & install using "xfstests = node.tools[Xfstests]"

to create a config:
xfstest.set_local_config(
scratch_dev="/dev/sdb",
scratch_mnt="/mnt/scratch",
test_dev="/dev/sdc",
test_folder="/mnt/test",
file_system="xfs",
test_section="xfs-custom",
mount_opts="noatime",
testfs_mount_opts="noatime",
additional_parameters={"TEST_DEV2": "/dev/sdd"},
overwrite_config=True
)
Note: You can create multiple test sections using this method and call run_test() in sequence.
Please note guidance in "https://github.com/kdave/xfstests/blob/master/README.config-sections"

To exclude global list of tests
xfstests.set_excluded_tests(excluded_tests)

To run tests
xfstests.run_test(
test_section=test_type,
log_path=log_path,
result=result,
data_disk=data_disk,
test_cases=test_cases,
timeout=self.TIME_OUT - 30,
)

Tool instance will create and send sub-test messages to log as well as HTML & Junit.
On failure, it will display the failed sub-test as well as XFStest message to allow for troubleshooting.
On success, it will display list of passed // skipped sub-tests via PassedException.
Note: Expunged cases are treated as skipped

Supported OS:
redhat, suse , fedora, mariner, debian

@squirrelsc
Copy link
Member

Can you improve the current version directly?

@shekharsorot
Copy link
Contributor Author

Can you improve the current version directly?

I will work to update the XFStesting suite in Microsoft folder. It will take some time due to long run durations and validations for each test case. I will modify xfstesting.py to use the new Xfstests tool.

Copy link
Member

@squirrelsc squirrelsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will work to update the XFStesting suite in Microsoft folder. It will take some time due to long run durations and validations for each test case. I will modify xfstesting.py to use the new Xfstests tool.

There is a xfstests.py file already, can you directly fix there?

@shekharsorot shekharsorot marked this pull request as draft March 7, 2025 06:54
@shekharsorot shekharsorot marked this pull request as ready for review March 8, 2025 08:30
@shekharsorot shekharsorot changed the title Xfstests tool for File system and share testing Xfstests tool & test update to support Azure file Share - SMB testing Mar 8, 2025
@shekharsorot shekharsorot requested a review from squirrelsc March 8, 2025 12:11
from lisa.tools import Cat, Chmod, Echo, Git, Make, Pgrep, Rm, Sed

if TYPE_CHECKING:
from lisa.testsuite import TestResult
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tried to revert it back since you didn't change the location of this file. see whether we still see cycle import issue

overwritten
Example:
xfstest.set_local_config(
scratch_dev="/dev/sdb",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't hardcode disk names here, since they will change the name after reboot.

reducing timeout to 4 hours as original since we no longer are seeing issues with quick tests running > 2 hours with new XFStests code
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