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
feeb5afb
Commit
feeb5afb
authored
10 years ago
by
Dmitry E. Oboukhov
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:tarantool/tarantool
parents
41d4ee89
42eda622
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/app/console.result
+3
-1
3 additions, 1 deletion
test/app/console.result
test/app/console.test.lua
+16
-5
16 additions, 5 deletions
test/app/console.test.lua
with
19 additions
and
6 deletions
test/app/console.result
+
3
−
1
View file @
feeb5afb
TAP version 13
1..1
6
1..1
8
ok - console.listen started
ok - connect to console
ok - eval
...
...
@@ -9,6 +9,8 @@ ok - set delimiter to ';'
ok - state.delimiter is ';'
ok - get delimiter is ';'
ok - clear delimiter
ok - remote network error
ok - remote access denied
ok - remote connect
ok - remote eval
ok - remote state.remote.host
...
...
This diff is collapsed.
Click to expand it.
test/app/console.test.lua
+
16
−
5
View file @
feeb5afb
...
...
@@ -19,13 +19,9 @@ box.cfg{
--
local
EOL
=
{
"
\n
%.%.%.\n"
}
-- Add permissions to execute `dostring` for `guest`
box
.
schema
.
func
.
create
(
'dostring'
)
box
.
schema
.
user
.
grant
(
'guest'
,
'execute'
,
'function'
,
'dostring'
)
test
=
tap
.
test
(
"console"
)
test
:
plan
(
1
6
)
test
:
plan
(
1
8
)
-- Start console and connect to it
local
server
=
console
.
listen
(
CONSOLE_SOCKET
)
...
...
@@ -58,6 +54,21 @@ client:write("require('console').delimiter('');\n")
test
:
is
(
yaml
.
decode
(
client
:
readline
(
EOL
)),
''
,
"clear delimiter"
)
-- Connect to iproto console (CALL)
client
:
write
(
string.format
(
"require('console').connect('unix/', '/')\n"
))
-- error: Connection is not established
test
:
ok
(
yaml
.
decode
(
client
:
readline
(
EOL
))[
1
].
error
:
find
(
'not established'
),
'remote network error'
)
client
:
write
(
string.format
(
"require('console').connect('unix/', '%s')\n"
,
IPROTO_SOCKET
))
-- error: Execute access denied for user 'guest' to function 'dostring
test
:
ok
(
yaml
.
decode
(
client
:
readline
(
EOL
))[
1
].
error
:
find
(
'access denied'
),
'remote access denied'
)
-- Add permissions to execute `dostring` for `guest`
box
.
schema
.
func
.
create
(
'dostring'
)
box
.
schema
.
user
.
grant
(
'guest'
,
'execute'
,
'function'
,
'dostring'
)
client
:
write
(
string.format
(
"require('console').connect('unix/', '%s')\n"
,
IPROTO_SOCKET
))
test
:
is
(
yaml
.
decode
(
client
:
readline
(
EOL
)),
''
,
"remote connect"
)
...
...
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