NFS - Network File System

What is NFS?

NFS (Network File System) is a distributed file system protocol originally developed by Sun Microsystems in 1984. It allows a user on a client computer to access files over a network in the same way they would access local storage.

Why is NFS useful?

  • Remote File Access – Enables users to access files stored on remote servers as if they were local.

  • Centralized Storage – Simplifies data management by storing files in one place and sharing them across multiple clients.

  • Platform Independence – Works across different operating systems (e.g., Linux, UNIX, macOS).

  • Scalability – Suitable for small networks to large enterprise environments.

  • Transparent Integration – Seamlessly integrates with existing file systems and user workflows.

How it works?

  • Server Setup – The NFS server exports directories to be shared over the network.

  • Client Mounting – The client mounts the exported directory using the NFS protocol.

  • File Access – The client reads/writes files as if they were on a local disk.

  • RPC Communication – NFS uses Remote Procedure Calls (RPC) to communicate between client and server.

  • Caching & Locking – Clients may cache data and use file locking mechanisms to manage concurrent access.

  • Security & Permissions – Access is controlled using export rules, user IDs, and optionally Kerberos authentication.

  • Unmounting – The client can unmount the NFS share when access is no longer needed.

Where is NFS used?

  • Enterprise Networks – For centralized file storage and sharing across departments.

  • Data Centers – To provide shared access to configuration files, logs, and backups.

  • High-Performance Computing (HPC) – For sharing large datasets across compute nodes.

  • Virtualization Environments – Used by hypervisors to access VM images and ISO files.

  • Educational Institutions – For shared access to course materials and user directories.

Which OSI Layer does this protocol belong to?

  • Data Representation – NFS ensures consistent file formats and encoding across different systems.

  • Data Translation – Converts data between different machine architectures (e.g., big-endian vs little-endian).

  • Syntax Negotiation – Handles file naming conventions and data structure alignment across platforms.

  • Therefore, NFS operates mainly at the Presentation Layer (Layer 6) of the OSI model.

  • In this section, you are going to learn

  • Terminology

  • Version Info

NFS

RFC

Year

Core Idea / Contribution

Version

NFSv2

RFC 1094

1989

First widely adopted version; stateless protocol using UDP; limited file size support.

NFSv3

RFC 1813

1995

Added support for 64-bit file sizes, asynchronous writes, and improved performance; still stateless.

NFSv4

RFC 7530

2015

Introduced stateful protocol, strong security (Kerberos), file locking, compound operations, and internationalization

NFSv4.1

RFC 5661

2010

Added Parallel NFS (pNFS) for scalable data access and session-based communication.

NFSv4.2

RFC 7862

2016

Introduced server-side copy, sparse files, application I/O hints, and space reservation.

  • setup

  • setup

TCP Connection Establishment Packet

S.No

Protocol Packets

Description

Size(bytes)

1

TCP Connection Establishment

NFS typically runs over TCP (port 2049) or UDP for older versions

TCP header: 2060

Source Port

Port of the client

2

Destination Port

Usually 2049 (NFS server)

2

Sequence Number

TCP sequence tracking

4

Acknowledgment Number

Acknowledges received data

4

Flags

SYN, ACK, etc.

1

Window Size

Flow control

2

Checksum

Error checking

2

Options (optional)

TCP options

Variable

RPC Call Packet

S.No

Protocol Packets

Description

Size(bytes)

2

RPC Call Packet

NFS uses Remote Procedure Call (RPC) to request file operations

Variable

XID

Transaction ID

4

Message Type

0 = Call, 1 = Reply

4

RPC Version

Typically 2

4

Program Number

100003 for NFS

4

Program Version

NFS version (e.g., 3 or 4)

4

Procedure Number

Operation (e.g., READ = 6, WRITE = 8)

4

Credentials

Auth info (e.g., AUTH_SYS)

Variable

NFS File Operation Packet

S.No

Protocol Packets

Description

Size(bytes)

3

NFS File Operation Packet

Contains specific file operation data (e.g., READ, WRITE, LOOKUP)

Variable

File Handle

Unique identifier for the file

Variable

Offset

Byte offset for read/write

8

Count

Number of bytes to read/write

4

Data

Actual file data (for WRITE)

Variable

RPC Reply Packet

S.No

Protocol Packets

Description

Size(bytes)

4

RPC Reply Packet

Server response to an RPC call

Variable

XID

Matches the request

4

Message Type

1 = Reply

4

Reply State

Accepted or Denied

4

Verifier

Auth verifier

Variable

Status Code

Success or error code

4

Result Data

File attributes, read data, etc.

Variable

NFS Session Termination Packet

S.No

Protocol Packets

Description

Size(bytes)

5

NFS Session Termination

TCP FIN or RST used to close the session

TCP header: 2060

FIN/RST

TCP flag bits used to close the connection

1 bit each

s.no

Use Case

Description

1

Centralized File Storage

NFS allows multiple clients to access files from a central server, simplifying data management.

2

Home Directory Sharing

User home directories can be stored on an NFS server and accessed from any client machine.

3

Diskless Workstations

Enables booting and running systems without local storage by mounting root filesystems over NFS.

4

Data Sharing Across Platforms

Facilitates file sharing between different operating systems (e.g., Linux, UNIX).

5

Backup and Archiving

Centralized storage makes it easier to back up and archive data from multiple clients.

6

High-Performance Computing (HPC)

Used in clusters to provide shared access to large datasets and software libraries.

7

Virtualization Environments

NFS is used to store VM images and ISO files accessible by hypervisors like VMware or KVM.

8

Application Data Hosting

Applications can store and retrieve data from a shared NFS mount, ensuring consistency.

9

Media and Content Servers

Ideal for streaming or serving large media files across a network.

10

Development Environments

Developers can share codebases and tools across systems using NFS mounts.

S.no

Feature

Description

1

File Sharing

Allows multiple clients to access and share files over a network.

2

Transparency

Users access remote files as if they are on the local system.

3

Stateless Protocol (v2/v3)

Server does not maintain client state, simplifying recovery and scalability.

4

Stateful Protocol (v4)

Maintains session state for improved performance and features like locking.

5

Platform Independence

Works across different operating systems (e.g., Linux, UNIX, macOS).

6

Mounting

Remote directories can be mounted locally, integrating them into the file system.

7

Security

Supports authentication methods like AUTH_SYS, Kerberos (NFSv4), and ACLs.

8

File Locking

NFSv4 supports built-in file locking mechanisms to prevent conflicts.

9

Caching

Clients cache file data to reduce server load and improve performance.

10

Asynchronous Writes

Improves performance by allowing clients to write data without waiting for server acknowledgment.

File Sharing - Testcases

#

Test Case

Description

Expected Result

1

Mount NFS Share

Mount NFS share on client

Share is mounted successfully

2

File Creation

Create file on NFS share

File is created and visible

3

File Read

Read file from NFS share

File content is displayed correctly

4

File Write

Modify file on NFS share

Changes are saved

5

File Delete

Delete file from NFS share

File is removed

6

Concurrent Access

Access file from multiple clients

No data corruption

7

File Locking

Lock file from one client

Other clients are restricted

8

Permission Enforcement

Access file with restricted permissions

Access denied

9

Directory Creation

Create directory on NFS share

Directory is created

10

Directory Deletion

Delete directory from NFS share

Directory is removed

11

Symbolic Link Handling

Create and access symlink

Link works as expected

12

Large File Transfer

Copy large file to NFS share

File is copied and accessible

13

File Rename

Rename file on NFS share

File is renamed

14

File Move

Move file within NFS share

File is moved

15

File Timestamp Update

Modify file and check timestamp

Timestamp is updated

16

File Ownership Change

Change file owner

Ownership is updated

17

File Group Change

Change file group

Group is updated

18

File Access Logging

Enable logging and access file

Access is logged

19

File Access After Reboot

Reboot client and access file

File is accessible

20

File Access After Server Reboot

Reboot server and access file

File is accessible

21

File Access Over VPN

Access NFS share via VPN

File is accessible

22

File Access Over VLAN

Access NFS share across VLAN

File is accessible (if routed)

23

File Access Over Wi-Fi

Access NFS share over wireless

File is accessible

24

File Access Over Ethernet

Access NFS share over wired

File is accessible

25

File Access With Firewall

Block NFS port and try access

Access fails

26

File Access With SELinux

Enable SELinux and access file

Access depends on policy

27

File Access With AppArmor

Enable AppArmor and access file

Access depends on profile

28

File Access With ACLs

Set ACLs and access file

Access follows ACL rules

29

File Access With Root User

Access file as root

Access granted

30

File Access With Normal User

Access file as normal user

Access based on permissions

31

File Access With Read-Only Mount

Mount share as read-only

Write operations fail

32

File Access With Read-Write Mount

Mount share as read-write

Write operations succeed

33

File Access With Noexec Option

Mount with noexec and run script

Execution fails

34

File Access With Sync Option

Mount with sync option

Writes are synchronous

35

File Access With Async Option

Mount with async option

Writes are asynchronous

36

File Access With Soft Mount

Mount with soft option and disconnect server

Operation times out

37

File Access With Hard Mount

Mount with hard option and disconnect server

Operation hangs until server returns

38

File Access With Autofs

Use autofs to mount NFS share

Share is mounted on access

39

File Access With fstab

Configure fstab and reboot

Share is mounted automatically

40

File Access With Kerberos

Use Kerberos-secured NFS

Access requires valid ticket

41

File Access With Anonymous User

Access file as anonymous user

Access based on export settings

42

File Access With Export Options

Use different export options

Behavior matches export configuration

43

File Access With Subnet Restriction

Restrict access to subnet

Only allowed subnet can access

44

File Access With Host Restriction

Restrict access to specific host

Only allowed host can access

45

File Access With NFSv3

Use NFS version 3

File operations succeed

46

File Access With NFSv4

Use NFS version 4

File operations succeed

47

File Access With NFSv4.1

Use NFS version 4.1

File operations succeed

48

File Access With NFSv4.2

Use NFS version 4.2

File operations succeed

49

File Access With IPv6

Mount NFS share using IPv6

File operations succeed

50

File Access With IPv4

Mount NFS share using IPv4

File operations succeed

Transparency - Testcases

#

Test Case

Description

Expected Result

1

Mount NFS Share

Mount NFS share on client

Share is mounted successfully

2

File Creation

Create file on NFS share

File is created and visible

3

File Read

Read file from NFS share

File content is displayed correctly

4

File Write

Modify file on NFS share

Changes are saved

5

File Delete

Delete file from NFS share

File is removed

6

Directory Creation

Create directory on NFS share

Directory is created

7

Directory Listing

List contents of NFS directory

Contents are listed as expected

8

File Rename

Rename file on NFS share

File is renamed successfully

9

File Move

Move file within NFS share

File is moved successfully

10

File Copy

Copy file within NFS share

File is copied successfully

11

File Execution

Execute script from NFS share

Script runs as expected

12

File Permissions

Change file permissions on NFS share

Permissions are updated

13

File Ownership

Change file ownership on NFS share

Ownership is updated

14

File Group Change

Change file group on NFS share

Group is updated

15

File Timestamp

Modify file and check timestamp

Timestamp is updated correctly

16

Symbolic Link

Create and access symbolic link

Link works as expected

17

Hard Link

Create and access hard link

Link works as expected

18

File Access via GUI

Open file using file manager

