Commit 4e254644 authored by johan's avatar johan
Browse files

Lime multidomain test

parent ed966ba2
......@@ -18,6 +18,7 @@
*/
#include "liblinphone_tester.h"
static const int x3dhServer_creationTimeout = 5000;
static void simple_call(void) {
simple_call_base_with_rcs("claire_sips_rc", "pauline_sips_rc", FALSE, FALSE, FALSE);
......@@ -88,9 +89,80 @@ end:
linphone_core_manager_destroy(claire);
}
static void encrypted_message(void) {
LinphoneCoreManager *claire = linphone_core_manager_create("claire_sips_rc");
LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_sips_rc");
bctbx_list_t *coresManagerList = NULL;
bctbx_list_t *participantsAddresses = NULL;
coresManagerList = bctbx_list_append(coresManagerList, claire);
coresManagerList = bctbx_list_append(coresManagerList, pauline);
LinphoneChatRoom *claireEncryptedCr = NULL;
LinphoneChatRoom *paulineEncryptedCr = NULL;
stats initialClaireStats = claire->stat;
stats initialPaulineStats = pauline->stat;
linphone_config_set_string(linphone_core_get_config(claire->lc),"lime","curve","c25519");
linphone_core_set_lime_x3dh_server_url(claire->lc, lime_server_external_url);
linphone_config_set_string(linphone_core_get_config(pauline->lc),"lime","curve","c25519");
linphone_core_set_lime_x3dh_server_url(pauline->lc, lime_server_c25519_tlsauth_opt_url);
bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
start_core_for_conference(coresManagerList);
// Wait for lime users to be created on X3DH server
BC_ASSERT_TRUE(wait_for_list(coresList, &claire->stat.number_of_X3dhUserCreationSuccess, initialClaireStats.number_of_X3dhUserCreationSuccess+1, x3dhServer_creationTimeout));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_X3dhUserCreationSuccess, initialPaulineStats.number_of_X3dhUserCreationSuccess+1, x3dhServer_creationTimeout));
// Check encryption status for both participants
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(claire->lc));
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(pauline->lc));
// Pauline creates an encrypted chatroom
const char *initialSubject = "Encrypted Friends";
participantsAddresses = bctbx_list_append(NULL, linphone_address_new(linphone_core_get_identity(claire->lc)));
paulineEncryptedCr = create_chat_room_client_side(coresList, pauline, &initialPaulineStats, participantsAddresses, initialSubject, TRUE);
//LinphoneAddress *encryptedConfAddr = linphone_address_clone(linphone_chat_room_get_conference_address(paulineEncryptedCr));
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineEncryptedCr) & LinphoneChatRoomCapabilitiesOneToOne);
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineEncryptedCr) & LinphoneChatRoomCapabilitiesEncrypted);
/* TODO: multidomain conference is not operational yet...
// Check that the chat room is correctly created on Pauline's side and that the participants are added
claireEncryptedCr = check_creation_chat_room_client_side(coresList, claire, &initialClaireStats, encryptedConfAddr, initialSubject, 1, 0);
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(claireEncryptedCr) & LinphoneChatRoomCapabilitiesOneToOne);
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(claireEncryptedCr) & LinphoneChatRoomCapabilitiesEncrypted);
// Pauline sends an encrypted message
const char *paulineMessage = "We can say whatever we want in this chatrooom!";
LinphoneChatMessage *msg = _send_message(paulineEncryptedCr, paulineMessage);
BC_ASSERT_TRUE(wait_for_list(coresList, &claire->stat.number_of_LinphoneMessageReceived, initialClaireStats.number_of_LinphoneMessageReceived + 1, 10000));
linphone_chat_message_unref(msg);
LinphoneChatMessage *claireLastMsg = claire->stat.last_received_chat_message;
if (!BC_ASSERT_PTR_NOT_NULL(claireLastMsg))
goto end;
// Check that the message is received and decrypted by Pauline
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(claireLastMsg), paulineMessage);
LinphoneAddress *paulineAddr = linphone_address_new(linphone_core_get_identity(pauline->lc));
BC_ASSERT_TRUE(linphone_address_weak_equal(paulineAddr, linphone_chat_message_get_from_address(claireLastMsg)));
linphone_address_unref(paulineAddr);
*/
//end:
// Clean db from chat room
if (claireEncryptedCr) linphone_core_manager_delete_chat_room(claire, claireEncryptedCr, coresList);
if (paulineEncryptedCr) linphone_core_manager_delete_chat_room(pauline, paulineEncryptedCr, coresList);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(claire);
linphone_core_manager_destroy(pauline);
}
test_t external_domain_tests[] = {
TEST_NO_TAG("Simple call", simple_call),
TEST_NO_TAG("Chatroom with external domain participant", group_chat_external_domain_participant)
TEST_NO_TAG("Chatroom with external domain participant", group_chat_external_domain_participant),
TEST_NO_TAG("Encrypted Message", encrypted_message)
};
test_suite_t external_domain_test_suite = {"External domain", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
......
......@@ -160,6 +160,11 @@ extern const char* lime_server_c25519_url;
extern const char* lime_server_c448_url;
extern const char* lime_server_any_domain_c25519_url;
extern const char* lime_server_any_domain_c448_url;
extern const char* lime_server_c25519_tlsauth_opt_url;
extern const char* lime_server_c448_tlsauth_opt_url;
extern const char* lime_server_c25519_tlsauth_req_url;
extern const char* lime_server_c448_tlsauth_req_url;
extern const char* lime_server_external_url;
extern bool_t liblinphone_tester_keep_uuid;
extern bool_t liblinphone_tester_tls_support_disabled;
extern const MSAudioDiffParams audio_cmp_params;
......
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org lime.wildcard1.linphone.org http-proxy.example.org stun.example.org external.example.org sip1.example.org transfer.example.org sip.external-domain.org
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org lime.wildcard1.linphone.org http-proxy.example.org stun.example.org external.example.org sip1.example.org transfer.example.org sip.external-domain.org lime.external-domain.org
::1 lime.wildcard1.linphone.org sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org external.example.org sip1.example.org transfer.example.org sip.external-domain.org
::1 lime.wildcard1.linphone.org sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org external.example.org sip1.example.org transfer.example.org sip.external-domain.org lime.external-domain.org
188.165.46.90 tunnel.wildcard2.linphone.org
......
......@@ -73,6 +73,8 @@ const char *lime_server_c448_tlsauth_req_url="https://lime.wildcard1.linphone.or
// These lime server authenticate user using optionnal TLS auth, falling back on digest auth if client did not provide a client certificate
const char *lime_server_c25519_tlsauth_opt_url="https://lime.wildcard1.linphone.org:8544/lime-server-c25519/lime-server.php";
const char *lime_server_c448_tlsauth_opt_url="https://lime.wildcard1.linphone.org:8544/lime-server-c448/lime-server.php";
// Lime server using TLS and digest auth on external-domain
const char *lime_server_external_url="https://lime.external-domain.org:8643/lime-server/lime-server.php";
bool_t liblinphonetester_ipv6 = TRUE;
bool_t liblinphonetester_show_account_manager_logs = FALSE;
bool_t liblinphonetester_no_account_creator = FALSE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment