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
76ad0c60
Verified
Commit
76ad0c60
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: conan
parent
d8f1c30e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9879
passed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+10
-0
10 additions, 0 deletions
CMakeLists.txt
README.md
+14
-0
14 additions, 0 deletions
README.md
conanfile.txt
+0
-1
0 additions, 1 deletion
conanfile.txt
test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
test/CMakeLists.txt
test/test_connection.cpp
+23
-4
23 additions, 4 deletions
test/test_connection.cpp
with
48 additions
and
6 deletions
CMakeLists.txt
+
10
−
0
View file @
76ad0c60
...
@@ -32,6 +32,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
...
@@ -32,6 +32,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
include
(
${
CMAKE_BINARY_DIR
}
/conanbuildinfo.cmake
)
include
(
${
CMAKE_BINARY_DIR
}
/conanbuildinfo.cmake
)
conan_basic_setup
()
conan_basic_setup
()
# fix grpc - remove unsecure (no-op ssl implementations)
string
(
REGEX REPLACE
"grpc
\\
+?
\\
+?_unsecure"
""
CONAN_LIBS_GRPC
"
${
CONAN_LIBS_GRPC
}
"
)
string
(
REGEX REPLACE
"grpc
\\
+?
\\
+?_unsecure"
""
CONAN_PKG_LIBS_GRPC
"
${
CONAN_PKG_LIBS_GRPC
}
"
)
string
(
REGEX REPLACE
"grpc
\\
+?
\\
+?_unsecure"
""
CONAN_LIBS
"
${
CONAN_LIBS
}
"
)
string
(
REGEX REPLACE
"grpc
\\
+?
\\
+?_unsecure"
""
CONAN_PKG_LIBS
"
${
CONAN_PKG_LIBS
}
"
)
# ignore some warnings here
# ignore some warnings here
add_compile_options
(
-Wno-unused-parameter -Wno-unused-result -g
)
add_compile_options
(
-Wno-unused-parameter -Wno-unused-result -g
)
...
...
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
14
−
0
View file @
76ad0c60
# caosdb-cppinttest
Integration tests for caosdb-cpplib and the caosdb-server
# Run tests
1.
`mkdir build && cd build/`
2.
`conan install .. -s "compiler.libcxx=libstdc++11"`
3.
`cmake -B . ..`
4.
`cmake --build .`
5.
Setup env vars
6.
Run with
`ctest`
in the build directory.
This diff is collapsed.
Click to expand it.
conanfile.txt
+
0
−
1
View file @
76ad0c60
[requires]
[requires]
caosdb/0.0.2
caosdb/0.0.2
gtest/1.11.0
gtest/1.11.0
boost/1.76.0
[generators]
[generators]
cmake
cmake
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
1
−
1
View file @
76ad0c60
...
@@ -75,7 +75,7 @@ foreach (i RANGE "${len_test_cases}")
...
@@ -75,7 +75,7 @@ foreach (i RANGE "${len_test_cases}")
target_link_libraries
(
${
test_case_name
}
PRIVATE
${
CONAN_LIBS_CAOSDB
}
target_link_libraries
(
${
test_case_name
}
PRIVATE
${
CONAN_LIBS_CAOSDB
}
${
CONAN_LIBS_GTEST
}
${
CONAN_LIBS_GRPC
}
${
CONAN_LIBS_ABSEIL
}
${
CONAN_LIBS_GTEST
}
${
CONAN_LIBS_GRPC
}
${
CONAN_LIBS_ABSEIL
}
${
CONAN_LIBS_OPENSSL
}
${
CONAN_LIBS_C-ARES
}
${
CONAN_LIBS_BZIP2
}
${
CONAN_LIBS_OPENSSL
}
${
CONAN_LIBS_C-ARES
}
${
CONAN_LIBS_BZIP2
}
${
CONAN_LIBS_PROTOBUF
}
${
CONAN_LIBS_ZLIB
}
)
${
CONAN_LIBS_PROTOBUF
}
${
CONAN_LIBS_ZLIB
}
${
CONAN_LIBS_RE2
}
)
target_include_directories
(
${
test_case_name
}
PUBLIC
${
CONAN_INCLUDE_DIRS
}
)
target_include_directories
(
${
test_case_name
}
PUBLIC
${
CONAN_INCLUDE_DIRS
}
)
set_target_properties
(
${
test_case_name
}
set_target_properties
(
${
test_case_name
}
PROPERTIES
PROPERTIES
...
...
This diff is collapsed.
Click to expand it.
test/test_connection.cpp
+
23
−
4
View file @
76ad0c60
...
@@ -54,7 +54,8 @@ TEST(test_connection, connect_somehost_42347_fails) {
...
@@ -54,7 +54,8 @@ TEST(test_connection, connect_somehost_42347_fails) {
}
}
TEST
(
test_connection
,
connection_insecure_authentication_error
)
{
TEST
(
test_connection
,
connection_insecure_authentication_error
)
{
auto
port
=
8080
;
auto
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_GRPC_PORT_HTTP"
,
"8080"
);
auto
port
=
std
::
stoi
(
port_str
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
auto
config
=
std
::
make_shared
<
InsecureCaosDBConnectionConfig
>
(
host
,
port
);
auto
config
=
std
::
make_shared
<
InsecureCaosDBConnectionConfig
>
(
host
,
port
);
...
@@ -63,8 +64,9 @@ TEST(test_connection, connection_insecure_authentication_error) {
...
@@ -63,8 +64,9 @@ TEST(test_connection, connection_insecure_authentication_error) {
EXPECT_THROW
(
connection
.
getVersionInfo
(),
AuthenticationError
);
EXPECT_THROW
(
connection
.
getVersionInfo
(),
AuthenticationError
);
}
}
TEST
(
test_connection
,
connection_ssl_authentication_error
)
{
TEST
(
test_connection
,
connection_ssl_authentication_error_anonymous
)
{
auto
port
=
8443
;
auto
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_GRPC_PORT_HTTPS"
,
"8443"
);
auto
port
=
std
::
stoi
(
port_str
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
const
auto
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
...
@@ -75,8 +77,25 @@ TEST(test_connection, connection_ssl_authentication_error) {
...
@@ -75,8 +77,25 @@ TEST(test_connection, connection_ssl_authentication_error) {
EXPECT_THROW
(
connection
.
getVersionInfo
(),
AuthenticationError
);
EXPECT_THROW
(
connection
.
getVersionInfo
(),
AuthenticationError
);
}
}
TEST
(
test_connection
,
connection_ssl_authentication_error_wrong_credentials
)
{
auto
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_GRPC_PORT_HTTPS"
,
"8443"
);
auto
port
=
std
::
stoi
(
port_str
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
const
auto
*
const
user
=
"not-a-user-23461237"
;
const
auto
*
const
password
=
"very-c-cred"
;
auto
auth
=
std
::
make_shared
<
PlainPasswordAuthenticator
>
(
user
,
password
);
auto
ssloptions
=
std
::
make_shared
<
PemFileCACertProvider
>
(
path
);
auto
config
=
std
::
make_shared
<
SslCaosDBConnectionConfig
>
(
host
,
port
,
ssloptions
,
auth
);
auto
connection
=
CaosDBConnection
(
config
);
EXPECT_THROW
(
connection
.
getVersionInfo
(),
AuthenticationError
);
}
TEST
(
test_connection
,
connection_ssl_authentication_success
)
{
TEST
(
test_connection
,
connection_ssl_authentication_success
)
{
auto
port
=
8080
;
auto
port_str
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_GRPC_PORT_HTTPS"
,
"8443"
);
auto
port
=
std
::
stoi
(
port_str
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
host
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_HOST"
,
"localhost"
);
const
auto
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
const
auto
path
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_SERVER_CA_PEM"
,
std
::
string
());
const
auto
user
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_USER"
,
"admin"
);
const
auto
user
=
caosdb
::
utils
::
get_env_var
(
"CAOSDB_USER"
,
"admin"
);
...
...
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