tests: Make test-two-servers work

This test runs 2 spice server in one program.
Use two different tcp port to be able to connect to both servers.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-09-03 19:20:02 +01:00
parent 8f872043b3
commit e595b18282
3 changed files with 8 additions and 3 deletions

View File

@ -900,9 +900,8 @@ void test_set_command_list(Test *test, Command *commands, int num_commands)
}
Test *test_new(SpiceCoreInterface *core)
Test* test_new_with_port(SpiceCoreInterface* core, int port)
{
int port = 5912;
Test *test = spice_new0(Test, 1);
SpiceServer* server = spice_server_new();
@ -926,6 +925,11 @@ Test *test_new(SpiceCoreInterface *core)
return test;
}
Test *test_new(SpiceCoreInterface *core)
{
return test_new_with_port(core, 5912);
}
void test_destroy(Test *test)
{
spice_server_destroy(test->server);

View File

@ -134,6 +134,7 @@ void test_set_simple_command_list(Test *test, const int *command, int num_comman
void test_set_command_list(Test *test, Command *command, int num_commands);
void test_add_display_interface(Test *test);
void test_add_agent_interface(SpiceServer *server); // TODO - Test *test
Test* test_new_with_port(SpiceCoreInterface* core, int port);
Test* test_new(SpiceCoreInterface* core);
void test_destroy(Test *test);

View File

@ -42,7 +42,7 @@ int main(void)
core = basic_event_loop_init();
t1 = test_new(core);
t2 = test_new(core);
t2 = test_new_with_port(core, 5913);
//spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESSION_OFF);
test_add_display_interface(t1);
test_add_display_interface(t2);