Remove the test_gets_num_clients test from the C unit tests

This test was causing problems by using dummy pointers to simulate
connections.  When calling the cleanup code, these pointers were
thought to be real, and the code attemtped to clean up threads
referenced by those pointers, causing a segfault.

I've reimplemented the test in the ruby acceptance suite.
This commit is contained in:
Patrick J Cherry
2018-02-16 13:46:31 +00:00
parent 1407407ff4
commit 27a94a807e
2 changed files with 10 additions and 26 deletions

View File

@@ -209,12 +209,15 @@ class TestServeMode < Test::Unit::TestCase
end
def test_status_returns_correct_client_count
require 'pp'
connect_to_server do |client|
status = @env.status1
assert_equal('1', status['num_clients'])
end
status = @env.status1
assert_equal('0', status['num_clients'])
@env.writefile1('0')
@env.serve1
assert_equal('0', @env.status1['num_clients'])
client = FlexNBD::FakeSource.new(@env.ip, @env.port1, 'Connecting to server failed')
assert_equal('1', @env.status1['num_clients'])
client2 = FlexNBD::FakeSource.new(@env.ip, @env.port1, 'Connecting to server failed')
assert_equal('2', @env.status1['num_clients'])
client2.close
client.close
assert_equal('0', @env.status1['num_clients'])
end
end