This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
commit 05cc1e6c7208f405e04fab8e711612fcc4936c02
Author: Nir Soffer <nsoffer(a)redhat.com>
Date: Sun Feb 25 17:45:41 2018 +0200
Add tests/constants module
This module keeps constants copied from sanlock source, used by the
tests.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/constants.py | 9 +++++++++
tests/daemon_test.py | 3 ++-
tests/direct_test.py | 3 ++-
tests/python_test.py | 4 +++-
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/tests/constants.py b/tests/constants.py
new file mode 100644
index 0000000..70f4226
--- /dev/null
+++ b/tests/constants.py
@@ -0,0 +1,9 @@
+"""
+Constants copied from sanlock source.
+"""
+
+# src/leader.h
+
+PAXOS_DISK_MAGIC = 0x06152010
+PAXOS_DISK_CLEAR = 0x11282016
+DELTA_DISK_MAGIC = 0x12212010
diff --git a/tests/daemon_test.py b/tests/daemon_test.py
index 1e94563..9697658 100644
--- a/tests/daemon_test.py
+++ b/tests/daemon_test.py
@@ -9,6 +9,7 @@ import subprocess
import pytest
+from . import constants
from . import util
@@ -53,7 +54,7 @@ def test_init_lockspace(tmpdir, sanlock_daemon):
with io.open(str(path), "rb") as f:
magic, = struct.unpack("< I", f.read(4))
- assert magic == 0x12212010
+ assert magic == constants.DELTA_DISK_MAGIC
# TODO: check more stuff here...
diff --git a/tests/direct_test.py b/tests/direct_test.py
index fa7c572..eca118b 100644
--- a/tests/direct_test.py
+++ b/tests/direct_test.py
@@ -5,6 +5,7 @@ Test sanlock direct options.
import io
import struct
+from . import constants
from . import util
@@ -19,7 +20,7 @@ def test_init_lockspace(tmpdir):
with io.open(str(path), "rb") as f:
magic, = struct.unpack("< I", f.read(4))
- assert magic == 0x12212010
+ assert magic == constants.DELTA_DISK_MAGIC
# TODO: check more stuff here...
diff --git a/tests/python_test.py b/tests/python_test.py
index e455e11..9f1b9a0 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -7,6 +7,8 @@ import struct
import sanlock
+from . import constants
+
def test_write_lockspace(tmpdir, sanlock_daemon):
path = tmpdir.join("lockspace")
@@ -18,7 +20,7 @@ def test_write_lockspace(tmpdir, sanlock_daemon):
with io.open(str(path), "rb") as f:
magic, = struct.unpack("< I", f.read(4))
- assert magic == 0x12212010
+ assert magic == constants.DELTA_DISK_MAGIC
# TODO: check more stuff here...
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.