Memory erasure test fails on Debian sid
Originally created by @intrigeri on #9759 (Redmine)
I find many patterns in the guest's memory
always fails. I’ve debugged
it a bit, and looking at the memory dump the pattern is in there, but
still grep -c
always returns 1. Presumably some binary/text file
detection or line ending handling has changed. Adding --text
to the
grep
command-line fixes this problem for me:
--- a/features/step_definitions/erase_memory.rb
+++ b/features/step_definitions/erase_memory.rb
@@ -64,7 +64,7 @@ def pattern_coverage_in_guest_ram
FileUtils.touch(dump)
FileUtils.chmod(0666, dump)
@vm.domain.core_dump(dump)
- patterns = IO.popen(['grep', '-c', 'wipe_didnt_work', dump]).gets.to_i
+ patterns = IO.popen(['grep', '--text', '-c', 'wipe_didnt_work', dump]).gets.to_i
File.delete dump
# Pattern is 16 bytes long
patterns_b = patterns*16
(untested on Jessie)