Skip to content

Commit d634078

Browse files
[integ-tests] Verify the head node NFS server is configured for NFSv4-only and lockd does not bind port
1 parent de521a9 commit d634078

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ CHANGELOG
1313
consistent with the existing limit for `Database`. This prevents runtime failures caused by MySQL's table name length limit.
1414
- The validator `MultiNetworkInterfacesInstancesValidator` now also covers single-network-card instances with EFA enabled, which are launched with multiple network interfaces and therefore cannot be auto-assigned a public IP.
1515
- The CLI now requires the additional permission `tag:GetResources`.
16-
- Add support for Python 3.11, 3.12 in pcluster CLI
16+
- Add support for Python 3.13 in pcluster CLI
17+
- Enforce NFSv4-only on the ParallelCluster-managed NFS server (head node). The NFSv3 client stack (rpcbind, rpc-statd, lockd) are unchanged, so cluster nodes can still mount external NFSv3 servers.
1718

1819
**BUG FIXES**
1920
- Fix sporadic S3 bucket (with name parallelcluster-*-v1-do-not-delete) creation failure when multiple create-cluster commands are running simultaneously in the same region.

tests/integration-tests/tests/storage/storage_common.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,27 @@ def test_ebs_correctly_mounted(remote_command_executor, mount_dir, volume_size):
201201
assert_that(result.stdout).matches(r"UUID=.* {mount_dir} ext4 _netdev 0 0".format(mount_dir=mount_dir))
202202

203203

204+
def assert_head_node_nfs_serves_v4_only(remote_command_executor):
205+
"""
206+
Verify the head node NFS server is configured for NFSv4-only.
207+
208+
nfsd reports the versions it serves in /proc/fs/nfsd/versions, e.g. "-2 -3 +4 +4.1 +4.2"
209+
('+' enabled, '-' disabled).
210+
211+
Also assert the lock manager (nlockmgr/lockd) is not registered with rpcbind. Lock manager is used by v3, not v4.
212+
"""
213+
logging.info("Checking the head node NFS server serves NFSv4 only")
214+
versions = remote_command_executor.run_remote_command("sudo cat /proc/fs/nfsd/versions").stdout
215+
# NFSv4 must be enabled and NFSv2/NFSv3 must be disabled.
216+
assert_that(versions).contains("+4")
217+
assert_that(versions).does_not_match(r"\+2(\s|$)")
218+
assert_that(versions).does_not_match(r"\+3(\s|$)")
219+
220+
# lockd must not be brought up: no nlockmgr registered with rpcbind on the head node.
221+
rpcinfo = remote_command_executor.run_remote_command("rpcinfo -p localhost").stdout
222+
assert_that(rpcinfo).does_not_contain("nlockmgr")
223+
224+
204225
# for RAID
205226

206227

tests/integration-tests/tests/storage/test_ebs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from tests.storage.kms_key_factory import KMSKeyFactory
2222
from tests.storage.storage_common import (
23+
assert_head_node_nfs_serves_v4_only,
2324
assert_subnet_az_relations_from_config,
2425
test_directory_correctly_shared_between_ln_and_hn,
2526
test_ebs_correctly_mounted,
@@ -58,6 +59,8 @@ def test_ebs_single(
5859
# Test ebs correctly shared between HeadNode and ComputeNodes
5960
_test_ebs_correctly_shared(remote_command_executor_head_node, mount_dir, scheduler_commands)
6061

62+
assert_head_node_nfs_serves_v4_only(remote_command_executor_head_node)
63+
6164
remote_command_executor_login_node = RemoteCommandExecutor(cluster, use_login_node=True)
6265
# Test ebs correctly shared between LoginNode and ComputeNodes
6366
_test_ebs_correctly_shared(remote_command_executor_login_node, mount_dir, scheduler_commands)

0 commit comments

Comments
 (0)