Update Init config usage and remove WI cache mode
This commit is contained in:
parent
cc77929a5d
commit
8204fa8a56
@ -26,7 +26,6 @@ class CacheMode(Enum):
|
|||||||
WA = "Write-Around"
|
WA = "Write-Around"
|
||||||
PT = "Pass-Through"
|
PT = "Pass-Through"
|
||||||
WO = "Write-Only"
|
WO = "Write-Only"
|
||||||
WI = "Write-Invalidate"
|
|
||||||
DEFAULT = WT
|
DEFAULT = WT
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@ -44,15 +43,12 @@ class CacheMode(Enum):
|
|||||||
return CacheModeTrait.InsertWrite | CacheModeTrait.LazyFlush
|
return CacheModeTrait.InsertWrite | CacheModeTrait.LazyFlush
|
||||||
elif cache_mode == CacheMode.WA:
|
elif cache_mode == CacheMode.WA:
|
||||||
return CacheModeTrait.InsertRead
|
return CacheModeTrait.InsertRead
|
||||||
elif cache_mode == CacheMode.WI:
|
|
||||||
return CacheModeTrait.InsertRead | CacheModeTrait.WriteInvalidate
|
|
||||||
|
|
||||||
|
|
||||||
class CacheModeTrait(IntFlag):
|
class CacheModeTrait(IntFlag):
|
||||||
InsertWrite = 1
|
InsertWrite = 1
|
||||||
InsertRead = 2
|
InsertRead = 2
|
||||||
LazyFlush = 4
|
LazyFlush = 4
|
||||||
WriteInvalidate = 8
|
|
||||||
|
|
||||||
|
|
||||||
class SeqCutOffPolicy(Enum):
|
class SeqCutOffPolicy(Enum):
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from api.cas import casadm, init_config
|
from api.cas import casadm
|
||||||
from api.cas.casadm_parser import get_caches, get_cores
|
from api.cas.casadm_parser import get_caches, get_cores
|
||||||
from api.cas.cache_config import CacheMode
|
from api.cas.cache_config import CacheMode
|
||||||
|
from api.cas.init_config import InitConfig
|
||||||
from core.test_run import TestRun
|
from core.test_run import TestRun
|
||||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||||
from test_utils.filesystem.file import File
|
from test_utils.filesystem.file import File
|
||||||
@ -67,7 +68,7 @@ def test_cas_startup(cache_mode, filesystem):
|
|||||||
fstab.add_mountpoint(device=core,
|
fstab.add_mountpoint(device=core,
|
||||||
mount_point=mountpoint,
|
mount_point=mountpoint,
|
||||||
fs_type=filesystem)
|
fs_type=filesystem)
|
||||||
init_config.create_init_config_from_running_configuration()
|
InitConfig.create_init_config_from_running_configuration()
|
||||||
|
|
||||||
with TestRun.step("Reboot"):
|
with TestRun.step("Reboot"):
|
||||||
TestRun.executor.reboot()
|
TestRun.executor.reboot()
|
||||||
@ -98,5 +99,5 @@ def test_cas_startup(cache_mode, filesystem):
|
|||||||
with TestRun.step("Test cleanup"):
|
with TestRun.step("Test cleanup"):
|
||||||
fstab.remove_mountpoint(device=core)
|
fstab.remove_mountpoint(device=core)
|
||||||
core.unmount()
|
core.unmount()
|
||||||
init_config.create_default_init_config()
|
InitConfig.create_default_init_config()
|
||||||
casadm.stop_all_caches()
|
casadm.stop_all_caches()
|
||||||
|
Loading…
Reference in New Issue
Block a user