]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/ocf/tests/functional/tests/security/conftest.py
2 # Copyright(c) 2019 Intel Corporation
3 # SPDX-License-Identifier: BSD-3-Clause-Clear
14 from tests
.utils
.random
import RandomStringGenerator
, RandomGenerator
, DefaultRanges
, Range
16 from pyocf
.types
.cache
import CacheMode
, EvictionPolicy
, MetadataLayout
, PromotionPolicy
17 from pyocf
.types
.shared
import CacheLineSize
21 sys
.path
.append(os
.path
.join(os
.path
.dirname(__file__
), os
.path
.pardir
))
25 return list(enum
)[0].value
29 return list(enum
)[-1].value
33 return Range(enum_min(enum
), enum_max(enum
))
36 @pytest.fixture(params
=RandomGenerator(DefaultRanges
.UINT16
))
37 def c_uint16_randomize(request
):
41 @pytest.fixture(params
=RandomGenerator(DefaultRanges
.UINT32
))
42 def c_uint32_randomize(request
):
46 @pytest.fixture(params
=RandomGenerator(DefaultRanges
.UINT64
))
47 def c_uint64_randomize(request
):
51 @pytest.fixture(params
=RandomGenerator(DefaultRanges
.INT
))
52 def c_int_randomize(request
):
56 @pytest.fixture(params
=RandomGenerator(DefaultRanges
.INT
))
57 def c_int_sector_randomize(request
):
58 return request
.param
// 512 * 512
61 @pytest.fixture(params
=RandomStringGenerator())
62 def string_randomize(request
):
67 params
=RandomGenerator(DefaultRanges
.UINT32
).exclude_range(enum_range(CacheMode
))
69 def not_cache_mode_randomize(request
):
74 params
=RandomGenerator(DefaultRanges
.UINT32
).exclude_range(enum_range(CacheLineSize
))
76 def not_cache_line_size_randomize(request
):
81 params
=RandomGenerator(DefaultRanges
.UINT32
).exclude_range(enum_range(EvictionPolicy
))
83 def not_eviction_policy_randomize(request
):
88 params
=RandomGenerator(DefaultRanges
.UINT32
).exclude_range(enum_range(PromotionPolicy
))
90 def not_promotion_policy_randomize(request
):
95 params
=RandomGenerator(DefaultRanges
.UINT32
).exclude_range(enum_range(MetadataLayout
))
97 def not_metadata_layout_randomize(request
):