Skip to content

Commit d1891c5

Browse files
committed
Bugfix: Heisenbug when parsing console output in entropy check
Resolves #1007. The login prompt generated by the serial getty service could mess up the output and throw off our primitive parser. Thanks @garloff for the crucial tip! Signed-off-by: Matthias Büchse <[email protected]>
1 parent 18e4447 commit d1891c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/iaas/scs_0101_entropy/entropy_check.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232

3333
TIMEOUT = 5 * 60 # timeout in seconds after which we no longer wait for the VM to complete the run
3434
MARKER = '_scs-test-'
35+
# NOTE we mask [email protected] because the login prompt messes up the console output that we want to parse
3536
SERVER_USERDATA_GENERIC = """
3637
#cloud-config
3738
# apt-placeholder
3839
packages:
3940
- rng-tools5
41+
bootcmd:
42+
- systemctl mask [email protected]
4043
runcmd:
4144
- echo '_scs-test-entropy-avail'; cat /proc/sys/kernel/random/entropy_avail
4245
- echo '_scs-test-fips-test'; cat /dev/random | rngtest -c 1000
@@ -337,6 +340,8 @@ def compute_canonical_image(all_images):
337340
def _convert_to_collected(lines, marker=MARKER):
338341
# parse lines from console output
339342
# removing any "indent", stuff that looks like '[ 70.439502] cloud-init[513]: '
343+
# NOTE this logic can fail when something (such as a login prompt) messes up the console output
344+
# therefore we disable the corresponding service (see cloud-init)
340345
section = None
341346
indent = 0
342347
collected = {}

0 commit comments

Comments
 (0)