Files
flexnbd-c/tests/acceptance/fakes/source/sigterm_after_hello.rb

21 lines
400 B
Ruby
Raw Normal View History

#!/usr/bin/env ruby
# Connect to the listener, wait for the hello, then sigterm the
# listener. We expect the listener to exit with a status of 6, which
# is enforced in the test.
require 'flexnbd/fake_source'
include FlexNBD
addr, port, pid = *ARGV
2018-02-02 21:34:14 +00:00
client = FakeSource.new(addr, port, 'Timed out connecting.')
client.read_hello
2018-02-02 21:34:14 +00:00
Process.kill('TERM', pid.to_i)
sleep(0.2)
client.close
exit(0)