From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C3AB845C304 for ; Sat, 12 Dec 2020 06:51:56 +0300 (MSK) From: Roman Khabibov Date: Sat, 12 Dec 2020 08:51:55 +0500 Message-Id: <20201212035155.80282-1-roman.habibov@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] test: fix getaddrinfo test on Ubuntu 16.04 List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: Roman Khabibov , alexander.turenko@tarantool.org From: Roman Khabibov Just add another one error code and error message that can be returned by getaddrinfo() tests. Folow up #4138 --- Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-4138-getaddr-follow-up test/app/gh-4138-getaddrinfo-errors.result | 4 +++- test/app/gh-4138-getaddrinfo-errors.test.lua | 4 +++- test/box/net.box_getaddrinfo_errors_gh-4138.result | 4 +++- test/box/net.box_getaddrinfo_errors_gh-4138.test.lua | 4 +++- test/unit/coio.cc | 6 +++++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/test/app/gh-4138-getaddrinfo-errors.result b/test/app/gh-4138-getaddrinfo-errors.result index d301e3776..62b0721df 100644 --- a/test/app/gh-4138-getaddrinfo-errors.result +++ b/test/app/gh-4138-getaddrinfo-errors.result @@ -28,7 +28,9 @@ function check_err(err) -- EAI_AGAIN err == 'getaddrinfo: Temporary failure in name resolution' or -- EAI_AGAIN - err == 'getaddrinfo: Name could not be resolved at this time' then + err == 'getaddrinfo: Name could not be resolved at this time' or +-- EAI_NONAME + err == 'getaddrinfo: No address associated with hostname' then return true end return false diff --git a/test/app/gh-4138-getaddrinfo-errors.test.lua b/test/app/gh-4138-getaddrinfo-errors.test.lua index c8bb52939..a9ee2ee00 100644 --- a/test/app/gh-4138-getaddrinfo-errors.test.lua +++ b/test/app/gh-4138-getaddrinfo-errors.test.lua @@ -18,7 +18,9 @@ function check_err(err) -- EAI_AGAIN err == 'getaddrinfo: Temporary failure in name resolution' or -- EAI_AGAIN - err == 'getaddrinfo: Name could not be resolved at this time' then + err == 'getaddrinfo: Name could not be resolved at this time' or +-- EAI_NONAME + err == 'getaddrinfo: No address associated with hostname' then return true end return false diff --git a/test/box/net.box_getaddrinfo_errors_gh-4138.result b/test/box/net.box_getaddrinfo_errors_gh-4138.result index 08bf6a9eb..bb35cb0bc 100644 --- a/test/box/net.box_getaddrinfo_errors_gh-4138.result +++ b/test/box/net.box_getaddrinfo_errors_gh-4138.result @@ -28,7 +28,9 @@ function check_err(err) -- EAI_AGAIN err == 'getaddrinfo: Temporary failure in name resolution' or -- EAI_AGAIN - err == 'getaddrinfo: Name could not be resolved at this time' then + err == 'getaddrinfo: Name could not be resolved at this time' or +-- EAI_NONAME + err == 'getaddrinfo: No address associated with hostname' then return true end return false diff --git a/test/box/net.box_getaddrinfo_errors_gh-4138.test.lua b/test/box/net.box_getaddrinfo_errors_gh-4138.test.lua index 4eeddcdbd..92d150c23 100755 --- a/test/box/net.box_getaddrinfo_errors_gh-4138.test.lua +++ b/test/box/net.box_getaddrinfo_errors_gh-4138.test.lua @@ -18,7 +18,9 @@ function check_err(err) -- EAI_AGAIN err == 'getaddrinfo: Temporary failure in name resolution' or -- EAI_AGAIN - err == 'getaddrinfo: Name could not be resolved at this time' then + err == 'getaddrinfo: Name could not be resolved at this time' or +-- EAI_NONAME + err == 'getaddrinfo: No address associated with hostname' then return true end return false diff --git a/test/unit/coio.cc b/test/unit/coio.cc index 69f78829c..01a708358 100644 --- a/test/unit/coio.cc +++ b/test/unit/coio.cc @@ -106,12 +106,16 @@ test_getaddrinfo(void) /* EAI_AGAIN */ const char *exp_errmsg_6 = "getaddrinfo: Name could not be resolved at " "this time"; + /* EAI_NONAME */ + const char *exp_errmsg_7 = "getaddrinfo: No address associated with " + "hostname"; bool is_match_with_exp = strcmp(errmsg, exp_errmsg_1) == 0 || strcmp(errmsg, exp_errmsg_2) == 0 || strcmp(errmsg, exp_errmsg_3) == 0 || strcmp(errmsg, exp_errmsg_4) == 0 || strcmp(errmsg, exp_errmsg_5) == 0 || - strcmp(errmsg, exp_errmsg_6) == 0; + strcmp(errmsg, exp_errmsg_6) == 0 || + strcmp(errmsg, exp_errmsg_7) == 0; is(is_match_with_exp, true, "getaddrinfo error message"); /* -- 2.24.3 (Apple Git-128)