Skip to content

Conversation

@shekharsorot
Copy link
Contributor

@shekharsorot shekharsorot commented Jan 28, 2026

Pull Request Summary: Azure Files NFSv4 Support

Overview

This PR adds comprehensive NFSv4.1 protocol support for Azure Files testing in LISA, including:

  • A new unified AzureFileShare class that handles both SMB and NFS protocols
  • A fully implemented xfstests test case (verify_azure_file_share_nfsv4) with parallel worker execution
  • A basic NFS mount smoke test (verify_nfsv4_basic) for quick validation
  • The legacy Nfs class is preserved for backward compatibility (to be removed in future)

Key Changes

1. Unified AzureFileShare Class with Protocol Support

File: lisa/sut_orchestrator/azure/features.py

The AzureFileShare class now supports both SMB and NFS protocols via create_share():

# SMB (default)
azure_file_share.create_share(
    protocol=FileShareProtocol.SMB,
    connectivity=FileShareConnectivity.PRIVATE_ENDPOINT
)

# NFS
azure_file_share.create_share(
    protocol=FileShareProtocol.NFS,
    connectivity=FileShareConnectivity.PRIVATE_ENDPOINT
)

New Enums Added:

Enum Values Purpose
FileShareProtocol SMB, NFS Protocol selection
FileShareAuthMode SHARED_KEY, MANAGED_IDENTITY, KERBEROS, NETWORK Authentication mode
NfsSecurityMode SYS NFS security modes (future: KRB5, KRB5I, KRB5P)
FileShareConnectivity PUBLIC, PRIVATE_ENDPOINT, SERVICE_ENDPOINT Connectivity options

Storage Account Naming:

  • Unified prefix: lisafs<random10chars> (supports both SMB and NFS)

2. NFS xfstests Test Case: verify_azure_file_share_nfsv4

File: lisa/microsoft/testsuites/xfstests/xfstesting.py

Fully implemented xfstests validation with parallel worker execution:

Feature Details
Parallel Workers Default 6 workers, each with own xfstests copy
Separate Shares Each worker gets dedicated test/scratch NFS shares
Test Cases 74 generic tests validated for Azure Files NFS
Excluded Tests 29 tests excluded (unsupported features documented)
Mount Options vers=4,minorversion=1,sec=sys

NFS Test Configuration:

_default_nfs_mount_opts = "vers=4,minorversion=1,sec=sys"
_default_nfs_excluded_tests = "generic/013 generic/014 ..."  # 29 excluded tests
_default_nfs_testcases = "generic/001 generic/005 ..."       # 74 tests

3. NFS Smoke Test: verify_nfsv4_basic

File: lisa/microsoft/testsuites/core/storage.py

Renamed from verify_azure_file_share_nfs to verify_nfsv4_basic. Simple NFS mount validation:

# Uses unified AzureFileShare class with NFS protocol
azure_file_share.create_share(
    protocol=FileShareProtocol.NFS,
    connectivity=FileShareConnectivity.PRIVATE_ENDPOINT
)
# Mount and verify...

4. Legacy Nfs Class Preserved

File: lisa/sut_orchestrator/azure/features.py

The original Nfs class is unchanged and preserved for backward compatibility:

  • Inherits from AzureFeatureMixin, features.Nfs
  • Used by any existing tests that haven't migrated
  • Will be removed in a future PR once all consumers migrate

5. NFS Worker Setup Helper

File: lisa/microsoft/testsuites/xfstests/xfstesting.py

New helper method _setup_azure_nfs_workers() that:

  • Configures AzureFileShare for NFS protocol
  • Creates per-worker NFS shares using _deploy_azure_file_share()
  • Mounts shares using NFSClient tool
  • Configures xfstests local.config for each worker

Technical Details

Azure Files NFS Requirements

Requirement Value Reason
Storage SKU Premium_LRS NFS requires Premium tier
Account Kind FileStorage NFS requires FileStorage
HTTPS Disabled NFS doesn't use HTTPS
Private Endpoint Required NFS has no public endpoint access
Shared Key Access Disabled NFS uses network-based auth

NFS Mount Options

vers=4,minorversion=1,sec=sys

Resource Naming Conventions

Resource Pattern
Storage Account lisafs<random10chars>
Private Endpoint <storageaccount>-file-pe
File Shares Caller-specified

Architecture

Protocol Selection Flow

AzureFileShare.create_share(protocol, connectivity)
        │
        ├── SMB: Uses CIFS mount with credential file
        │        Storage: lisafs*, HTTPS enabled
        │
        └── NFS: Uses NFSClient mount (no credentials)
                 Storage: lisafs*, HTTPS disabled, Premium required

Parallel Worker Architecture (xfstests)

