Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cppinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
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-cppinttest
Commits
652b345e
Verified
Commit
652b345e
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: tls
parent
04b6f1cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9280
failed
3 years ago
Stage: info
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.docker/tester.yml
+4
-0
4 additions, 0 deletions
.docker/tester.yml
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
test/test_connection.cpp
+28
-6
28 additions, 6 deletions
test/test_connection.cpp
with
33 additions
and
6 deletions
.docker/tester.yml
+
4
−
0
View file @
652b345e
...
...
@@ -2,6 +2,10 @@ version: '3.7'
services
:
tester
:
image
:
"
$CPPINTTEST_REGISTRY_IMAGE"
environment
:
CAOSDB_SERVER_HOST
:
caosdb-server
CAOSDB_SERVER_PORT
:
8443
CAOSDB_SERVER_CA_PEM
:
/cert/caosdb.cert.pem
networks
:
-
docker_caosnet
volumes
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
1
−
0
View file @
652b345e
...
...
@@ -75,6 +75,7 @@ build-testenv:
only
:
-
schedules
-
web
-
triggers
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
...
...
This diff is collapsed.
Click to expand it.
test/test_connection.cpp
+
28
−
6
View file @
652b345e
...
...
@@ -25,6 +25,7 @@
#include
<gtest/gtest-test-part.h>
#include
<memory>
#include
"gtest/gtest_pred_impl.h"
#include
"utils.h"
using
caosdb
::
info
::
v1alpha1
::
VersionInfo
;
...
...
@@ -46,21 +47,42 @@ TEST(test_connection, connect_somehost_42347_fails) {
ASSERT_THROW
(
connection
.
getVersionInfo
(),
std
::
runtime_error
);
}
TEST
(
test_connection
,
connection_caosdb_server_
8080
_success
)
{
TEST
(
test_connection
,
connection_caosdb_server_
insecure
_success
)
{
int
port
=
8080
;
std
::
string
host
=
"localhost"
;
std
::
cout
<<
"HERE1
\n
"
;
const
std
::
string
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
EXPECT_EQ
(
host
,
"localhost"
);
std
::
cout
<<
"HERE2
\n
"
;
int
major
=
0
;
int
minor
=
5
;
int
patch
=
0
;
std
::
string
pre_release
=
"SNAPSHOT
"
;
std
::
cout
<<
"HERE3
\n
"
;
auto
config
=
std
::
make_shared
<
caosdb
::
InsecureCaosDBConnectionConfig
>
(
host
,
port
);
std
::
cout
<<
"HERE4
\n
"
;
auto
connection
=
caosdb
::
CaosDBConnection
(
config
);
std
::
cout
<<
"HERE5
\n
"
;
auto
v_info
=
connection
.
getVersionInfo
();
std
::
cout
<<
"HERE6
\n
"
;
ASSERT_EQ
(
major
,
v_info
.
major
());
std
::
cout
<<
"HERE7
\n
"
;
ASSERT_EQ
(
minor
,
v_info
.
minor
());
}
TEST
(
test_connection
,
connection_caosdb_server_ssl_success
)
{
int
port
=
8443
;
const
std
::
string
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
std
::
string
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
int
major
=
0
;
int
minor
=
5
;
int
patch
=
0
;
auto
ssloptions
=
std
::
make_shared
<
caosdb
::
PemFileCACertProvider
>
(
path
);
auto
config
=
std
::
make_shared
<
caosdb
::
SslCaosDBConnectionConfig
>
(
host
,
port
,
ssloptions
);
auto
connection
=
std
::
make_unique
<
caosdb
::
CaosDBConnection
>
(
config
);
auto
v_info
=
connection
->
getVersionInfo
();
ASSERT_EQ
(
major
,
v_info
.
major
());
ASSERT_EQ
(
minor
,
v_info
.
minor
());
ASSERT_EQ
(
patch
,
v_info
.
patch
());
ASSERT_EQ
(
pre_release
,
v_info
.
pre_release
());
ASSERT_NE
(
""
,
v_info
.
build
());
}
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