Skip to content

Commit

Permalink
remove REST from test_330 (and rename) (#14416)
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo authored Sep 4, 2024
1 parent 8adce7a commit adb3a4a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 63 deletions.
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]

0 comments on commit adb3a4a

Please sign in to comment.