Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
1a66c641
Commit
1a66c641
authored
Nov 16, 2020
by
Samuel GAIST
Browse files
[database] Add property to check if raw data access is enabled
parent
164bf684
Changes
2
Hide whitespace changes
Inline
Side-by-side
beat/core/database.py
View file @
1a66c641
...
...
@@ -247,3 +247,12 @@ class Database(BackendDatabase):
if
self
.
schema_version
!=
1
:
for
view
in
protocol
[
"views"
].
keys
():
self
.
_validate_view
(
view
)
@
property
def
is_database_rawdata_access_enabled
(
self
):
"""Returns whether raw data sharing was enabled
This property is only useful for the Docker executor.
"""
return
self
.
data
.
get
(
"direct_rawdata_access"
,
False
)
beat/core/test/test_database.py
View file @
1a66c641
...
...
@@ -61,3 +61,22 @@ def export(db_name):
# load from tmp_prefix and validates
exported
=
Database
(
tmp_prefix
,
db_name
)
nose
.
tools
.
assert_true
(
exported
.
valid
,
"
\n
* %s"
%
"
\n
* "
.
join
(
exported
.
errors
))
def
test_rawdata_access
():
for
i
in
range
(
1
,
3
):
yield
rawdata_access
,
f
"integers_db/
{
i
}
"
,
False
yield
rawdata_access
,
f
"simple/
{
i
}
"
,
False
yield
rawdata_access
,
f
"large/
{
i
}
"
,
False
yield
rawdata_access
,
f
"simple_rawdata_access/
{
i
}
"
,
True
@
nose
.
tools
.
with_setup
(
teardown
=
cleanup
)
def
rawdata_access
(
db_name
,
rawdata_access_enabled
):
obj
=
Database
(
prefix
,
db_name
)
nose
.
tools
.
assert_true
(
obj
.
valid
,
"
\n
* %s"
%
"
\n
* "
.
join
(
obj
.
errors
))
nose
.
tools
.
assert_equal
(
obj
.
is_database_rawdata_access_enabled
,
rawdata_access_enabled
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment