Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
CaosDB Python Integration Tests
Commits
1c55c4fa
Commit
1c55c4fa
authored
4 years ago
by
Timm Fitschen
Committed by
Henrik tom Wörden
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tests for caosdb/caosdb-server!79 caosdb-server.#120
parent
8ad5205e
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
.docker-base/Dockerfile
+32
-1
32 additions, 1 deletion
.docker-base/Dockerfile
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
tests/test_issues_server.py
+35
-1
35 additions, 1 deletion
tests/test_issues_server.py
with
68 additions
and
3 deletions
.docker-base/Dockerfile
+
32
−
1
View file @
1c55c4fa
# Use docker as parent image
FROM
docker:
19.03.0
FROM
docker:
20.10.3
# http://bugs.python.org/issue19846
ENV
LANG C.UTF-8
...
...
@@ -9,6 +9,37 @@ RUN apk add --no-cache py3-pip python3 python3-dev gcc make \
git bash curl gettext py3-requests
RUN
apk add
--no-cache
libffi-dev openssl-dev libc-dev libxslt libxslt-dev
\
libxml2 libxml2-dev
RUN
apk add
--no-cache
ca-certificates
# install rust (needed for compiling a docker-compose dependency)
# This is necessary until alpine comes with an up to date RUST
# copied from https://github.com/rust-lang/docker-rust/blob/bbc7feb12033da3909dced4e88ddbb6964fbc328/1.50.0/alpine3.13/Dockerfile
ENV
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.50.0
RUN
set
-eux
;
\
apkArch
=
"
$(
apk
--print-arch
)
"
;
\
case
"
$apkArch
"
in
\
x86_64
)
rustArch
=
'x86_64-unknown-linux-musl'
;
rustupSha256
=
'05c5c05ec76671d73645aac3afbccf2187352fce7e46fc85be859f52a42797f6'
;;
\
aarch64
)
rustArch
=
'aarch64-unknown-linux-musl'
;
rustupSha256
=
'6a8a480d8d9e7f8c6979d7f8b12bc59da13db67970f7b13161ff409f0a771213'
;;
\
*
)
echo
>
&2
"unsupported architecture:
$apkArch
"
;
exit
1
;;
\
esac
;
\
url
=
"https://static.rust-lang.org/rustup/archive/1.23.1/
${
rustArch
}
/rustup-init"
;
\
wget
"
$url
"
;
\
echo
"
${
rustupSha256
}
*rustup-init"
|
sha256sum
-c
-
;
\
chmod
+x rustup-init
;
\
./rustup-init
-y
--no-modify-path
--profile
minimal
--default-toolchain
$RUST_VERSION
--default-host
${
rustArch
}
;
\
rm
rustup-init
;
\
chmod
-R
a+w
$RUSTUP_HOME
$CARGO_HOME
;
\
rustup
--version
;
\
cargo
--version
;
\
rustc
--version
;
RUN
pip3
install
wheel
RUN
pip3
install
docker-compose
==
1.25
# Script for waiting on LA server
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
1
−
1
View file @
1c55c4fa
...
...
@@ -79,7 +79,7 @@ stages:
# file-system features.
#
services
:
-
docker:
19.03.0
-dind
-
docker:
20.10.3
-dind
test
:
tags
:
[
docker
]
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_server.py
+
35
−
1
View file @
1c55c4fa
...
...
@@ -29,8 +29,8 @@ import tempfile
import
time
import
caosdb
as
db
from
caosdb.exceptions
import
TransactionError
import
pytest
from
caosdb.exceptions
import
TransactionError
def
setup_module
():
...
...
@@ -199,3 +199,37 @@ def test_issue_110():
print
(
result
[
0
])
print
(
a1
)
assert
result
[
0
].
id
==
a1
.
id
def
test_issue_120
():
"""
Editing entities that were created with a no longer existing user leads
to a server error.
The server should throw an error when CHECK_ENTITY_ACL_ROLES_MODE=MUST,
otherwise a warning.
"""
# insert an entity
entity
=
db
.
RecordType
(
"
TestRT
"
).
insert
(
flags
=
{
"
ACL
"
:
None
})
db
.
administration
.
set_server_property
(
"
CHECK_ENTITY_ACL_ROLES_MODE
"
,
"
SHOULD
"
)
# update with non-existing user, realm and role
entity
.
deny
(
realm
=
"
CaosDB
"
,
username
=
"
NON_EXISTING_USER
"
,
permission
=
"
USE:AS_REFERENCE
"
)
entity
.
update
(
flags
=
{
"
ACL
"
:
None
})
assert
entity
.
messages
[
"
Warning
"
,
1104
][
0
]
==
"
User Role does not exist.
"
entity
.
deny
(
realm
=
"
NON_EXISTING_REALM
"
,
username
=
"
NON_EXISTING_USER
"
,
permission
=
"
USE:AS_REFERENCE
"
)
entity
.
update
(
flags
=
{
"
ACL
"
:
None
})
assert
entity
.
messages
[
"
Warning
"
,
1104
][
0
]
==
"
User Role does not exist.
"
entity
.
deny
(
role
=
"
ALSO_NON_EXISTING_ROLE
"
,
permission
=
"
USE:AS_REFERENCE
"
)
entity
.
update
(
flags
=
{
"
ACL
"
:
None
})
assert
entity
.
messages
[
"
Warning
"
,
1104
][
0
]
==
"
User Role does not exist.
"
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