Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/tests/test_objstorage_striping.py
Show All 15 Lines | |||||
class TestStripingObjStorage(ObjStorageTestFixture, unittest.TestCase): | class TestStripingObjStorage(ObjStorageTestFixture, unittest.TestCase): | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
self.base_dir = tempfile.mkdtemp() | self.base_dir = tempfile.mkdtemp() | ||||
os.mkdir(os.path.join(self.base_dir, "root1")) | os.mkdir(os.path.join(self.base_dir, "root1")) | ||||
os.mkdir(os.path.join(self.base_dir, "root2")) | os.mkdir(os.path.join(self.base_dir, "root2")) | ||||
storage_config = { | storage_config = { | ||||
"cls": "striping", | "cls": "striping", | ||||
"args": { | |||||
"objstorages": [ | "objstorages": [ | ||||
{ | { | ||||
"cls": "pathslicing", | "cls": "pathslicing", | ||||
"args": { | |||||
"root": os.path.join(self.base_dir, "root1"), | "root": os.path.join(self.base_dir, "root1"), | ||||
"slicing": "0:2", | "slicing": "0:2", | ||||
"allow_delete": True, | "allow_delete": True, | ||||
}, | }, | ||||
}, | |||||
{ | { | ||||
"cls": "pathslicing", | "cls": "pathslicing", | ||||
"args": { | |||||
"root": os.path.join(self.base_dir, "root2"), | "root": os.path.join(self.base_dir, "root2"), | ||||
"slicing": "0:2", | "slicing": "0:2", | ||||
"allow_delete": True, | "allow_delete": True, | ||||
}, | }, | ||||
}, | ], | ||||
] | |||||
}, | |||||
} | } | ||||
self.storage = get_objstorage(**storage_config) | self.storage = get_objstorage(**storage_config) | ||||
def tearDown(self): | def tearDown(self): | ||||
shutil.rmtree(self.base_dir) | shutil.rmtree(self.base_dir) | ||||
def test_add_striping_behavior(self): | def test_add_striping_behavior(self): | ||||
exp_storage_counts = [0, 0] | exp_storage_counts = [0, 0] | ||||
Show All 26 Lines |