Skip to content
Snippets Groups Projects
Commit bdbe221a authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

test: fix box/net_box hang when run after box/access_escalation

box/access_escalation cancels a fiber that is waiting for a call over
iproto to complete, but the fiber that is executing the call keeps
running. As a result, if box/net_box is run after this test, it will
hang, because it expects that the fiber pool is idle when it starts.
Fix this by making the call function return in box/access_escalation.
parent c602cc2c
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,10 @@ os = require('os')
-- The invoked function should get "Access denied" error,
-- there should be no privilege escalation.
-- define functions
function setuid() fiber.sleep(1000000) end
channel = fiber.channel(1)
---
...
function setuid() channel:get() end
---
...
function escalation() return box.space._space:get{box.schema.SPACE_ID} ~= nil end
......@@ -55,8 +58,9 @@ connection:call("escalation")
---
- error: Read access to space '_space' is denied for user 'guest'
...
fiber.cancel(background)
channel:put(true)
---
- true
...
--
-- tear down the functions; the grants are dropped recursively
......@@ -112,8 +116,9 @@ connection:call("escalation")
---
- true
...
fiber.cancel(background)
channel:put(true)
---
- true
...
-- tear down
box.schema.user.drop('underprivileged')
......
......@@ -20,7 +20,8 @@ os = require('os')
-- define functions
function setuid() fiber.sleep(1000000) end
channel = fiber.channel(1)
function setuid() channel:get() end
function escalation() return box.space._space:get{box.schema.SPACE_ID} ~= nil end
......@@ -37,7 +38,7 @@ connection = net:connect(os.getenv("LISTEN"))
background = fiber.create(function() connection:call("setuid") end)
connection:call("escalation")
fiber.cancel(background)
channel:put(true)
--
-- tear down the functions; the grants are dropped recursively
......@@ -75,7 +76,7 @@ connection = net:connect(os.getenv("LISTEN"))
background = fiber.create(function() connection:call("setuid") end)
connection:call("escalation")
fiber.cancel(background)
channel:put(true)
-- tear down
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment