We introduced new assertions about lockspace and resource names in the
4k branch. Update the assertions to check for b"name" instead of
"name".
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/python_test.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/python_test.py b/tests/python_test.py
index 7e3910b..b2f903b 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -50,11 +50,11 @@ def test_write_lockspace(tmpdir, sanlock_daemon, size, offset):
"name", path, offset=offset, iotimeout=1, align=ALIGNMENT_1M,
sector=SECTOR_SIZE_512)
ls = sanlock.read_lockspace(
path, offset=offset, align=ALIGNMENT_1M, sector=SECTOR_SIZE_512)
- assert ls == {"iotimeout": 1, "lockspace": "name"}
+ assert ls == {"iotimeout": 1, "lockspace": b"name"}
acquired = sanlock.inq_lockspace(
"name", 1, path, offset=offset, wait=False)
assert acquired is False
@@ -81,11 +81,11 @@ def test_write_lockspace_4k(user_4k_path, sanlock_daemon, align):
"name", user_4k_path, iotimeout=1, align=align, sector=SECTOR_SIZE_4K)
ls = sanlock.read_lockspace(
user_4k_path, align=align, sector=SECTOR_SIZE_4K)
- assert ls == {"iotimeout": 1, "lockspace": "name"}
+ assert ls == {"iotimeout": 1, "lockspace": b"name"}
acquired = sanlock.inq_lockspace("name", 1, user_4k_path, wait=False)
assert acquired is False
# Verify that lockspace was written.
@@ -140,12 +140,12 @@ def test_write_resource(tmpdir, sanlock_daemon, size, offset):
sector=SECTOR_SIZE_512)
res = sanlock.read_resource(
path, offset=offset, align=ALIGNMENT_1M, sector=SECTOR_SIZE_512)
assert res == {
- "lockspace": "ls_name",
- "resource": "res_name",
+ "lockspace": b"ls_name",
+ "resource": b"res_name",
"version": 0
}
owners = sanlock.read_resource_owners("ls_name", "res_name",
disks)
assert owners == []
@@ -175,12 +175,12 @@ def test_write_resource_4k(sanlock_daemon, user_4k_path, align):
res = sanlock.read_resource(
user_4k_path, align=align, sector=SECTOR_SIZE_4K)
assert res == {
- "lockspace": "ls_name",
- "resource": "res_name",
+ "lockspace": b"ls_name",
+ "resource": b"res_name",
"version": 0
}
owners = sanlock.read_resource_owners(
"ls_name", "res_name", disks, align=align,
sector=SECTOR_SIZE_4K)
--
2.17.2