Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@freelists.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: [PATCH v4 3/3] test: app/fio -- Add ERRINJ_COIO_SENDFILE_CHUNK
Date: Wed, 17 Apr 2019 00:40:34 +0300	[thread overview]
Message-ID: <20190416214034.GL13702@uranus.lan> (raw)
In-Reply-To: <20190416200858.19473-4-gorcunov@gmail.com>

To test sendfile work in a cycle -- force transferring 1 byte at once.
---
v4: These files are quite small so test with 1 byte chunk to force
    sendfile cycle.

 test/app/fio.result   | 23 +++++++++++++++++++++++
 test/app/fio.test.lua |  8 ++++++++
 2 files changed, 31 insertions(+)

diff --git a/test/app/fio.result b/test/app/fio.result
index 486cb8043..879e0a767 100644
--- a/test/app/fio.result
+++ b/test/app/fio.result
@@ -718,6 +718,9 @@ file2 = fio.pathjoin(tmp2, 'file.2')
 file3 = fio.pathjoin(tree, 'file.3')
 ---
 ...
+file4 = fio.pathjoin(tree, 'file.4')
+---
+...
 fh1 = fio.open(file1, { 'O_RDWR', 'O_TRUNC', 'O_CREAT' }, 0777)
 ---
 ...
@@ -752,6 +755,26 @@ fio.stat(fio.pathjoin(tmp2, "file.1")) ~= nil
 ---
 - true
 ...
+--- test copyfile to operate with one byte transfer
+errinj = box.error.injection
+---
+...
+errinj.set('ERRINJ_COIO_SENDFILE_CHUNK', 1)
+---
+- ok
+...
+fio.copyfile(file1, file4)
+---
+- true
+...
+fio.stat(file1, file4) ~= nil
+---
+- true
+...
+errinj.set('ERRINJ_COIO_SENDFILE_CHUNK', -1)
+---
+- ok
+...
 res, err = fio.copyfile(fio.pathjoin(tmp1, 'not_exists.txt'), tmp1)
 ---
 ...
diff --git a/test/app/fio.test.lua b/test/app/fio.test.lua
index 9af37044d..1255b2804 100644
--- a/test/app/fio.test.lua
+++ b/test/app/fio.test.lua
@@ -230,6 +230,7 @@ fio.mktree(tree2, 0777)
 file1 = fio.pathjoin(tmp1, 'file.1')
 file2 = fio.pathjoin(tmp2, 'file.2')
 file3 = fio.pathjoin(tree, 'file.3')
+file4 = fio.pathjoin(tree, 'file.4')
 
 fh1 = fio.open(file1, { 'O_RDWR', 'O_TRUNC', 'O_CREAT' }, 0777)
 fh1:write("gogo")
@@ -241,6 +242,13 @@ fio.symlink(file1, file3)
 fio.copyfile(file1, tmp2)
 fio.stat(fio.pathjoin(tmp2, "file.1")) ~= nil
 
+--- test copyfile to operate with one byte transfer
+errinj = box.error.injection
+errinj.set('ERRINJ_COIO_SENDFILE_CHUNK', 1)
+fio.copyfile(file1, file4)
+fio.stat(file1, file4) ~= nil
+errinj.set('ERRINJ_COIO_SENDFILE_CHUNK', -1)
+
 res, err = fio.copyfile(fio.pathjoin(tmp1, 'not_exists.txt'), tmp1)
 res
 err:match("failed to copy") ~= nil
-- 
2.20.1

      reply	other threads:[~2019-04-16 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 20:08 [PATCH v3 0/3] core/coio_file: Use eio_sendfile_sync for file copying Cyrill Gorcunov
2019-04-16 20:08 ` [PATCH 1/3] core/coio_file: Use eio_sendfile_sync instead of a chunk mode Cyrill Gorcunov
2019-04-18 18:41   ` Vladimir Davydov
2019-04-18 18:50     ` Cyrill Gorcunov
2019-04-16 20:08 ` [PATCH 2/3] core/coio_file: Add ERRINJ_COIO_SENDFILE_CHUNK error injection Cyrill Gorcunov
2019-04-16 20:08 ` [PATCH 3/3] test: app/fio -- Add ERRINJ_COIO_SENDFILE_CHUNK Cyrill Gorcunov
2019-04-16 21:40   ` Cyrill Gorcunov [this message]

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=20190416214034.GL13702@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v4 3/3] test: app/fio -- Add ERRINJ_COIO_SENDFILE_CHUNK' \
    /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