You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2023/10/01 15:30:02 UTC
[celix] 02/02: #509: Disable RSA conan package testing (for now)
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch feature/509-remove-install-of-v2-headers
in repository https://gitbox.apache.org/repos/asf/celix.git
commit 4050a0371be9087bce6c8d900c044f5f29260998
Author: Pepijn Noltes <pn...@apache.org>
AuthorDate: Sun Oct 1 17:29:51 2023 +0200
#509: Disable RSA conan package testing (for now)
---
.../include/endpoint_discovery_poller.h | 3 +-
.../src/endpoint_descriptor_writer.c | 1 +
.../rsa_spi/include/endpoint_description.h | 4 +-
.../rsa_spi/include/endpoint_listener.h | 4 +-
examples/conan_test_package/README.md | 2 +-
examples/conan_test_package/conanfile.py | 52 ++++++++++++----------
examples/conan_test_package/my_psa_activator.c | 32 -------------
.../README.md | 14 ++----
examples/conan_test_package_v2/conanfile.py | 52 ++++++++++++----------
9 files changed, 70 insertions(+), 94 deletions(-)
diff --git a/bundles/remote_services/discovery_common/include/endpoint_discovery_poller.h b/bundles/remote_services/discovery_common/include/endpoint_discovery_poller.h
index 9cf03291..2b835ade 100644
--- a/bundles/remote_services/discovery_common/include/endpoint_discovery_poller.h
+++ b/bundles/remote_services/discovery_common/include/endpoint_discovery_poller.h
@@ -31,6 +31,7 @@
#include "discovery_type.h"
#include "celix_log_helper.h"
#include "celix_threads.h"
+#include "celix_array_list.h"
#include "hash_map.h"
typedef struct endpoint_discovery_poller endpoint_discovery_poller_t;
@@ -55,6 +56,6 @@ celix_status_t endpointDiscoveryPoller_destroy(endpoint_discovery_poller_t *poll
celix_status_t endpointDiscoveryPoller_addDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url);
celix_status_t endpointDiscoveryPoller_removeDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url);
-celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, array_list_pt urls);
+celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, celix_array_list_t* urls);
#endif /* ENDPOINT_DISCOVERY_POLLER_H_ */
diff --git a/bundles/remote_services/discovery_common/src/endpoint_descriptor_writer.c b/bundles/remote_services/discovery_common/src/endpoint_descriptor_writer.c
index d2e2421f..3630ed46 100644
--- a/bundles/remote_services/discovery_common/src/endpoint_descriptor_writer.c
+++ b/bundles/remote_services/discovery_common/src/endpoint_descriptor_writer.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <libxml/xmlwriter.h>
+#include "hash_map.h"
#include "celix_constants.h"
#include "remote_constants.h"
diff --git a/bundles/remote_services/rsa_spi/include/endpoint_description.h b/bundles/remote_services/rsa_spi/include/endpoint_description.h
index e9ba63e5..357641bd 100644
--- a/bundles/remote_services/rsa_spi/include/endpoint_description.h
+++ b/bundles/remote_services/rsa_spi/include/endpoint_description.h
@@ -27,8 +27,8 @@
#ifndef ENDPOINT_DESCRIPTION_H_
#define ENDPOINT_DESCRIPTION_H_
-#include "properties.h"
-#include "array_list.h"
+#include "celix_properties.h"
+#include "celix_array_list.h"
#include "celix_cleanup.h"
#include <stdbool.h>
diff --git a/bundles/remote_services/rsa_spi/include/endpoint_listener.h b/bundles/remote_services/rsa_spi/include/endpoint_listener.h
index 68bad113..337c18d3 100644
--- a/bundles/remote_services/rsa_spi/include/endpoint_listener.h
+++ b/bundles/remote_services/rsa_spi/include/endpoint_listener.h
@@ -27,8 +27,8 @@
#ifndef ENDPOINT_LISTENER_H_
#define ENDPOINT_LISTENER_H_
-#include "array_list.h"
-#include "properties.h"
+#include "celix_array_list.h"
+#include "celix_properties.h"
#include "endpoint_description.h"
diff --git a/examples/conan_test_package/README.md b/examples/conan_test_package/README.md
index 48c3dc41..29bac0cf 100644
--- a/examples/conan_test_package/README.md
+++ b/examples/conan_test_package/README.md
@@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-# Conan Test Package
+# Conan v1 Test Package
> To learn API usage, we refer our users to `celix-examples` and various tests. The C/C++ source codes in this folder are NOT worth reading.
diff --git a/examples/conan_test_package/conanfile.py b/examples/conan_test_package/conanfile.py
index 217ead18..315d2a6e 100644
--- a/examples/conan_test_package/conanfile.py
+++ b/examples/conan_test_package/conanfile.py
@@ -35,13 +35,16 @@ class TestPackageConan(ConanFile):
cmake.definitions["TEST_PSA_TCP"] = self.options["celix"].build_pubsub_psa_tcp
cmake.definitions["TEST_PSA_WS"] = self.options["celix"].build_pubsub_psa_ws
cmake.definitions["TEST_PSA_DISCOVERY_ETCD"] = self.options["celix"].build_pubsub_discovery_etcd
- cmake.definitions["TEST_RSA"] = self.options["celix"].build_remote_service_admin
- cmake.definitions["TEST_RSA_DFI"] = self.options["celix"].build_rsa_remote_service_admin_dfi
- cmake.definitions["TEST_RSA_SHM_V2"] = self.options["celix"].build_rsa_remote_service_admin_shm_v2
- cmake.definitions["TEST_RSA_RPC_JSON"] = self.options["celix"].build_rsa_json_rpc
- cmake.definitions["TEST_RSA_DISCOVERY_CONFIGURED"] = self.options["celix"].build_rsa_discovery_configured
- cmake.definitions["TEST_RSA_DISCOVERY_ETCD"] = self.options["celix"].build_rsa_discovery_etcd
- cmake.definitions["TEST_RSA_DISCOVERY_ZEROCONF"] = self.options["celix"].build_rsa_discovery_zeroconf
+
+ #TODO #509. Refactor RSA so that service_reference and hashmap are not needed anymore
+ #cmake.definitions["TEST_RSA"] = self.options["celix"].build_remote_service_admin
+ #cmake.definitions["TEST_RSA_DFI"] = self.options["celix"].build_rsa_remote_service_admin_dfi
+ #cmake.definitions["TEST_RSA_SHM_V2"] = self.options["celix"].build_rsa_remote_service_admin_shm_v2
+ #cmake.definitions["TEST_RSA_RPC_JSON"] = self.options["celix"].build_rsa_json_rpc
+ #cmake.definitions["TEST_RSA_DISCOVERY_CONFIGURED"] = self.options["celix"].build_rsa_discovery_configured
+ #cmake.definitions["TEST_RSA_DISCOVERY_ETCD"] = self.options["celix"].build_rsa_discovery_etcd
+ #cmake.definitions["TEST_RSA_DISCOVERY_ZEROCONF"] = self.options["celix"].build_rsa_discovery_zeroconf
+
cmake.definitions["TEST_SHELL"] = self.options["celix"].build_shell
if self.options["celix"].build_shell:
cmake.definitions["TEST_CXX_SHELL"] = self.options["celix"].celix_cxx17 or self.options["celix"].celix_cxx14
@@ -94,22 +97,25 @@ class TestPackageConan(ConanFile):
if self.options["celix"].build_pubsub_discovery_etcd and self.options["celix"].build_launcher:
self.run("./use_psa_discovery_etcd",
cwd=os.path.join("deploy", "use_psa_discovery_etcd"), run_environment=True)
- if self.options["celix"].build_remote_service_admin:
- self.run("./use_my_rsa", cwd=os.path.join("deploy", "use_my_rsa"), run_environment=True)
- self.run("./use_c_rsa_spi", run_environment=True)
- if self.options["celix"].build_rsa_remote_service_admin_dfi and self.options["celix"].build_launcher:
- self.run("./use_rsa_dfi", cwd=os.path.join("deploy", "use_rsa_dfi"), run_environment=True)
- if self.options["celix"].build_rsa_remote_service_admin_shm_v2:
- self.run("./use_rsa_shm_v2", cwd=os.path.join("deploy", "use_rsa_shm_v2"), run_environment=True)
- if self.options["celix"].build_rsa_json_rpc:
- self.run("./use_rsa_rpc_json", cwd=os.path.join("deploy", "use_rsa_rpc_json"), run_environment=True)
- if self.options["celix"].build_rsa_discovery_configured and self.options["celix"].build_launcher:
- self.run("./use_rsa_configured", cwd=os.path.join("deploy", "use_rsa_configured"), run_environment=True)
- if self.options["celix"].build_rsa_discovery_etcd and self.options["celix"].build_launcher:
- self.run("./use_rsa_etcd", cwd=os.path.join("deploy", "use_rsa_etcd"), run_environment=True)
- if self.options["celix"].build_rsa_discovery_zeroconf:
- self.run("./use_rsa_discovery_zeroconf",
- cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), run_environment=True)
+
+ #TODO #509. Refactor RSA so that service_reference and hashmap are not needed anymore
+ # if self.options["celix"].build_remote_service_admin:
+ # self.run("./use_my_rsa", cwd=os.path.join("deploy", "use_my_rsa"), run_environment=True)
+ # self.run("./use_c_rsa_spi", run_environment=True)
+ # if self.options["celix"].build_rsa_remote_service_admin_dfi and self.options["celix"].build_launcher:
+ # self.run("./use_rsa_dfi", cwd=os.path.join("deploy", "use_rsa_dfi"), run_environment=True)
+ # if self.options["celix"].build_rsa_remote_service_admin_shm_v2:
+ # self.run("./use_rsa_shm_v2", cwd=os.path.join("deploy", "use_rsa_shm_v2"), run_environment=True)
+ # if self.options["celix"].build_rsa_json_rpc:
+ # self.run("./use_rsa_rpc_json", cwd=os.path.join("deploy", "use_rsa_rpc_json"), run_environment=True)
+ # if self.options["celix"].build_rsa_discovery_configured and self.options["celix"].build_launcher:
+ # self.run("./use_rsa_configured", cwd=os.path.join("deploy", "use_rsa_configured"), run_environment=True)
+ # if self.options["celix"].build_rsa_discovery_etcd and self.options["celix"].build_launcher:
+ # self.run("./use_rsa_etcd", cwd=os.path.join("deploy", "use_rsa_etcd"), run_environment=True)
+ # if self.options["celix"].build_rsa_discovery_zeroconf:
+ # self.run("./use_rsa_discovery_zeroconf",
+ # cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), run_environment=True)
+
if self.options["celix"].build_shell:
self.run("./use_shell", run_environment=True)
if self.options["celix"].celix_cxx17 or self.options["celix"].celix_cxx14:
diff --git a/examples/conan_test_package/my_psa_activator.c b/examples/conan_test_package/my_psa_activator.c
index 6c32125d..7e009fce 100644
--- a/examples/conan_test_package/my_psa_activator.c
+++ b/examples/conan_test_package/my_psa_activator.c
@@ -22,33 +22,14 @@
#include <celix_log_helper.h>
#include <pubsub_admin.h>
#include <pubsub_constants.h>
-#include <pubsub_serializer.h>
#include <stdlib.h>
typedef struct my_psa_activator {
celix_log_helper_t *logHelper;
- long serializersTrackerId;
pubsub_admin_service_t adminService;
long adminSvcId;
} my_psa_activator_t;
-static void myPsa_addSerializerSvc(void *handle, void *svc, const celix_properties_t *props) {
- my_psa_activator_t *act = handle;
- const char *serType = celix_properties_get(props, PUBSUB_SERIALIZER_TYPE_KEY, NULL);
- long svcId = celix_properties_getAsLong(props, OSGI_FRAMEWORK_SERVICE_ID, -1L);
- celix_logHelper_info(act->logHelper, "Serializer Added: %s=%s %s=%ld\n",
- PUBSUB_SERIALIZER_TYPE_KEY, serType, OSGI_FRAMEWORK_SERVICE_ID, svcId);
-
-}
-
-static void myPsa_removeSerializerSvc(void *handle, void *svc, const celix_properties_t *props) {
- my_psa_activator_t *act = handle;
- const char *serType = celix_properties_get(props, PUBSUB_SERIALIZER_TYPE_KEY, NULL);
- long svcId = celix_properties_getAsLong(props, OSGI_FRAMEWORK_SERVICE_ID, -1L);
- celix_logHelper_info(act->logHelper, "Serializer Removed: %s=%s %s=%ld\n",
- PUBSUB_SERIALIZER_TYPE_KEY, serType, OSGI_FRAMEWORK_SERVICE_ID, svcId);
-}
-
static celix_status_t matchPublisher(void *handle, long svcRequesterBndId,
const celix_filter_t *svcFilter, celix_properties_t **outTopicProperties,
double *outScore, long *outSerializerSvcId, long *outProtocolSvcId) {
@@ -137,21 +118,9 @@ static celix_status_t removeDiscoveredEndpoint(void *handle, const celix_propert
int psa_udpmc_start(my_psa_activator_t *act, celix_bundle_context_t *ctx) {
act->adminSvcId = -1L;
- act->serializersTrackerId = -1L;
act->logHelper = celix_logHelper_create(ctx, "my_psa_admin");
celix_status_t status = CELIX_SUCCESS;
- //track serializers
- if (status == CELIX_SUCCESS) {
- celix_service_tracking_options_t opts = CELIX_EMPTY_SERVICE_TRACKING_OPTIONS;
- opts.filter.serviceName = PUBSUB_SERIALIZER_SERVICE_NAME;
- opts.filter.ignoreServiceLanguage = true;
- opts.callbackHandle = act;
- opts.addWithProperties = myPsa_addSerializerSvc;
- opts.removeWithProperties = myPsa_removeSerializerSvc;
- act->serializersTrackerId = celix_bundleContext_trackServicesWithOptions(ctx, &opts);
- }
-
//register pubsub admin service
if (status == CELIX_SUCCESS) {
pubsub_admin_service_t *psaSvc = &act->adminService;
@@ -177,7 +146,6 @@ int psa_udpmc_start(my_psa_activator_t *act, celix_bundle_context_t *ctx) {
int psa_udpmc_stop(my_psa_activator_t *act, celix_bundle_context_t *ctx) {
celix_bundleContext_unregisterService(ctx, act->adminSvcId);
- celix_bundleContext_stopTracker(ctx, act->serializersTrackerId);
celix_logHelper_destroy(act->logHelper);
return CELIX_SUCCESS;
}
diff --git a/examples/conan_test_package/README.md b/examples/conan_test_package_v2/README.md
similarity index 71%
copy from examples/conan_test_package/README.md
copy to examples/conan_test_package_v2/README.md
index 48c3dc41..d0d12c49 100644
--- a/examples/conan_test_package/README.md
+++ b/examples/conan_test_package_v2/README.md
@@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-# Conan Test Package
+# Conan v2 Test Package
> To learn API usage, we refer our users to `celix-examples` and various tests. The C/C++ source codes in this folder are NOT worth reading.
@@ -34,19 +34,13 @@ a Celix package is properly installed in the local Conan cache. To this end, it
To create a Celix package in the local cache with C++ support and verify that it's properly installed, run the following command in the Celix root directory:
```BASH
-conan create . celix/2.2.3@zhengpeng/testing -tf examples/conan_test_package/ -o celix:celix_cxx17=True
+conan create . --build missing -o build_all=True
```
To verify a Celix package with C++ support is properly installed in the local cache, run the following command in the Celix root directory:
```BASH
-conan test examples/conan_test_package/ celix/2.2.3@zhengpeng/testing -o celix:celix_cxx17=True
+conan test examples/conan_test_package_v2 celix/3.0.0 -o build_all=True
```
-Though it might not be wise to spend time reading C/C++ codes in this folder, it's instructive to have a look at `conanfile.py` and `CMakeLists.txt`,
-which illustrates a non-intrusive way of using Conan with CMake build system. Pay attention to our use of `cmake_paths` `cmake_find_package` generators
-and the following line:
-
-```python
- cmake.definitions["CMAKE_PROJECT_test_package_INCLUDE"] = os.path.join(self.build_folder, "conan_paths.cmake")
-```
+Note replace the version `3.0.0` with the actual Apache Celix version you want to test.
diff --git a/examples/conan_test_package_v2/conanfile.py b/examples/conan_test_package_v2/conanfile.py
index 4e3394b2..ff26adfe 100644
--- a/examples/conan_test_package_v2/conanfile.py
+++ b/examples/conan_test_package_v2/conanfile.py
@@ -45,13 +45,16 @@ class TestPackageConan(ConanFile):
tc.cache_variables["TEST_PSA_TCP"] = celix_options.build_pubsub_psa_tcp
tc.cache_variables["TEST_PSA_WS"] = celix_options.build_pubsub_psa_ws
tc.cache_variables["TEST_PSA_DISCOVERY_ETCD"] = celix_options.build_pubsub_discovery_etcd
- tc.cache_variables["TEST_RSA"] = celix_options.build_remote_service_admin
- tc.cache_variables["TEST_RSA_DFI"] = celix_options.build_rsa_remote_service_admin_dfi
- tc.cache_variables["TEST_RSA_SHM_V2"] = celix_options.build_rsa_remote_service_admin_shm_v2
- tc.cache_variables["TEST_RSA_RPC_JSON"] = celix_options.build_rsa_json_rpc
- tc.cache_variables["TEST_RSA_DISCOVERY_CONFIGURED"] = celix_options.build_rsa_discovery_configured
- tc.cache_variables["TEST_RSA_DISCOVERY_ETCD"] = celix_options.build_rsa_discovery_etcd
- tc.cache_variables["TEST_RSA_DISCOVERY_ZEROCONF"] = celix_options.build_rsa_discovery_zeroconf
+
+ #TODO #509. Refactor RSA so that service_reference and hashmap are not needed anymore
+ #cmake.definitions["TEST_RSA"] = self.options["celix"].build_remote_service_admin
+ #cmake.definitions["TEST_RSA_DFI"] = self.options["celix"].build_rsa_remote_service_admin_dfi
+ #cmake.definitions["TEST_RSA_SHM_V2"] = self.options["celix"].build_rsa_remote_service_admin_shm_v2
+ #cmake.definitions["TEST_RSA_RPC_JSON"] = self.options["celix"].build_rsa_json_rpc
+ #cmake.definitions["TEST_RSA_DISCOVERY_CONFIGURED"] = self.options["celix"].build_rsa_discovery_configured
+ #cmake.definitions["TEST_RSA_DISCOVERY_ETCD"] = self.options["celix"].build_rsa_discovery_etcd
+ #cmake.definitions["TEST_RSA_DISCOVERY_ZEROCONF"] = self.options["celix"].build_rsa_discovery_zeroconf
+
tc.cache_variables["TEST_SHELL"] = celix_options.build_shell
if celix_options.build_shell:
tc.cache_variables["TEST_CXX_SHELL"] = celix_options.celix_cxx17 or celix_options.celix_cxx14
@@ -110,22 +113,25 @@ class TestPackageConan(ConanFile):
if celix_options.build_pubsub_discovery_etcd and celix_options.build_launcher:
self.run("./use_psa_discovery_etcd",
cwd=os.path.join("deploy", "use_psa_discovery_etcd"), env="conanrun")
- if celix_options.build_remote_service_admin:
- self.run("./use_my_rsa", cwd=os.path.join("deploy", "use_my_rsa"), env="conanrun")
- self.run("./conan_test_package/use_c_rsa_spi", env="conanrun")
- if celix_options.build_rsa_remote_service_admin_dfi and celix_options.build_launcher:
- self.run("./use_rsa_dfi", cwd=os.path.join("deploy", "use_rsa_dfi"), env="conanrun")
- if celix_options.build_rsa_remote_service_admin_shm_v2:
- self.run("./use_rsa_shm_v2", cwd=os.path.join("deploy", "use_rsa_shm_v2"), env="conanrun")
- if celix_options.build_rsa_json_rpc:
- self.run("./use_rsa_rpc_json", cwd=os.path.join("deploy", "use_rsa_rpc_json"), env="conanrun")
- if celix_options.build_rsa_discovery_configured and celix_options.build_launcher:
- self.run("./use_rsa_configured", cwd=os.path.join("deploy", "use_rsa_configured"), env="conanrun")
- if celix_options.build_rsa_discovery_etcd and celix_options.build_launcher:
- self.run("./use_rsa_etcd", cwd=os.path.join("deploy", "use_rsa_etcd"), env="conanrun")
- if celix_options.build_rsa_discovery_zeroconf:
- self.run("./use_rsa_discovery_zeroconf",
- cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), env="conanrun")
+
+ #TODO #509. Refactor RSA so that service_reference and hashmap are not needed anymore
+ # if celix_options.build_remote_service_admin:
+ # self.run("./use_my_rsa", cwd=os.path.join("deploy", "use_my_rsa"), env="conanrun")
+ # self.run("./conan_test_package/use_c_rsa_spi", env="conanrun")
+ # if celix_options.build_rsa_remote_service_admin_dfi and celix_options.build_launcher:
+ # self.run("./use_rsa_dfi", cwd=os.path.join("deploy", "use_rsa_dfi"), env="conanrun")
+ # if celix_options.build_rsa_remote_service_admin_shm_v2:
+ # self.run("./use_rsa_shm_v2", cwd=os.path.join("deploy", "use_rsa_shm_v2"), env="conanrun")
+ # if celix_options.build_rsa_json_rpc:
+ # self.run("./use_rsa_rpc_json", cwd=os.path.join("deploy", "use_rsa_rpc_json"), env="conanrun")
+ # if celix_options.build_rsa_discovery_configured and celix_options.build_launcher:
+ # self.run("./use_rsa_configured", cwd=os.path.join("deploy", "use_rsa_configured"), env="conanrun")
+ # if celix_options.build_rsa_discovery_etcd and celix_options.build_launcher:
+ # self.run("./use_rsa_etcd", cwd=os.path.join("deploy", "use_rsa_etcd"), env="conanrun")
+ # if celix_options.build_rsa_discovery_zeroconf:
+ # self.run("./use_rsa_discovery_zeroconf",
+ # cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), env="conanrun")
+
if celix_options.build_shell:
self.run("./conan_test_package/use_shell", env="conanrun")
if celix_options.celix_cxx17 or celix_options.celix_cxx14: