Skip to content
Snippets Groups Projects
Commit f50c9b5d authored by Gleb Kashkin's avatar Gleb Kashkin Committed by Alexander Turenko
Browse files

test/config: upgrade reload_success_case() helper

This helpers does the following:
1. starts a server
2. writes a script/config
3. verifies invariants
4. writes a new script/config
5. reloads
6. verifies invariants after reload

This patch allows to set not only script, but config too on the step 4,
before the reload.

Part of #8967

NO_DOC=test helper upgrade
NO_CHANGELOG=see NO_DOC
NO_TEST=see NO_DOC
parent 9b0896d9
No related branches found
No related tags found
No related merge requests found
......@@ -196,6 +196,11 @@ end
-- A new script to write into the main.lua file before
-- config:reload().
--
-- * opts.options_2
--
-- A new config to use for the config:reload(). It is optional,
-- if not provided opts.options is used instead.
--
-- * opts.verify_2
--
-- Verify test invariants after config:reload().
......@@ -203,13 +208,14 @@ local function reload_success_case(g, opts)
local script_2 = opts.script_2
local options = assert(opts.options)
local verify_2 = assert(opts.verify_2)
local options_2 = opts.options_2 or options
local prepared = success_case(g, opts)
prepare_case(g, {
dir = prepared.dir,
script = script_2,
options = options,
options = options_2,
})
g.server:exec(function()
local config = require('config')
......
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