Run the nbd_scenario tests under valgrind
This commit is contained in:
@@ -16,11 +16,12 @@ class FlexNBD
|
||||
def serve(ip, port, file, *acl)
|
||||
File.unlink(ctrl) if File.exists?(ctrl)
|
||||
@pid = fork do
|
||||
cmd ="#{@bin} serve "\
|
||||
cmd ="valgrind #{@bin} serve "\
|
||||
"--addr #{ip} "\
|
||||
"--port #{port} "\
|
||||
"--file #{file} "\
|
||||
"--sock #{ctrl} "\
|
||||
"--debug "\
|
||||
"#{acl.join(' ')}"
|
||||
exec(cmd)
|
||||
end
|
||||
@@ -33,10 +34,11 @@ class FlexNBD
|
||||
end
|
||||
|
||||
def read(offset, length)
|
||||
IO.popen("#{@bin} read "\
|
||||
IO.popen("valgrind #{@bin} read "\
|
||||
"--addr #{ip} "\
|
||||
"--port #{port} "\
|
||||
"--from #{offset} "\
|
||||
"--debug "\
|
||||
"--size #{length}","r") do |fh|
|
||||
return fh.read
|
||||
end
|
||||
@@ -44,10 +46,11 @@ class FlexNBD
|
||||
end
|
||||
|
||||
def write(offset, data)
|
||||
IO.popen("#{@bin} write "\
|
||||
IO.popen("valgrind #{@bin} write "\
|
||||
"--addr #{ip} "\
|
||||
"--port #{port} "\
|
||||
"--from #{offset} "\
|
||||
"--debug "\
|
||||
"--size #{data.length}","w") do |fh|
|
||||
fh.write(data)
|
||||
end
|
||||
|
Reference in New Issue
Block a user