File opens like a local file

19

File Access via CLI

Open file using terminal

File opens like a local file

20

File Access via Application

Open file using text editor

File opens and edits successfully

21

File Save from App

Save file from application

File is saved without error

22

File Open from App

Open file from application

File opens without error

23

File Access After Reboot

Reboot client and access file

File is accessible

24

File Access After Server Reboot

Reboot server and access file

File is accessible

25

File Access Over VPN

Access file via VPN

File is accessible

26

File Access Over Wi-Fi

Access file over wireless

File is accessible

27

File Access Over Ethernet

Access file over wired connection

File is accessible

28

File Access With Firewall

Access file with firewall enabled

File is accessible if port is open

29

File Access With SELinux

Access file with SELinux enabled

File access depends on policy

30

File Access With AppArmor

Access file with AppArmor enabled

File access depends on profile

31

File Access With ACLs

Access file with ACLs configured

Access follows ACL rules

32

File Access With Root

Access file as root user

Access granted

33

File Access With Normal User

Access file as normal user

Access based on permissions

34

File Access With Read-Only Mount

Mount share as read-only

Write operations fail

35

File Access With Read-Write Mount

Mount share as read-write

Write operations succeed

36

File Access With Noexec

Mount with noexec and run script

Execution fails

37

File Access With Sync

Mount with sync option

Writes are synchronous

38

File Access With Async

Mount with async option

Writes are asynchronous

39

File Access With Soft Mount

Mount with soft option and disconnect server

Operation times out

40

File Access With Hard Mount

Mount with hard option and disconnect server

Operation hangs until server returns

41

File Access With Autofs

Use autofs to mount NFS share

Share is mounted on access

42

File Access With fstab

Configure fstab and reboot

Share is mounted automatically

43

File Access With IPv4

Mount and access file using IPv4

File operations succeed

44

File Access With IPv6

Mount and access file using IPv6

File operations succeed

45

File Access With NFSv3

Use NFS version 3

File operations succeed

46

File Access With NFSv4

Use NFS version 4

File operations succeed

47

File Access With NFSv4.1

Use NFS version 4.1

File operations succeed

48

File Access With NFSv4.2

Use NFS version 4.2

File operations succeed

49

File Access With Multiple Clients

Access same file from multiple clients

File is accessible and consistent

50

File Access With Backup Tool

Run backup tool on NFS-mounted directory

Files are backed up successfully

Stateless Protocol(v2&v3) - Testcases

#

Test Case

Description

Expected Result

1

Stateless Mount

Mount NFSv3 share

Mount succeeds without session tracking

2

Stateless File Read

Read file from NFSv3 share

File read succeeds independently

3

Stateless File Write

Write file to NFSv3 share

File write succeeds without session dependency

4

Stateless File Delete

Delete file from NFSv3 share

File is deleted without server tracking

5

Stateless Directory Listing

List directory contents

Directory contents are listed independently

6

Stateless File Rename

Rename file on NFSv3 share

Rename succeeds without session state

7

Stateless File Move

Move file within NFSv3 share

Move succeeds independently

8

Stateless File Copy

Copy file within NFSv3 share

Copy succeeds without session tracking

9

Stateless File Permissions

Change file permissions

Permissions updated independently

10

Stateless File Ownership

Change file ownership

Ownership updated without session state

11

Stateless File Access After Reboot

Access file after client reboot

File access succeeds without session restoration

12

Stateless File Access After Server Reboot

Access file after server reboot

File access succeeds without session restoration

13

Stateless Multiple Clients

Access same file from multiple clients

Each client operates independently

14

Stateless File Locking

Attempt file locking

Locking not supported in stateless mode

15

Stateless File Timestamp

Modify file and check timestamp

Timestamp updated independently

16

Stateless Symbolic Link

Create and access symlink

Symlink works without session state

17

Stateless Hard Link

Create and access hard link

Hard link works independently

18

Stateless File Access via CLI

Access file using terminal

File behaves like local file

19

Stateless File Access via GUI

Access file using file manager

File behaves like local file

20

Stateless File Access via App

Access file using application

File opens and saves without session dependency

21

Stateless File Save from App

Save file from application

File saved independently

22

Stateless File Open from App

Open file from application

File opened independently

23

Stateless File Access Over VPN

Access file via VPN

File access succeeds independently

24

Stateless File Access Over Wi-Fi

Access file over wireless

File access succeeds independently

25

Stateless File Access Over Ethernet

Access file over wired connection

File access succeeds independently

26

Stateless File Access With Firewall

Access file with firewall enabled

File access succeeds if port is open

27

Stateless File Access With SELinux

Access file with SELinux enabled

Access depends on policy, not session

28

Stateless File Access With AppArmor

Access file with AppArmor enabled

Access depends on profile, not session

29

Stateless File Access With ACLs

Access file with ACLs configured

Access follows ACL rules independently

30

Stateless File Access With Root

Access file as root user

Access granted independently

31

Stateless File Access With Normal User

Access file as normal user

Access based on permissions

32

Stateless File Access With Read-Only Mount

Mount share as read-only

Write operations fail independently

33

Stateless File Access With Read-Write Mount

Mount share as read-write

Write operations succeed independently

34

Stateless File Access With Noexec

Mount with noexec and run script

Execution fails independently

35

Stateless File Access With Sync

Mount with sync option

Writes are synchronous

36

Stateless File Access With Async

Mount with async option

Writes are asynchronous

37

Stateless File Access With Soft Mount

Mount with soft option and disconnect server

Operation times out independently

38

Stateless File Access With Hard Mount

Mount with hard option and disconnect server

Operation hangs until server returns

39

Stateless File Access With Autofs

Use autofs to mount NFS share

Share is mounted on access independently

40

Stateless File Access With fstab

Configure fstab and reboot

Share is mounted automatically

41

Stateless File Access With IPv4

Mount and access file using IPv4

File operations succeed independently

42

Stateless File Access With IPv6

Mount and access file using IPv6

File operations succeed independently

43

Stateless File Access With NFSv2

Use NFS version 2

Stateless behavior confirmed

44

Stateless File Access With NFSv3

Use NFS version 3

Stateless behavior confirmed

45

Stateless File Access With Multiple Mounts

Mount same share on multiple clients

Each mount operates independently

46

Stateless File Access With Backup Tool

Run backup tool on NFS-mounted directory

Files are backed up independently

47

Stateless File Access With Monitoring Tool

Monitor NFS traffic

No session state observed

48

Stateless File Access With Network Interruption

Disconnect and reconnect network

File access resumes independently

49

Stateless File Access With Crash Recovery

Simulate client crash and recover

File access resumes without session restoration

50

Stateless File Access With Stateless Export Option

Use stateless export settings

Server does not retain client state

Stateful Protocol(v4) - Testcases

#

Test Case

Description

Expected Result

1

Stateful Mount

Mount NFSv4 share

Mount succeeds and session is established

2

Session Establishment

Verify session creation on mount

Session ID is assigned

3

Session Persistence

Maintain session across multiple operations

Same session ID is used

4

File Locking

Lock file from one client

Lock is granted

5

Lock Conflict

Attempt to lock already locked file

Lock is denied or queued

6

Lock Release

Release file lock

Lock is released and available

7

Lock Expiry

Leave lock idle beyond timeout

Lock is automatically released

8

Delegation Handling

Server delegates file access

Client receives delegation token

9

Delegation Recall

Server recalls delegation

Client returns delegation

10

Compound Operation

Perform multiple operations in one request

All operations succeed atomically

11

Session Recovery

Recover session after network failure

Session is re-established

12

Session Expiry

Leave session idle

Session expires after timeout

13

Session Reuse

Reuse session for multiple file operations

Operations succeed under same session

14

Stateful File Read

Read file using session

File read succeeds

15

Stateful File Write

Write file using session

File write succeeds

16

Stateful File Delete

Delete file using session

File is deleted

17

Stateful Directory Listing

List directory contents

Contents listed under session

18

Stateful File Rename

Rename file

Rename succeeds

19

Stateful File Move

Move file

Move succeeds

20

Stateful File Copy

Copy file

Copy succeeds

21

Stateful File Permissions

Change file permissions

Permissions updated

22

Stateful File Ownership

Change file ownership

Ownership updated

23

Stateful File Access After Reboot

Reboot client and access file

Session is re-established

24

Stateful File Access After Server Reboot

Reboot server and access file

Session is re-established

25

Stateful Multiple Clients

Access same file from multiple clients

Session state maintained per client

26

Stateful File Timestamp

Modify file and check timestamp

Timestamp updated

27

Stateful Symbolic Link

Create and access symlink

Symlink works

28

Stateful Hard Link

Create and access hard link

Hard link works

29

Stateful File Access via CLI

Access file using terminal

File behaves like local file

30

Stateful File Access via GUI

Access file using file manager

File behaves like local file

31

Stateful File Access via App

Access file using application

File opens and saves with session

32

Stateful File Save from App

Save file from application

File saved with session

33

Stateful File Open from App

Open file from application

File opened with session

34

Stateful File Access Over VPN

Access file via VPN

Session maintained

35

Stateful File Access Over Wi-Fi

Access file over wireless

Session maintained

36

Stateful File Access Over Ethernet

Access file over wired connection

Session maintained

37

Stateful File Access With Firewall

Access file with firewall enabled

Session maintained if port is open

38

Stateful File Access With SELinux

Access file with SELinux enabled

Access depends on policy

39

Stateful File Access With AppArmor

Access file with AppArmor enabled

Access depends on profile

40

Stateful File Access With ACLs

Access file with ACLs configured

Access follows ACL rules

41

Stateful File Access With Root

Access file as root user

Access granted

42

Stateful File Access With Normal User

Access file as normal user

Access based on permissions

43

Stateful File Access With IPv4

Mount and access file using IPv4

Session maintained

44

Stateful File Access With IPv6

Mount and access file using IPv6

Session maintained

45

Stateful File Access With NFSv4

Use NFS version 4

Stateful behavior confirmed

46

Stateful File Access With NFSv4.1

Use NFS version 4.1

Stateful behavior confirmed

47

Stateful File Access With NFSv4.2

Use NFS version 4.2

Stateful behavior confirmed

48

Stateful File Access With Monitoring Tool

Monitor NFS traffic

Session state observed

49

Stateful File Access With Crash Recovery

Simulate client crash and recover

Session is re-established

50

Stateful File Access With Stateful Export Option

Use stateful export settings

Server maintains client session state

Platform Independence - Testcases

#

Test Case

Description

Expected Result

1

Stateful Mount

Mount NFSv4 share

Mount succeeds and session is established

2

Session Establishment

Verify session creation on mount

Session ID is assigned

3

Session Persistence

Maintain session across multiple operations

Same session ID is used

4

File Locking

Lock file from one client

Lock is granted

5

Lock Conflict

Attempt to lock already locked file

Lock is denied or queued

6

Lock Release

Release file lock

Lock is released and available

7

Lock Expiry

Leave lock idle beyond timeout

Lock is automatically released

8

Delegation Handling

Server delegates file access

Client receives delegation token

9

Delegation Recall

Server recalls delegation

Client returns delegation

10

Compound Operation

Perform multiple operations in one request

All operations succeed atomically

11

Session Recovery

Recover session after network failure

Session is re-established

12

Session Expiry

Leave session idle

Session expires after timeout

13

Session Reuse

Reuse session for multiple file operations

Operations succeed under same session

14

Stateful File Read

Read file using session

File read succeeds

15

Stateful File Write

Write file using session

File write succeeds

16

Stateful File Delete

Delete file using session

File is deleted

17

Stateful Directory Listing

List directory contents

Contents listed under session

18

Stateful File Rename

Rename file

Rename succeeds

19

Stateful File Move

Move file

Move succeeds

20

Stateful File Copy

Copy file

Copy succeeds

21

Stateful File Permissions

Change file permissions

Permissions updated

22

Stateful File Ownership

Change file ownership

Ownership updated

23

Stateful File Access After Reboot

Reboot client and access file

Session is re-established

24

Stateful File Access After Server Reboot

Reboot server and access file

Session is re-established

25

Stateful Multiple Clients

Access same file from multiple clients

Session state maintained per client

26

Stateful File Timestamp

Modify file and check timestamp

Timestamp updated

27

Stateful Symbolic Link

Create and access symlink

Symlink works

28

Stateful Hard Link

Create and access hard link

Hard link works

29

Stateful File Access via CLI

Access file using terminal

File behaves like local file

30

Stateful File Access via GUI

Access file using file manager

File behaves like local file

31

Stateful File Access via App

Access file using application

File opens and saves with session

32

Stateful File Save from App

Save file from application

File saved with session

33

Stateful File Open from App

Open file from application

File opened with session

34

Stateful File Access Over VPN

Access file via VPN

Session maintained

35

Stateful File Access Over Wi-Fi

Access file over wireless

Session maintained

36

Stateful File Access Over Ethernet

Access file over wired connection

Session maintained

37

Stateful File Access With Firewall

Access file with firewall enabled

Session maintained if port is open

38

Stateful File Access With SELinux

Access file with SELinux enabled

Access depends on policy

39

Stateful File Access With AppArmor

Access file with AppArmor enabled

Access depends on profile

40

Stateful File Access With ACLs

Access file with ACLs configured

Access follows ACL rules

41

Stateful File Access With Root

Access file as root user

Access granted

42

Stateful File Access With Normal User

Access file as normal user

Access based on permissions

43

Stateful File Access With IPv4

Mount and access file using IPv4

Session maintained

44

Stateful File Access With IPv6

Mount and access file using IPv6

Session maintained

45

Stateful File Access With NFSv4

Use NFS version 4

Stateful behavior confirmed

46

Stateful File Access With NFSv4.1

Use NFS version 4.1

Stateful behavior confirmed

47

Stateful File Access With NFSv4.2

Use NFS version 4.2

Stateful behavior confirmed

48

Stateful File Access With Monitoring Tool

Monitor NFS traffic

Session state observed

49

Stateful File Access With Crash Recovery

Simulate client crash and recover

Session is re-established

50

Stateful File Access With Stateful Export Option

Use stateful export settings

Server maintains client session state

Mounting - Testcases

#

Test Case

Description

Expected Result

1

Basic Mount

Mount NFS share using mount command

Share is mounted successfully

2

Mount via fstab

Configure /etc/fstab for auto-mount

Share mounts on boot

3

Mount via autofs

Use autofs to mount NFS share

Share mounts on access

4

Mount with NFSv3

Mount using NFS version 3

Mount succeeds

5

Mount with NFSv4

Mount using NFS version 4

Mount succeeds

6

Mount with NFSv4.1

Mount using NFS version 4.1

Mount succeeds

7

Mount with NFSv4.2

Mount using NFS version 4.2

Mount succeeds

8

Mount with IPv4

Mount using IPv4 address

Mount succeeds

9

Mount with IPv6

Mount using IPv6 address

Mount succeeds

10

Mount with Hostname

Mount using server hostname

Mount succeeds

11

Mount with Soft Option

Use soft mount option

Mount succeeds; timeouts occur on failure

12

Mount with Hard Option

Use hard mount option

Mount succeeds; retries on failure

13

Mount with Intr Option

Use intr option to allow interrupts

Mount allows interruption

14

Mount with Noexec Option

Use noexec to prevent execution

Executables cannot run

15

Mount with Exec Option

Use exec to allow execution

Executables run normally

16

Mount with Read-Only Option

Use ro option

Write operations fail

17

Mount with Read-Write Option

Use rw option

Write operations succeed

18

Mount with Sync Option

Use sync option

Writes are synchronous

19

Mount with Async Option

Use async option

Writes are asynchronous

20

Mount with Secure Option

Use secure option

Mount succeeds only from privileged ports

21

Mount with Insecure Option

Use insecure option

Mount allowed from unprivileged ports

22

Mount with Kerberos

Use Kerberos authentication

Mount succeeds with valid ticket

23

Mount with Anonymous Access

Use anonymous access

Mount succeeds if allowed

24

Mount with Subnet Restriction

Mount from allowed subnet

Mount succeeds

25

Mount with Host Restriction

Mount from allowed host

Mount succeeds

26

Mount with Firewall Enabled

Mount with firewall blocking NFS ports

Mount fails

27

Mount with Firewall Open

Mount with firewall allowing NFS ports

Mount succeeds

28

Mount with SELinux Enabled

Mount with SELinux enforcing

Mount behavior depends on policy

29

Mount with AppArmor Enabled

Mount with AppArmor profile

Mount behavior depends on profile

30

Mount with ACLs

Mount and apply ACLs

ACLs are enforced

31

Mount with Large File Support

Mount and access large files

Files are accessible

32

Mount with Symbolic Links

Mount and access symlinks

Symlinks work

33

Mount with Hard Links

Mount and access hard links

Hard links work

34

Mount with Multiple Clients

Mount same share on multiple clients

All clients mount successfully

35

Mount with Concurrent Access

Access mounted share concurrently

No conflicts or corruption

36

Mount with Network Interruption

Disconnect and reconnect network

Mount recovers or hangs based on options

37

Mount After Server Reboot

Reboot server and remount

Mount succeeds

38

Mount After Client Reboot

Reboot client and remount

Mount succeeds

39

Mount with DNS Resolution Failure

Use invalid hostname

Mount fails

40

Mount with Exported Subdirectory

Mount a subdirectory of exported path

Mount succeeds

41

Mount with Root Squash

Mount with root squash enabled

Root user is mapped to nobody

42

Mount with No Root Squash

Mount with root squash disabled

Root user retains privileges

43

Mount with UID Mapping

Mount with specific UID mapping

File ownership reflects mapping

44

Mount with GID Mapping

Mount with specific GID mapping

Group ownership reflects mapping

45

Mount with Mount Helper

Use mount.nfs helper

Mount succeeds

46

Mount with Systemd

Use systemd mount unit

Mount succeeds and is managed by systemd

47

Mount with GUI Tool

Use GUI tool (e.g., Nautilus)

Mount succeeds

48

Mount with Docker Container

Mount inside container

Mount succeeds depending on privileges

49

Mount with Virtual Machine

Mount from VM

Mount succeeds

50

Mount with Cloud Instance

Mount from cloud-hosted VM

Mount succeeds

Security - Testcases

#

Test Case

Description

Expected Result

1

AUTH_SYS Basic Access

Access NFS share using AUTH_SYS

Access granted based on UID/GID

2

AUTH_SYS Unauthorized Access

Access NFS share with invalid UID

Access denied

3

AUTH_SYS Root Squash

Access as root with root squash enabled

Root mapped to nobody

4

AUTH_SYS No Root Squash

Access as root with root squash disabled

Root retains privileges

5

Kerberos Mount

Mount NFSv4 share with Kerberos

Mount succeeds with valid ticket

6

Kerberos Ticket Expiry

Access after ticket expiry

Access denied

7

Kerberos Ticket Renewal

Renew ticket and access

Access granted

8

Kerberos Without Ticket

Access without Kerberos ticket

Access denied

9

Kerberos With Invalid Ticket

Access with invalid ticket

Access denied

10

Kerberos With Multiple Clients

Access from multiple clients with valid tickets

Access granted

11

Kerberos Delegation

Use delegated credentials

Access granted

12

Kerberos Replay Attack Test

Attempt replay attack

Access denied

13

Kerberos Encryption Check

Verify encrypted communication

Data is encrypted

14

Kerberos Integrity Check

Verify data integrity

Data is intact

15

ACL Read Permission

Access file with read ACL

Read access granted

16

ACL Write Permission

Access file with write ACL

Write access granted

17

ACL Execute Permission

Execute file with execute ACL

Execution allowed

18

ACL Deny Access

Access file with deny ACL

Access denied

19

ACL Modify Permissions

Modify ACLs on file

ACLs updated successfully

20

ACL Inheritance

Create file in ACL-protected directory

File inherits ACLs

21

ACL with AUTH_SYS

Use ACLs with AUTH_SYS authentication

ACLs enforced

22

ACL with Kerberos

Use ACLs with Kerberos authentication

ACLs enforced

23

ACL with Multiple Users

Apply ACLs for multiple users

Access varies by user

24

ACL with Groups

Apply ACLs for groups

Access varies by group

25

ACL Logging

Enable logging for ACL access

Access attempts logged

26

Kerberos Logging

Enable logging for Kerberos access

Access attempts logged

27

AUTH_SYS Logging

Enable logging for AUTH_SYS access

Access attempts logged

28

Unauthorized Access Logging

Log unauthorized access attempts

Attempts logged

29

ACL Audit Trail

Review ACL audit logs

Logs show access history

30

Kerberos Audit Trail

Review Kerberos audit logs

Logs show ticket usage

31

AUTH_SYS Audit Trail

Review AUTH_SYS audit logs

Logs show UID-based access

32

ACL with GUI Tool

Modify ACLs using GUI

ACLs updated successfully

33

ACL with CLI Tool

Modify ACLs using CLI

ACLs updated successfully

34

ACL with Script

Modify ACLs using script

ACLs updated successfully

35

ACL with Backup Tool

Backup ACL-protected files

ACLs preserved

36

ACL with Restore Tool

Restore ACL-protected files

ACLs restored

37

Kerberos with VPN

Access NFS over VPN with Kerberos

Access granted with valid ticket

38

Kerberos with NAT

Access NFS behind NAT

Access granted with proper configuration

39

AUTH_SYS with VLAN

Access NFS over VLAN

Access granted based on UID/GID

40

ACL with VLAN

Access ACL-protected files over VLAN

ACLs enforced

41

Kerberos with IPv6

Access NFS over IPv6 with Kerberos

Access granted

42

AUTH_SYS with IPv6

Access NFS over IPv6 with AUTH_SYS

Access granted

43

ACL with IPv6

Access ACL-protected files over IPv6

ACLs enforced

44

Kerberos with IPv4

Access NFS over IPv4 with Kerberos

Access granted

45

AUTH_SYS with IPv4

Access NFS over IPv4 with AUTH_SYS

Access granted

46

ACL with IPv4

Access ACL-protected files over IPv4

ACLs enforced

47

ACL with File Manager

View ACLs in file manager

ACLs displayed

48

ACL with Text Editor

Edit ACLs in text editor

ACLs updated

49

ACL with Systemd

Apply ACLs via systemd unit

ACLs enforced

50

ACL with Docker Container

Access ACL-protected files in container

ACLs enforced based on container privileges

File Locking - Testcases

#

Test Case

Description

Expected Result

1

Basic File Lock

Lock a file using fcntl or flock

Lock is acquired successfully

2

