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