-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove REST from test_330 (and rename) (#14416)
- Loading branch information
Showing
2 changed files
with
43 additions
and
63 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |