1544448333.v9-1-g9c550e0.relax-content-tests-in-test-suite.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Subject: Relax content tests in test suite
  2. Origin: v9-1-g9c550e0 <https://github.com/latchset/luksmeta/commit/v9-1-g9c550e0>
  3. Upstream-Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  4. Date: Mon Dec 10 14:25:33 2018 +0100
  5. Starting with version 2.0.5, cryptsetup wipes the full LUKS header
  6. and fills unused sections with random data, this was introduced
  7. in commit
  8. commit c2bce3e93ecee41f661b589ee28f112eb538259e
  9. Author: Milan Broz <gmazyland@gmail.com>
  10. Date: Sun Oct 14 13:11:50 2018 +0200
  11. Wipe full header areas (including unused) during LUKS format.
  12. While this is the right thing to do, it breaks luksmeta tests. So
  13. relax them.
  14. Bug-Debian: https://bugs.debian.org/915256
  15. Resolves: https://github.com/latchset/luksmeta/issues/6
  16. --- a/test-lm-assumptions.c
  17. +++ b/test-lm-assumptions.c
  18. @@ -28,7 +28,8 @@
  19. /* Test the layout state. */
  20. assert(test_layout((range_t[]) {
  21. { 0, 1024 }, /* LUKS header */
  22. - END(1024), /* Rest of the file */
  23. + { 1024, 3072, true }, /* Keyslot Area */
  24. + { 0, 0 },
  25. }));
  26. unlink(filename);
  27. --- a/test-lm-big.c
  28. +++ b/test-lm-big.c
  29. @@ -111,7 +111,7 @@
  30. assert(test_layout((range_t[]) {
  31. { 0, 1024 }, /* LUKS header */
  32. - { 1024, offset - 1024, true }, /* Keyslot Area */
  33. + { 1024, 3072, true }, /* Keyslot Area */
  34. { offset, 4096 }, /* luksmeta header */
  35. { offset + 4096, 4096 }, /* luksmeta slot 0 */
  36. { offset + 8192, 4096 }, /* luksmeta slot 0 (cont) */
  37. @@ -127,7 +127,7 @@
  38. assert(test_layout((range_t[]) {
  39. { 0, 1024 }, /* LUKS header */
  40. - { 1024, offset - 1024, true }, /* Keyslot Area */
  41. + { 1024, 3072, true }, /* Keyslot Area */
  42. { offset, 4096 }, /* luksmeta header */
  43. END(offset + 4096), /* Rest of the file */
  44. }));
  45. --- a/test-lm-init.c
  46. +++ b/test-lm-init.c
  47. @@ -57,7 +57,7 @@
  48. /* Test the layout state. */
  49. assert(test_layout((range_t[]) {
  50. { 0, 1024 }, /* LUKS header */
  51. - { 1024, offset - 1024, true }, /* Keyslot Area */
  52. + { 1024, 3072, true }, /* Keyslot Area */
  53. { offset, 4096 }, /* luksmeta header */
  54. END(offset + 4096), /* Rest of the file */
  55. }));
  56. @@ -106,7 +106,7 @@
  57. assert(luksmeta_test(cd) == -ENOENT);
  58. assert(test_layout((range_t[]) {
  59. { 0, 1024 }, /* LUKS header */
  60. - { 1024, offset - 1024, true }, /* Keyslot Area */
  61. + { 1024, 3072, true }, /* Keyslot Area */
  62. END(offset), /* Rest of the file */
  63. }));
  64. --- a/test-lm-one.c
  65. +++ b/test-lm-one.c
  66. @@ -49,7 +49,7 @@
  67. /* Test the layout state. */
  68. assert(test_layout((range_t[]) {
  69. { 0, 1024 }, /* LUKS header */
  70. - { 1024, offset - 1024, true }, /* Keyslot Area */
  71. + { 1024, 3072, true }, /* Keyslot Area */
  72. { offset, 4096 }, /* luksmeta header */
  73. { offset + 4096, 4096 }, /* luksmeta slot 0 */
  74. END(offset + 8192), /* Rest of the file */
  75. @@ -68,7 +68,7 @@
  76. /* Test the layout state. */
  77. assert(test_layout((range_t[]) {
  78. { 0, 1024 }, /* LUKS header */
  79. - { 1024, offset - 1024, true }, /* Keyslot Area */
  80. + { 1024, 3072, true }, /* Keyslot Area */
  81. { offset, 4096 }, /* luksmeta header */
  82. END(offset + 4096), /* Rest of the file */
  83. }));
  84. --- a/test-lm-two.c
  85. +++ b/test-lm-two.c
  86. @@ -53,7 +53,7 @@
  87. assert(test_layout((range_t[]) {
  88. { 0, 1024 }, /* LUKS header */
  89. - { 1024, offset - 1024, true }, /* Keyslot Area */
  90. + { 1024, 3072, true }, /* Keyslot Area */
  91. { offset, 4096 }, /* luksmeta header */
  92. { offset + 4096, 4096 }, /* luksmeta slot 0 */
  93. END(offset + 8192), /* Rest of the file */
  94. @@ -70,7 +70,7 @@
  95. assert(test_layout((range_t[]) {
  96. { 0, 1024 }, /* LUKS header */
  97. - { 1024, offset - 1024, true }, /* Keyslot Area */
  98. + { 1024, 3072, true }, /* Keyslot Area */
  99. { offset, 4096 }, /* luksmeta header */
  100. { offset + 4096, 4096 }, /* luksmeta slot 0 */
  101. { offset + 8192, 4096 }, /* luksmeta slot 1 */
  102. @@ -88,7 +88,7 @@
  103. assert(luksmeta_wipe(cd, 0, UUID0) == 0);
  104. assert(test_layout((range_t[]) {
  105. { 0, 1024 }, /* LUKS header */
  106. - { 1024, offset - 1024, true }, /* Keyslot Area */
  107. + { 1024, 3072, true }, /* Keyslot Area */
  108. { offset, 4096 }, /* luksmeta header */
  109. { offset + 4096, 4096, true }, /* luksmeta slot 0 */
  110. { offset + 8192, 4096 }, /* luksmeta slot 1 */
  111. @@ -99,7 +99,7 @@
  112. assert(luksmeta_wipe(cd, 1, UUID1) == 0);
  113. assert(test_layout((range_t[]) {
  114. { 0, 1024 }, /* LUKS header */
  115. - { 1024, offset - 1024, true }, /* Keyslot Area */
  116. + { 1024, 3072, true }, /* Keyslot Area */
  117. { offset, 4096 }, /* luksmeta header */
  118. END(offset + 4096), /* Rest of the file */
  119. }));