Lock and Unlock

Lock and then unlock a file

Lock is released

3

Lock Conflict

Try to lock an already locked file

Lock request is blocked or denied

4

Shared Lock

Acquire shared lock on a file

Multiple readers allowed

5

Exclusive Lock

Acquire exclusive lock on a file

Only one writer allowed

6

Lock Upgrade

Upgrade shared lock to exclusive

Upgrade succeeds if no other locks

7

Lock Downgrade

Downgrade exclusive lock to shared

Downgrade succeeds

8

Lock Persistence

Maintain lock across operations

Lock remains active

9

Lock Expiry

Leave lock idle beyond timeout

Lock is released automatically

10

Lock After Reboot

Reboot client and check lock

Lock is lost (must be reacquired)

11

Lock After Server Reboot

Reboot server and check lock

Lock is lost (must be reacquired)

12

Lock Recovery

Reacquire lock after failure

Lock is reacquired

13

Lock with Multiple Clients

Lock file from multiple clients

Only one client gets exclusive lock

14

Lock with Multiple Users

Lock file by different users

Lock behavior follows permissions

15

Lock with Root User

Lock file as root

Lock is granted

16

Lock with Normal User

Lock file as normal user

Lock is granted if permissions allow

17

Lock with Read-Only Mount

Try to lock file on read-only mount

Lock fails

18

Lock with Read-Write Mount

Lock file on read-write mount

Lock succeeds

19

Lock with Soft Mount

Lock file on soft mount

Lock may fail on timeout

20

Lock with Hard Mount

Lock file on hard mount

Lock persists until server responds

21

Lock with GUI Application

Lock file using GUI editor

Lock is acquired

22

Lock with CLI Tool

Lock file using command-line tool

Lock is acquired

23

Lock with Script

Lock file using shell script

Lock is acquired

24

Lock with Python

Lock file using Python script

Lock is acquired

25

Lock with Java

Lock file using Java NIO

Lock is acquired

26

Lock with C/C++

Lock file using POSIX APIs

Lock is acquired

27

Lock with Text Editor

Open file in editor with lock

Lock is acquired

28

Lock with Media Player

Open media file with lock

Lock is acquired

29

Lock with Backup Tool

Lock file during backup

Lock is acquired

30

Lock with Restore Tool

Lock file during restore

Lock is acquired

31

Lock Logging

Enable logging for lock operations

Lock events are logged

32

Lock Audit Trail

Review audit logs for lock activity

Lock history is visible

33

Lock with IPv4

Lock file over IPv4

Lock is acquired

34

Lock with IPv6

Lock file over IPv6

Lock is acquired

35

Lock with VPN

Lock file over VPN

Lock is acquired

36

Lock with VLAN

Lock file over VLAN

Lock is acquired

37

Lock with NAT

Lock file behind NAT

Lock is acquired

38

Lock with Docker

Lock file from container

Lock is acquired if permissions allow

39

Lock with Virtual Machine

Lock file from VM

Lock is acquired

40

Lock with Cloud Instance

Lock file from cloud-hosted VM

Lock is acquired

41

Lock with ACL

Lock file with ACL restrictions

Lock behavior follows ACLs

42

Lock with Kerberos

Lock file with Kerberos authentication

Lock is acquired

43

Lock with AUTH_SYS

Lock file with AUTH_SYS

Lock is acquired

44

Lock with Multiple Mounts

Lock file from different mount points

Lock is respected across mounts

45

Lock with File Manager

Lock file using file manager

Lock is acquired

46

Lock with Systemd

Lock file via systemd service

Lock is acquired

47

Lock with Network Interruption

Lock file and disconnect network

Lock is lost or recovered

48

Lock with File Sync Tool

Lock file during sync

Lock is acquired

49

Lock with Concurrent Access

Simultaneous access with lock

Conflicts are prevented

50

Lock with File Monitoring Tool

Monitor lock status

Lock status is visible

Caching - Testcases

#

Test Case

Description

Expected Result

1

Basic Read Caching

Read file and verify caching

File is cached locally

2

Basic Write Caching

Write file and verify caching

Write is cached before sync

3

Cache Invalidation on Change

Modify file on server

Client cache is invalidated

4

Cache Refresh on Timeout

Wait for cache timeout

Cache is refreshed

5

Cache Consistency Check

Compare cached and server file

Data matches after sync

6

Cache with Multiple Clients

Access file from multiple clients

Each client maintains its own cache

7

Cache with File Locking

Lock file and modify

Cache is updated after unlock

8

Cache with Read-Only Mount

Read file from read-only mount

File is cached

9

Cache with Read-Write Mount

Write file to read-write mount

File is cached and synced

10

Cache with Soft Mount

Use soft mount and read file

Cache works with timeout behavior

11

Cache with Hard Mount

Use hard mount and read file

Cache persists until server responds

12

Cache with Sync Option

Use sync mount option

Writes are immediately flushed

13

Cache with Async Option

Use async mount option

Writes are cached

14

Cache with Noac Option

Mount with noac (no attribute caching)

No caching occurs

15

Cache with Actimeo Option

Set actimeo to control cache timeout

Cache expires as configured

16

Cache with Lookup Cache

Cache directory lookups

Lookups are cached

17

Cache with Attribute Cache

Cache file attributes

Attributes are cached

18

Cache with Data Cache

Cache file content

Data is cached

19

Cache with Directory Cache

Cache directory contents

Directory listing is cached

20

Cache with Symbolic Links

Access symlinked file

Target file is cached

21

Cache with Hard Links

Access hard-linked file

File is cached

22

Cache with Large Files

Read large file

File is cached in chunks

23

Cache with Small Files

Read small file

File is cached entirely

24

Cache with Frequent Access

Access file repeatedly

File remains in cache

25

Cache with Infrequent Access

Access file after long interval

Cache may expire

26

Cache with Network Interruption

Disconnect network during access

Cached data is still available

27

Cache with Server Reboot

Reboot server and access file

Cache is refreshed

28

Cache with Client Reboot

Reboot client and access file

Cache is cleared

29

Cache with File Manager

Access file via GUI

File is cached

30

Cache with CLI Tool

Access file via terminal

File is cached

31

Cache with Text Editor

Open file in editor

File is cached

32

Cache with Media Player

Play media file

File is cached

33

Cache with Backup Tool

Backup cached file

Backup uses cached data

34

Cache with Restore Tool

Restore file and verify cache

Cache is updated

35

Cache with Monitoring Tool

Monitor cache usage

Cache activity is visible

36

Cache with Logging Enabled

Enable cache logging

Cache events are logged

37

Cache with Audit Trail

Review cache audit logs

Logs show cache history

38

Cache with IPv4

Access file over IPv4

File is cached

39

Cache with IPv6

Access file over IPv6

File is cached

40

Cache with VPN

Access file over VPN

File is cached

41

Cache with VLAN

Access file over VLAN

File is cached

42

Cache with NAT

Access file behind NAT

File is cached

43

Cache with Docker

Access file from container

File is cached if allowed

44

Cache with Virtual Machine

Access file from VM

File is cached

45

Cache with Cloud Instance

Access file from cloud-hosted VM

File is cached

46

Cache with Kerberos

Access file with Kerberos authentication

File is cached

47

Cache with AUTH_SYS

Access file with AUTH_SYS

File is cached

48

Cache with ACL

Access ACL-protected file

File is cached if access is granted

49

Cache with Concurrent Access

Access file concurrently

Cache prevents redundant reads

50

Cache with Performance Benchmark

Measure performance with and without cache

Cached access is faster

Asynchronous Writes - Testcases

#

Test Case

Description

Expected Result

1

Basic Async Write

Write file with async mount

Write completes without delay

2

Async Write Performance

Measure write speed with async

Faster than sync write

3

Async Write with Large File

Write large file

Write completes quickly

4

Async Write with Small File

Write small file

Write completes instantly

5

Async Write with Multiple Files

Write multiple files

All writes complete without waiting

6

Async Write with Network Delay

Simulate network delay

Write still completes quickly

7

Async Write with Server Load

Write during high server load

Write completes without blocking

8

Async Write with Client Crash

Crash client after write

Data may be lost if not flushed

9

Async Write with Server Crash

Crash server after write

Data may be lost if not committed

10

Async Write with Power Failure

Simulate power loss

Data integrity depends on flush timing

11

Async Write with File Locking

Lock file and write

Write completes, lock respected

12

Async Write with Read-Only Mount

Attempt async write on read-only mount

Write fails

13

Async Write with Sync Option

Use sync mount option

Write waits for acknowledgment

14

Async Write with Hard Mount

Use hard mount with async

Write completes asynchronously

15

Async Write with Soft Mount

Use soft mount with async

Write completes, may timeout on failure

16

Async Write with Cache Enabled

Write with caching

Write is cached and delayed

17

Async Write with Cache Disabled

Disable cache

Write behavior depends on client

18

Async Write with File Manager

Write file using GUI

Write completes without delay

19

Async Write with CLI Tool

Write file using terminal

Write completes without delay

20

Async Write with Text Editor

Save file in editor

Save completes instantly

21

Async Write with Media File

Save media file

File is saved quickly

22

Async Write with Backup Tool

Backup file with async write

Backup completes faster

23

Async Write with Restore Tool

Restore file with async write

Restore completes quickly

24

Async Write with Logging Enabled

Enable logging

Logs show write completion before flush

25

Async Write with Audit Trail

Review audit logs

Logs show write timing

26

Async Write with IPv4

Write over IPv4

Write completes asynchronously

27

Async Write with IPv6

Write over IPv6

Write completes asynchronously

28

Async Write with VPN

Write over VPN

Write completes without delay

29

Async Write with VLAN

Write over VLAN

Write completes without delay

30

Async Write with NAT

Write behind NAT

Write completes without delay

31

Async Write with Docker

Write from container

Write completes asynchronously

32

Async Write with Virtual Machine

Write from VM

Write completes asynchronously

33

Async Write with Cloud Instance

Write from cloud-hosted VM

Write completes asynchronously

34

Async Write with Kerberos

Write with Kerberos authentication

Write completes asynchronously

35

Async Write with AUTH_SYS

Write with AUTH_SYS

Write completes asynchronously

36

Async Write with ACL

Write to ACL-protected file

Write respects ACLs

37

Async Write with File Sync Tool

Sync file after async write

Data is flushed to server

38

Async Write with Flush Command

Use sync or fsync

Data is committed to server

39

Async Write with File Monitoring Tool

Monitor write timing

Write appears before flush

40

Async Write with Concurrent Access

Multiple clients write same file

Writes complete independently

41

Async Write with File Overwrite

Overwrite existing file

Write completes without delay

42

Async Write with New File

Create and write new file

File is created and written quickly

43

Async Write with Directory Creation

Create directory and write file

Directory and file created quickly

44

Async Write with Symbolic Link

Write to symlinked file

Write completes asynchronously

45

Async Write with Hard Link

Write to hard-linked file

Write completes asynchronously

46

Async Write with File Rename

Rename file after write

Rename succeeds, data may still be in cache

47

Async Write with File Move

Move file after write

Move succeeds, data may still be in cache

48

Async Write with File Delete

Delete file after write

File deleted, data may not be flushed

49

Async Write with File Compression

Compress file after write

Compression succeeds, data may be cached

50

Async Write with Performance Benchmark

Compare sync vs async write

Async write is faster

  • Reference links