Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] test: fix fio test when run by the root user
@ 2019-05-29  1:21 Alexander Turenko
  2019-05-29 12:39 ` Vladimir Davydov
  2019-05-29 14:19 ` [tarantool-patches] " Kirill Yukhin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Turenko @ 2019-05-29  1:21 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Alexander Turenko, tarantool-patches

We run testing in Travis-CI using docker, which by default enters into a
shell session as root.

This is follow up for e9c96a4c1afe28dac8beb9eed2d092e05b956366 ('fio:
fix mktree error reporting').
---

https://github.com/tarantool/tarantool/pull/4044
https://github.com/tarantool/tarantool/tree/Totktonada/gh-4044-fix-fio-test
https://travis-ci.org/tarantool/tarantool/builds/538518022

 test/app/fio.result   | 18 ++++++++++++------
 test/app/fio.test.lua | 12 ++++++++----
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/test/app/fio.result b/test/app/fio.result
index 7be76656a..8819e39fa 100644
--- a/test/app/fio.result
+++ b/test/app/fio.result
@@ -709,6 +709,12 @@ fio.mktree(tree2, tonumber('0777', 8))
 - true
 ...
 -- check mktree error reporting
+--
+-- The test is skipped for the super user, because it has ability
+-- to perform any file access despite file permissions.
+uid = ffi.C.getuid()
+---
+...
 tmp3 = fio.pathjoin(tmpdir, '5')
 ---
 ...
@@ -726,11 +732,11 @@ tree123 = fio.pathjoin(tmp3, '1/2/3')
 st, err = fio.mktree(tree123)
 ---
 ...
-st
+uid == 0 or st == false
 ---
-- false
+- true
 ...
-err:match('Permission denied') ~= nil
+uid == 0 or err:match('Permission denied') ~= nil
 ---
 - true
 ...
@@ -740,11 +746,11 @@ tree4 = fio.pathjoin(tmp3, '4')
 st, err = fio.mktree(tree4)
 ---
 ...
-st
+uid == 0 or st == false
 ---
-- false
+- true
 ...
-err:match('Permission denied') ~= nil
+uid == 0 or err:match('Permission denied') ~= nil
 ---
 - true
 ...
diff --git a/test/app/fio.test.lua b/test/app/fio.test.lua
index a1db9e2f4..6c0d2f478 100644
--- a/test/app/fio.test.lua
+++ b/test/app/fio.test.lua
@@ -227,17 +227,21 @@ fio.stat(tmp2) ~= nil
 fio.mktree(tree2, tonumber('0777', 8))
 
 -- check mktree error reporting
+--
+-- The test is skipped for the super user, because it has ability
+-- to perform any file access despite file permissions.
+uid = ffi.C.getuid()
 tmp3 = fio.pathjoin(tmpdir, '5')
 fio.mkdir(tmp3)
 fio.chmod(tmp3, tonumber('500', 8))
 tree123 = fio.pathjoin(tmp3, '1/2/3')
 st, err = fio.mktree(tree123)
-st
-err:match('Permission denied') ~= nil
+uid == 0 or st == false
+uid == 0 or err:match('Permission denied') ~= nil
 tree4 = fio.pathjoin(tmp3, '4')
 st, err = fio.mktree(tree4)
-st
-err:match('Permission denied') ~= nil
+uid == 0 or st == false
+uid == 0 or err:match('Permission denied') ~= nil
 
 -- copy and copytree
 file1 = fio.pathjoin(tmp1, 'file.1')
-- 
2.21.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] test: fix fio test when run by the root user
  2019-05-29  1:21 [tarantool-patches] [PATCH] test: fix fio test when run by the root user Alexander Turenko
@ 2019-05-29 12:39 ` Vladimir Davydov
  2019-05-29 14:19 ` [tarantool-patches] " Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Davydov @ 2019-05-29 12:39 UTC (permalink / raw)
  To: Alexander Turenko; +Cc: Kirill Yukhin, tarantool-patches

Pushed to master.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tarantool-patches] Re: [PATCH] test: fix fio test when run by the root user
  2019-05-29  1:21 [tarantool-patches] [PATCH] test: fix fio test when run by the root user Alexander Turenko
  2019-05-29 12:39 ` Vladimir Davydov
@ 2019-05-29 14:19 ` Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill Yukhin @ 2019-05-29 14:19 UTC (permalink / raw)
  To: Alexander Turenko; +Cc: tarantool-patches

Hello,

On 29 May 04:21, Alexander Turenko wrote:
> We run testing in Travis-CI using docker, which by default enters into a
> shell session as root.
> 
> This is follow up for e9c96a4c1afe28dac8beb9eed2d092e05b956366 ('fio:
> fix mktree error reporting').

I've cherry-picked both commits into 1.10 and 2.1 branchs.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-29 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29  1:21 [tarantool-patches] [PATCH] test: fix fio test when run by the root user Alexander Turenko
2019-05-29 12:39 ` Vladimir Davydov
2019-05-29 14:19 ` [tarantool-patches] " Kirill Yukhin

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