fix.relax-content-checks.patch 5.2 KB

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