-libmemcached_test_container_st *world_create(test_return_t *error)
-{
- memset(&global_container, 0, sizeof(global_container));
- global_container.construct.count= SERVERS_TO_CREATE;
- global_container.construct.udp= 0;
- server_startup(&global_container.construct);
+ in_port_t max_port= TEST_PORT_BASE;
+ for (uint32_t x= 0; x < servers.count(); x++)
+ {
+ in_port_t port;
+
+ char variable_buffer[1024];
+ snprintf(variable_buffer, sizeof(variable_buffer), "LIBMEMCACHED_PORT_%u", x);
+
+ char *var;
+ if ((var= getenv(variable_buffer)))
+ {
+ port= in_port_t(atoi(var));
+ }
+ else
+ {
+ port= in_port_t(TEST_PORT_BASE +x);
+ }
+
+ max_port= port;
+ const char *argv[1]= { "memcached" };
+ if (servers.sasl())
+ {
+ if (not server_startup(servers, "memcached-sasl", port, 1, argv))
+ {
+ error= TEST_FATAL;
+ return NULL;
+ }
+ }
+ else
+ {
+ if (not server_startup(servers, "memcached", port, 1, argv))
+ {
+ error= TEST_FATAL;
+ return NULL;
+ }
+ }
+ }
+
+ if (servers.socket())
+ {
+ if (servers.sasl())
+ {
+ const char *argv[1]= { "memcached" };
+ if (not servers.start_socket_server("memcached-sasl", max_port +1, 1, argv))
+ {
+ error= TEST_FATAL;
+ return NULL;
+ }
+ }
+ else
+ {
+ const char *argv[1]= { "memcached" };
+ if (not servers.start_socket_server("memcached", max_port +1, 1, argv))
+ {
+ error= TEST_FATAL;
+ return NULL;
+ }
+ }
+ }
+