Tarantool development patches archive
 help / color / mirror / Atom feed
From: Roman Khabibov <roman.habibov@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Cc: Roman Khabibov <roman.habibov1@yandex.ru>,
	alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH] test: fix getaddrinfo test on Ubuntu 16.04
Date: Sat, 12 Dec 2020 08:51:55 +0500	[thread overview]
Message-ID: <20201212035155.80282-1-roman.habibov@tarantool.org> (raw)

From: Roman Khabibov <roman.habibov1@yandex.ru>

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)

             reply	other threads:[~2020-12-12  3:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12  3:51 Roman Khabibov [this message]
2021-03-15 17:48 ` Alexander Turenko via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201212035155.80282-1-roman.habibov@tarantool.org \
    --to=roman.habibov@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=roman.habibov1@yandex.ru \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] test: fix getaddrinfo test on Ubuntu 16.04' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox