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

NAS-130877 / 24.10-RC.1 / Remove acltype normalization for datasets (by anodos325) #14386

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/middlewared/middlewared/plugins/pool_/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,6 @@ async def do_create(self, app, data):
parent_st['acltype'] = await self.middleware.call('filesystem.path_get_acltype', parent_mp)

mountpoint = os.path.join('/mnt', data['name'])
if data['type'] == 'FILESYSTEM' and data.get('acltype', 'INHERIT') == 'INHERIT' and len(
data['name'].split('/')
) == 2:
data['acltype'] = 'POSIX'

try:
await self.middleware.call('filesystem.stat', mountpoint)
Expand Down
22 changes: 22 additions & 0 deletions tests/api2/test_nfsv4_top_level_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest

from middlewared.test.integration.assets.pool import dataset
from middlewared.test.integration.utils import call, pool


@pytest.fixture(scope='module')
def set_nfsv4_top_level():
call('pool.dataset.update', pool, {'acltype': 'NFSV4', 'aclmode': 'PASSTHROUGH'})

try:
yield
finally:
call('pool.dataset.update', pool, {'acltype': 'POSIX', 'aclmode': 'DISCARD'})


def test__acltype_inherit(set_nfsv4_top_level):
with dataset('v4inherit') as ds:
entry = call('pool.dataset.query', [['name', '=', ds]], {'get': True})

assert entry['acltype']['value'] == 'NFSV4'
assert entry['aclmode']['value'] == 'PASSTHROUGH'
Loading