XfstestsParallelRunner
        │
        ├── Worker 1: xfstests copy + test_share_w1 + scratch_share_w1
        ├── Worker 2: xfstests copy + test_share_w2 + scratch_share_w2
        ├── Worker 3: xfstests copy + test_share_w3 + scratch_share_w3
        ├── Worker 4: xfstests copy + test_share_w4 + scratch_share_w4
        ├── Worker 5: xfstests copy + test_share_w5 + scratch_share_w5
        └── Worker 6: xfstests copy + test_share_w6 + scratch_share_w6

Files Changed

File Change Type Description
lisa/sut_orchestrator/azure/features.py Modified Added protocol enums, updated AzureFileShare with create_share(), preserved Nfs class
lisa/microsoft/testsuites/xfstests/xfstesting.py Modified Added verify_azure_file_share_nfsv4, _setup_azure_nfs_workers(), NFS test config
lisa/microsoft/testsuites/core/storage.py Modified Renamed verify_azure_file_share_nfsverify_nfsv4_basic, uses unified AzureFileShare

Testing

Test Cases

Test Name File Description
verify_azure_file_share_nfsv4 xfstesting.py Comprehensive xfstests with parallel workers (74 tests)
verify_nfsv4_basic storage.py Simple NFS mount smoke test
verify_azure_file_share xfstesting.py Existing SMB xfstests (unchanged)

Run Commands

# Run NFS xfstests (comprehensive)
lisa -r azure.yml -v testcase:verify_azure_file_share_nfsv4

# Run NFS smoke test (quick)
lisa -r azure.yml -v testcase:verify_nfsv4_basic

Recommended Test Images

Image OS
canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest Ubuntu 22.04
canonical ubuntu-24_04-lts server latest Ubuntu 24.04
redhat rhel 9_5 latest RHEL 9.5
microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest Azure Linux 3

NFS Test Exclusions

Tests excluded due to Azure Files NFS limitations (29 total):

Category Tests Reason
Hard links generic/013 link() syscall not supported
Sparse files generic/014, 129, 130, 239, 240, 469, 567 Hole punching not supported
Device nodes generic/184, 306 mknod/mkfifo not supported
mkfs_sized generic/211 Cloud filesystem, cannot run mkfs
fallocate generic/071, 086, 214, 228, 286, 315, 391, 422, 568, 590 Not implemented
NFS-specific generic/024, 117, 465, 528, 599, 635 Protocol limitations
Timeout-prone generic/070, 504 May timeout on cloud filesystems

Future Work

  • Remove legacy Nfs class once all consumers migrate to AzureFileShare
  • Managed Identity support for SMB (using FileShareAuthMode.MANAGED_IDENTITY)
  • Encryption-in-transit for NFS (Kerberos modes: KRB5, KRB5I, KRB5P)
  • Service endpoint connectivity option for NFS

Breaking Changes

Change Migration
verify_azure_file_share_nfs renamed Use verify_nfsv4_basic

Backward Compatibility

Component Status
verify_azure_file_share (SMB xfstests) ✅ Unchanged
AzureFileShare class ✅ Backward compatible (default = SMB)
Nfs class (lisa.sut_orchestrator.azure.features) ✅ Preserved for compatibility
Nfs base class (lisa.features.nfs) ✅ Unchanged

References


Key Test Cases: verify_azure_file_share_nfsv4 | verify_nfsv4_basic

Impacted LISA Features: AzureFileShare, Nfs

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
  • canonical ubuntu-24_04-lts server latest
  • redhat rhel 9_5 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive Azure Files NFSv4.1 protocol support to LISA's testing framework. The changes introduce a unified AzureFileShare class that handles both SMB and NFS protocols through a configurable set_protocol() method, while preserving the legacy Nfs class for backward compatibility.

Changes:

  • Adds protocol-aware Azure File Share management with NFS and SMB support via new enums and set_protocol() configuration
  • Implements parallel NFSv4.1 xfstests validation (verify_azure_file_share_nfsv4) with 73 validated test cases across 4 workers
  • Refactors storage test to use unified AzureFileShare class (verify_nfsv4_basic, renamed from verify_azure_file_share_nfs)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lisa/sut_orchestrator/azure/features.py Adds FileShareProtocol/AuthMode/Connectivity enums, unified AzureFileShare with set_protocol() method, NFS-specific storage account configuration, preserves legacy Nfs class
lisa/sut_orchestrator/azure/common.py Implements protocol-aware file share creation/deletion using ARM API for NFS (shared key disabled) and data plane API for SMB
lisa/microsoft/testsuites/xfstests/xfstests.py Adds deferred notification support for parallel workers, file existence timeout handling, random delay to prevent SSH connection pool contention
lisa/microsoft/testsuites/xfstests/xfstesting.py Implements verify_azure_file_share_nfsv4 with parallel workers, NFS worker setup helper, unified cleanup method for SMB/NFS protocols
lisa/microsoft/testsuites/core/storage.py Renames verify_azure_file_share_nfs to verify_nfsv4_basic, migrates from legacy Nfs class to unified AzureFileShare with NFS protocol

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

@shekharsorot shekharsorot marked this pull request as ready for review February 2, 2026 09:35
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.

1 participant