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-130936 / 25.04 / remove REST from test_330 (and rename) #14416

Merged
merged 1 commit into from
Sep 4, 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
63 changes: 0 additions & 63 deletions tests/api2/test_330_pool_acltype.py

This file was deleted.

43 changes: 43 additions & 0 deletions tests/api2/test_acltype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import pytest

from auto_config import pool_name
from middlewared.test.integration.utils import call
from middlewared.test.integration.assets.pool import dataset


def query_filters(ds_name):
return [['id', '=', ds_name]], {'get': True, 'extra': {'retrieve_children': False}}


@pytest.fixture(scope='module')
def temp_ds():
with dataset('test1') as ds:
yield ds


def test_default_acltype_on_zpool():
assert 'POSIXACL' in call('filesystem.statfs', f'/mnt/{pool_name}')['flags']


def test_acltype_inheritance(temp_ds):
assert call('zfs.dataset.query', *query_filters(temp_ds))['properties']['acltype']['rawvalue'] == 'posix'


@pytest.mark.parametrize(
'change,expected', [
(
{'acltype': 'NFSV4', 'aclmode': 'PASSTHROUGH'},
(('acltype', 'value', 'nfsv4'), ('aclmode', 'value', 'passthrough'), ('aclinherit', 'value', 'passthrough'))
),
(
{'acltype': 'POSIX', 'aclmode': 'DISCARD'},
(('acltype', 'value', 'posix'), ('aclmode', 'value', 'discard'), ('aclinherit', 'value', 'discard'))
),
],
ids=['NFSV4_PASSTHROUGH', 'POSIX_DISCARD']
)
def test_change_acltype_and_aclmode_to_(temp_ds, change, expected):
call('pool.dataset.update', temp_ds, change)
props = call('zfs.dataset.query', *query_filters(temp_ds))['properties']
for tkey, skey, value in expected:
assert props[tkey][skey] == value, props[tkey][skey]
Loading