summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2023-12-04 01:14:02 +0300
committerEd Tanous <ed@tanous.net>2023-12-09 01:59:39 +0300
commite79239970c3701f12903e8ac1574b9210b69aebc (patch)
treee712405c0837e65bb056147051d968e73ee5ca4b /meson.build
parent8e3f70321e71009c76c11fa90a6ca669f5941fc5 (diff)
downloadbmcweb-e79239970c3701f12903e8ac1574b9210b69aebc.tar.xz
Add mutual tls unit test
Mutual TLS paths were not tested. Add some unit tests. Because CI doesn't actually compile dependent libraries with ASAN enabled, and these tests call into openssl, we need to add a check for if we're compiling with asan enabled. Tested: unit tests pass. Change-Id: I02dcb69708619cc00fffd840738c608db3ae8bdf Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 20 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 002b94900c..26e8fda16f 100644
--- a/meson.build
+++ b/meson.build
@@ -136,7 +136,6 @@ add_project_arguments(
'-Wcast-align',
'-Wconversion',
'-Wformat=2',
- '-Wold-style-cast',
'-Woverloaded-virtual',
'-Wsign-conversion',
'-Wunused',
@@ -260,8 +259,24 @@ bmcweb_dependencies = []
pam = cxx.find_library('pam', required: true)
atomic = cxx.find_library('atomic', required: true)
-openssl = dependency('openssl', required : true)
-bmcweb_dependencies += [pam, atomic, openssl]
+bmcweb_dependencies += [pam, atomic]
+
+openssl = dependency('openssl', required : false, version: '>=3.0.0')
+if not openssl.found() or get_option('b_sanitize') != 'none'
+ openssl_proj = subproject(
+ 'openssl',
+ required: true,
+ default_options: ['warning_level=0', 'werror=false']
+ )
+ openssl = openssl_proj.get_variable('openssl_dep')
+ openssl = openssl.as_system('system')
+else
+ # When we build openssl as a subproject, the warnings analyzer starts
+ # flagging all the C macros as old style casts, so only enable the
+ # warning for non subprojects.
+ add_project_arguments('-Wold-style-cast', language: 'cpp')
+endif
+bmcweb_dependencies += [openssl]
nghttp2 = dependency('libnghttp2', version: '>=1.52.0', required : false)
if not nghttp2.found()
@@ -408,6 +423,7 @@ executable(
srcfiles_unittest = files(
'test/http/crow_getroutes_test.cpp',
'test/http/http_connection_test.cpp',
+ 'test/http/mutual_tls.cpp',
'test/http/router_test.cpp',
'test/http/http_response_test.cpp',
'test/http/utility_test.cpp',
@@ -442,6 +458,7 @@ srcfiles_unittest = files(
'test/redfish-core/lib/power_subsystem_test.cpp',
)
+
if(get_option('tests').allowed())
# generate the test executable
foreach test_src : srcfiles_unittest