[Tarantool-patches] [PATCH] test: fix getaddrinfo test on Ubuntu 16.04

Roman Khabibov roman.habibov at tarantool.org
Sat Dec 12 06:51:55 MSK 2020


From: Roman Khabibov <roman.habibov1 at 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)



More information about the Tarantool-patches mailing list