Files
flexnbd-c/tests/acceptance/fakes/dest/sigterm_after_hello.rb
Patrick J Cherry 9c48da82cc Rubocop
2018-02-02 21:34:14 +00:00

20 lines
429 B
Ruby
Executable File

#!/usr/bin/env ruby
# Wait for a sender connection, send a correct hello, then sigterm the
# sender. We expect the sender to exit with status of 6, which is
# enforced in the test.
require 'flexnbd/fake_dest'
include FlexNBD
addr, port, pid = *ARGV
server = FakeDest.new(addr, port)
client = server.accept('Timed out waiting for a connection')
client.write_hello
Process.kill(15, pid.to_i)
client.close
server.close
exit 0