Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
8880131e
Commit
8880131e
authored
8 years ago
by
bigbes
Committed by
Roman Tsisyk
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Refix tarantoolctl test again
parent
b8890069
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lua/console.lua
+1
-1
1 addition, 1 deletion
src/lua/console.lua
test-run
+1
-1
1 addition, 1 deletion
test-run
test/app-tap/tarantoolctl.test.lua
+31
-6
31 additions, 6 deletions
test/app-tap/tarantoolctl.test.lua
with
33 additions
and
8 deletions
src/lua/console.lua
+
1
−
1
View file @
8880131e
...
...
@@ -346,7 +346,7 @@ local function client_handler(client, peer)
print
=
client_print
;
client
=
client
;
},
repl_mt
)
local
version
=
_TARANTOOL
local
version
=
_TARANTOOL
:
match
(
"([^-]+)-"
)
state
:
print
(
string.format
(
"%-63s\n%-63s\n"
,
"Tarantool "
..
version
..
" (Lua console)"
,
"type 'help' for interactive help"
))
...
...
This diff is collapsed.
Click to expand it.
test-run
@
ab8b33cc
Compare
88657717
...
ab8b33cc
Subproject commit
886577172b82073b33d8a23a7f7555a85e6c146e
Subproject commit
ab8b33ccbe4f11021acebbcb7909efa3b5e8e5d7
This diff is collapsed.
Click to expand it.
test/app-tap/tarantoolctl.test.lua
+
31
−
6
View file @
8880131e
...
...
@@ -81,13 +81,39 @@ local function run_command(dir, command)
local
line
=
[[/bin/sh -c 'cd "%s" && %s >"%s" 2>"%s"']]
line
=
line
:
format
(
dir
,
command
,
fstdout
,
fstderr
)
local
res
=
os.execute
(
line
)
fiber
.
sleep
(
0
.
1
)
local
fstdout_e
,
fstderr_e
=
io.open
(
fstdout
):
read
(
'*a'
),
io.open
(
fstderr
):
read
(
'*a'
)
fio
.
unlink
(
fstdout
);
fio
.
unlink
(
fstderr
);
return
res
/
256
,
fstdout_e
,
fstderr_e
end
local
function
tctl_command
(
dir
,
cmd
,
args
)
local
function
tctl_wait
(
dir
,
name
)
if
name
then
local
path
=
fio
.
pathjoin
(
dir
,
name
..
'.control'
)
while
not
fio
.
stat
(
path
)
do
fiber
.
sleep
(
0
.
01
)
end
::
again
::
while
true
do
local
stat
,
nb
=
pcall
(
require
(
'net.box'
).
new
,
path
,
{
wait_connected
=
true
,
console
=
true
})
if
stat
==
false
then
fiber
.
sleep
(
0
.
01
)
goto
again
else
break
end
local
stat
,
msg
=
pcall
(
nb
.
eval
,
nb
,
'require("fiber").time()'
)
if
stat
==
false
then
fiber
.
sleep
(
0
.
01
)
else
break
end
end
end
end
local
function
tctl_command
(
dir
,
cmd
,
args
,
name
)
local
pid
=
nil
if
not
fio
.
stat
(
fio
.
pathjoin
(
dir
,
'.tarantoolctl'
))
then
create_script
(
dir
,
'.tarantoolctl'
,
tctlcfg_code
)
...
...
@@ -173,7 +199,7 @@ do
check_ok
(
test_i
,
dir
,
'start'
,
'bad_script'
,
1
,
nil
,
'unexpected symbol near'
)
check_ok
(
test_i
,
dir
,
'start'
,
'good_script'
,
0
)
fiber
.
sleep
(
0
.
1
)
tctl_wait
(
dir
,
'good_script'
)
-- wait here
check_ok
(
test_i
,
dir
,
'eval'
,
'good_script bad_script.lua'
,
3
,
nil
,
'Error, while reloading config:'
)
...
...
@@ -205,7 +231,7 @@ do
test
:
test
(
"check answers in case of call"
,
function
(
test_i
)
test_i
:
plan
(
6
)
check_ok
(
test_i
,
dir
,
'start'
,
'good_script'
,
0
)
fiber
.
sleep
(
0
.
1
)
tctl_wait
(
dir
,
'good_script'
)
check_ok
(
test_i
,
dir
,
'eval'
,
'good_script bad_script.lua'
,
3
,
nil
,
'Error, while reloading config'
)
check_ok
(
test_i
,
dir
,
'eval'
,
'good_script ok_script.lua'
,
0
,
...
...
@@ -324,7 +350,7 @@ do
local
dir
=
fio
.
tempdir
()
local
filler_code
=
[[
box.cfg{slab_alloc_arena = 0.1}
box.cfg{slab_alloc_arena = 0.1
, background=false
}
local space = box.schema.create_space("test")
space:create_index("primary")
space:insert({[1] = 1, [2] = 2, [3] = 3, [4] = 4})
...
...
@@ -361,7 +387,6 @@ do
test
:
test
(
"fill and test play output"
,
function
(
test_i
)
test_i
:
plan
(
6
)
check_ok
(
test_i
,
dir
,
'start'
,
'filler'
,
0
)
fiber
.
sleep
(
0
.
01
)
local
lsn_before
=
test_run
:
get_lsn
(
"remote"
,
1
)
test_i
:
is
(
lsn_before
,
4
,
"check lsn before"
)
local
res
,
stdout
,
stderr
=
run_command
(
dir
,
command_base
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment