diff --git a/test/box/errinj.result b/test/box/errinj.result index 0bafadddd70b33f81466099f73d7c3667526fba9..9fe76826c1891094109f85be78542c9526653a5d 100644 --- a/test/box/errinj.result +++ b/test/box/errinj.result @@ -1,6 +1,9 @@ errinj = box.error.injection --- ... +net_box = require('net.box') +--- +... space = box.schema.space.create('tweedledum') --- ... @@ -397,9 +400,45 @@ errinj.set("ERRINJ_TUPLE_ALLOC", false) --- - ok ... +-- gh-881 iproto request with wal IO error +box.schema.user.grant('guest', 'read,write,execute', 'universe') +--- +... +test = box.schema.create_space('test') +--- +... +_ = test:create_index('primary') +--- +... +for i=1, box.cfg.rows_per_wal do test:insert{i, 'test'} end +--- +... +c = net_box:new(box.cfg.listen) +--- +... +-- try to write xlog without permission to write to disk +errinj.set('ERRINJ_WAL_WRITE', true) +--- +- ok +... +c.space.test:insert({box.cfg.rows_per_wal + 1,1,2,3}) +--- +- error: Failed to write to disk +... +errinj.set('ERRINJ_WAL_WRITE', false) +--- +- ok +... +-- Cleanup s:drop() --- ... +test:drop() +--- +... errinj = nil --- ... +box.schema.user.revoke('guest', 'read,write,execute', 'universe') +--- +... diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua index 711ffdd1f752277084e6e254a9bfee4da1a8ec9b..1a61e01ee2d3a9c09f9935a18db191a08e09e872 100644 --- a/test/box/errinj.test.lua +++ b/test/box/errinj.test.lua @@ -1,4 +1,5 @@ errinj = box.error.injection +net_box = require('net.box') space = box.schema.space.create('tweedledum') index = space:create_index('primary', { type = 'hash' }) @@ -128,7 +129,21 @@ s:select{}; --# setopt delimiter '' errinj.set("ERRINJ_TUPLE_ALLOC", false) -s:drop() +-- gh-881 iproto request with wal IO error +box.schema.user.grant('guest', 'read,write,execute', 'universe') +test = box.schema.create_space('test') +_ = test:create_index('primary') + +for i=1, box.cfg.rows_per_wal do test:insert{i, 'test'} end +c = net_box:new(box.cfg.listen) +-- try to write xlog without permission to write to disk +errinj.set('ERRINJ_WAL_WRITE', true) +c.space.test:insert({box.cfg.rows_per_wal + 1,1,2,3}) +errinj.set('ERRINJ_WAL_WRITE', false) +-- Cleanup +s:drop() +test:drop() errinj = nil +box.schema.user.revoke('guest', 'read,write,execute', 'universe')