summarylogtreecommitdiffstats
path: root/Relax-content-tests-in-test-suite.patch
blob: a1e4510368885a0bd8ab866f50f490bb1d2abf3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
From 334430e562a196bc1f0bad051103ca5dca31c266 Mon Sep 17 00:00:00 2001
From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Date: Sun, 9 Dec 2018 22:31:22 +0000
Subject: [PATCH] Relax content tests in test suite

Starting with version 2.0.5, cryptset wipes the full LUKS header
and fills unused sections with random data, this was introduced
in commit

commit c2bce3e93ecee41f661b589ee28f112eb538259e
Author: Milan Broz <gmazyland@gmail.com>
Date:   Sun Oct 14 13:11:50 2018 +0200

    Wipe full header areas (including unused) during LUKS format.

While this is the right thing to do, it breaks luksmeta tests. So
relax them.
---
 test-lm-assumptions.c | 3 ++-
 test-lm-big.c         | 4 ++--
 test-lm-init.c        | 4 ++--
 test-lm-one.c         | 4 ++--
 test-lm-two.c         | 8 ++++----
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/test-lm-assumptions.c b/test-lm-assumptions.c
index d9ff20b..b4f293f 100644
--- a/test-lm-assumptions.c
+++ b/test-lm-assumptions.c
@@ -28,7 +28,8 @@ main(int argc, char *argv[])
     /* Test the layout state. */
     assert(test_layout((range_t[]) {
         { 0, 1024 },                    /* LUKS header */
-        END(1024),                    /* Rest of the file */
+        { 1024, 3072, true },           /* Keyslot Area */
+        { 0, 0 },
     }));
 
     unlink(filename);
diff --git a/test-lm-big.c b/test-lm-big.c
index 6098e59..eb94d3b 100644
--- a/test-lm-big.c
+++ b/test-lm-big.c
@@ -111,7 +111,7 @@ main(int argc, char *argv[])
 
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         { offset + 4096, 4096 },       /* luksmeta slot 0 */
         { offset + 8192, 4096 },       /* luksmeta slot 0 (cont) */
@@ -127,7 +127,7 @@ main(int argc, char *argv[])
 
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         END(offset + 4096),            /* Rest of the file */
     }));
diff --git a/test-lm-init.c b/test-lm-init.c
index 2a6cb45..b16d597 100644
--- a/test-lm-init.c
+++ b/test-lm-init.c
@@ -57,7 +57,7 @@ main(int argc, char *argv[])
     /* Test the layout state. */
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         END(offset + 4096),            /* Rest of the file */
     }));
@@ -106,7 +106,7 @@ main(int argc, char *argv[])
     assert(luksmeta_test(cd) == -ENOENT);
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         END(offset),                   /* Rest of the file */
     }));
 
diff --git a/test-lm-one.c b/test-lm-one.c
index 8deb70a..18613e0 100644
--- a/test-lm-one.c
+++ b/test-lm-one.c
@@ -49,7 +49,7 @@ main(int argc, char *argv[])
     /* Test the layout state. */
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         { offset + 4096, 4096 },       /* luksmeta slot 0 */
         END(offset + 8192),            /* Rest of the file */
@@ -68,7 +68,7 @@ main(int argc, char *argv[])
     /* Test the layout state. */
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         END(offset + 4096),            /* Rest of the file */
     }));
diff --git a/test-lm-two.c b/test-lm-two.c
index 78fea5b..9f0b1c5 100644
--- a/test-lm-two.c
+++ b/test-lm-two.c
@@ -53,7 +53,7 @@ main(int argc, char *argv[])
 
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         { offset + 4096, 4096 },       /* luksmeta slot 0 */
         END(offset + 8192),            /* Rest of the file */
@@ -70,7 +70,7 @@ main(int argc, char *argv[])
 
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         { offset + 4096, 4096 },       /* luksmeta slot 0 */
         { offset + 8192, 4096 },       /* luksmeta slot 1 */
@@ -88,7 +88,7 @@ main(int argc, char *argv[])
     assert(luksmeta_wipe(cd, 0, UUID0) == 0);
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         { offset + 4096, 4096, true }, /* luksmeta slot 0 */
         { offset + 8192, 4096 },       /* luksmeta slot 1 */
@@ -99,7 +99,7 @@ main(int argc, char *argv[])
     assert(luksmeta_wipe(cd, 1, UUID1) == 0);
     assert(test_layout((range_t[]) {
         { 0, 1024 },                   /* LUKS header */
-        { 1024, offset - 1024, true }, /* Keyslot Area */
+        { 1024, 3072, true },          /* Keyslot Area */
         { offset, 4096 },              /* luksmeta header */
         END(offset + 4096),            /* Rest of the file */
     }));
-- 
2.19.2