Add sector and align parameters to read and write lockspace and
resource calls to test_write_lockspace and test_write_resource tests
to test that these parameters are accepted. Other tests still use
calls without these parameters to test the defaults.
---
tests/python_test.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tests/python_test.py b/tests/python_test.py
index 5029924..6393222 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -34,9 +34,12 @@ def test_write_lockspace(tmpdir, sanlock_daemon, size, offset):
path = str(tmpdir.join("lockspace"))
util.create_file(path, size)
- sanlock.write_lockspace("name", path, offset=offset, iotimeout=1)
+ sanlock.write_lockspace(
+ "name", path, offset=offset, iotimeout=1, align=sanlock.ALIGN1M,
+ sector=sanlock.SECTOR512)
- ls = sanlock.read_lockspace(path, offset=offset)
+ ls = sanlock.read_lockspace(
+ path, offset=offset, align=sanlock.ALIGN1M, sector=sanlock.SECTOR512)
assert ls == {"iotimeout": 1, "lockspace": "name"}
acquired = sanlock.inq_lockspace(
@@ -64,9 +67,12 @@ def test_write_resource(tmpdir, sanlock_daemon, size, offset):
util.create_file(path, size)
disks = [(path, offset)]
- sanlock.write_resource("ls_name", "res_name", disks)
+ sanlock.write_resource(
+ "ls_name", "res_name", disks, align=sanlock.ALIGN1M,
+ sector=sanlock.SECTOR512)
- res = sanlock.read_resource(path, offset=offset)
+ res = sanlock.read_resource(
+ path, offset=offset, align=sanlock.ALIGN1M, sector=sanlock.SECTOR512)
assert res == {
"lockspace": "ls_name",
"resource": "res_name",
--
2.20.1