From aa4695f06a86073a0c7b4b5fc04a31c897de8ce1 Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Thu, 25 Jul 2024 19:40:09 +0200 Subject: [PATCH 01/15] docu: Move ADR 'source verification' to separate file. --- doc/source/index.rst | 1 + documentation/adr/ADR_template.md | 81 ++++++++++++++ documentation/adr/index.rst | 30 ++++++ documentation/adr/source_verification.md | 123 ++++++++++++++++++++++ documentation/developer.md | 128 ----------------------- 5 files changed, 235 insertions(+), 128 deletions(-) create mode 100644 documentation/adr/ADR_template.md create mode 100644 documentation/adr/index.rst create mode 100644 documentation/adr/source_verification.md diff --git a/doc/source/index.rst b/doc/source/index.rst index 7fe4df3..b1b871d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,6 +14,7 @@ Welcome to samconf's documentation! demo samconf API generated/developer/index + ADRs <../../documentation/adr/index> Indices and tables ================== diff --git a/documentation/adr/ADR_template.md b/documentation/adr/ADR_template.md new file mode 100644 index 0000000..6d81e5d --- /dev/null +++ b/documentation/adr/ADR_template.md @@ -0,0 +1,81 @@ +# Design Decisions - + +## Problem + + + +## Influencing factors + +The following constraints have to be taken into account for a suitable solution: +* +* + + + +## Assumptions + +The following assumptions have been made in the decision process: +* +* + + + +## Considered Alternatives + +### 1) + +Description of this alternative. + +*pros* +* +** But: +* +** But: + +*cons* +* +** But: +* +** But: + +### 2) + +Description of this alternative. + +*pros* +* +** But: +* +** But: + +*cons* +* +** But: +* +** But: + +### 3) + +Description of this alternative. + +*pros* +* +** But: +* +** But: + +*cons* +* +** But: +* +** But: + +## Decision + +Alternative 42 is taken. + +### Rationale + +### Open Points + +if something was left open after this decision diff --git a/documentation/adr/index.rst b/documentation/adr/index.rst new file mode 100644 index 0000000..13da289 --- /dev/null +++ b/documentation/adr/index.rst @@ -0,0 +1,30 @@ +Architecture Design Records +=========================== + +During the development of samconf, decisions have to be made. This chapter +provides a place to collect new ideas and discuss them until we are able to +agree on a final decision for a topic. + + +An *Architecture Design Record* (**ADR**) should follow roughly the pattern + +* Problem Description +* Influencing factors +* Assumptions +* Considered Alternatives +* Decision + * Rational + * Open Points + +There is an ADR-Template :doc:`ADR_template` which can be started with. + + +List of ADRs +------------ + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + ./ADR_template + ./source_verification.md diff --git a/documentation/adr/source_verification.md b/documentation/adr/source_verification.md new file mode 100644 index 0000000..c849818 --- /dev/null +++ b/documentation/adr/source_verification.md @@ -0,0 +1,123 @@ +# ADR - Verification of a configuration source + +The content of a configuration source shall be verified by a signature method +to verify its integrity and origin. + +## Requirements and Constraints + +The verification process shall cover the following requirements and constraints: + +* The verification shall be based on the content of a file +* The signature can be provided by the file or separately (still to discuss) +* The signature is always applied to the entire content of a file, no + mixed usage of signed and unsigned content in the same configuration source +* The implementation shall allow mixed usage of signed and unsigned content for + different configuration sources +* The signature process itself shall not be implemented by samconf, it is + planned to delegate this via an external crypto API to some sort of dedicated + external crypto component +* The concept shall be extensible to support encrypted configuration sources in future + +## The signature + +For the signature the following requirements shall be met: + +* To be future-proof the signature shall contain information about the + signature mechanism to use. +* The signature shall be in a format that can be easily attached to a file + without causing problems about used characters + +To make a signature self explanatory it shall use a URI like syntax as follows: + +``` +signature_method://signature_payload +sha1://f0f8f92add392aff18dedad014732fc1dfb4427e +md5://9ce83ff3647269cf3b341824e243a25f +x509://RHVtbXkgY2VydCA6KQo= +http://external.verify.myconfig.somwhere/signature/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== +unix+tcp:///run/cryptoservice.sock/signature/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== +file:///dev/special_crypto_device/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== +``` + +The signature has to be stored somewhere with a reference to the corresponding +file. The following options are considered : + +* A) append / prepend to a file +``` +signature_method://signature_payload +{ + "option": {...}, +... +} +signature_method://signature_payload +``` +* B) encode in the file name +``` +/etc/myservice.d/feature_c2hhMTovL2YwZjhmOTJhZGQzOTJhZmYxOGRlZGFkMDE0NzMyZmMxZGZiNDQyN2UK.conf +``` +* C) in a separate file +``` +/etc/myservice.d/feature.conf /etc/myservice.d/feature.sig +``` +* D) in a signature DB obtained from a file or a local service +``` +/etc/myservice.d/feature.conf +cat /etc/signature.db + /etc/myservice.d/feature.conf sha1://f0f8f92add392aff18dedad014732fc1dfb4427e + +curl http://localhost:44444/etc/myservice.d/feature.conf +200 OK +... +/etc/myservice.d/feature.conf sha1://f0f8f92add392aff18dedad014732fc1dfb4427e +``` +* E) in a extended file attribute + * two usable namespaces `trusted` and `user` + * either read and write by everyone (`user`) or only root user (`trusted`) +``` +# only by root modifyable 'trusted' namespace +sudo setfattr -n trusted.signature -v "sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" /etc/myservice.d/feature.conf +# only by root readable 'trusted' namespace +sudo getfattr -n trusted.signature /etc/myservice.d/feature.conf +# file: /etc/myservice.d/feature.conf +trusted.signature="sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" + +setfattr -n user.signature -v "sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" /etc/myservice.d/feature.conf +getfattr -n user.signature /etc/myservice.d/feature.conf +# file: /etc/myservice.d/feature.conf +user.signature="sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" +``` + +| Method | pro | con | +|--------|----------------|-----| +| A | simple | can confuse tools which are not aware of this additional content, i.e. xml,json parser | +| B | simple | names will become extremely large, which is unusual or unexpected and can cause trouble | +| C | simple, signature size and format not limited | noisy in the file system; need to sync the contents of two files | +| D | central independent place, flexible and extensible, control of signature is separated | additional service API necessary, not self contained | +| E | not visible, access can be restricted to root by using 'trusted' namespace, it reads like it is made for this | filesystem must support xattr and signature size must be < 4k depending on the filesystem even smaller, needs extra caution on coping file '-a'| + +To be future proof the process of obtaining the signature string for a +configuration source shall be a implementation detail of the configuration +backend. A backend can use a common component to lookup the signature string +but is not enforced to do so. + +### Decision + +Variant C is used. + +## how to protect against loading self signed or not intended signed configs? + +The config verification process must ensure that no signed configs can be +introduced which for example are copied from a different system in debug mode. + +* The signature shall somehow include or bound to the specific hardware, the + machine aka. hardware-id is a promising candidate for this +``` +signature = sign(Config + hardwareID) +``` +* The process shall ensure that options from a signed source are not + overwritten by one from an unsigned source, to prevent enabling debug mode or + similar by just adding self signed config files. To prevent this each option + shall have a flag `isSigned`, this flag will be set by the configuration + backend if the option is read from a signed and successfully verified source. + An option with a signed flag has always precedence and will overwrite any + other option. An option with a sign flag can not be overwritten. diff --git a/documentation/developer.md b/documentation/developer.md index 74e62b2..18dcf9d 100644 --- a/documentation/developer.md +++ b/documentation/developer.md @@ -7,134 +7,6 @@ This library has the following main tasks: parameters, environment and compile/buildin configurations. * Transparently verify signed configurations -## Verification of a configuration source - -The content of a configuration source shall be verified by a signature method -to verify its integrity and origin. - -### requirements and constraints - -The verification process shall cover the following requirements and constraints: - -* The verification shall be based on the content of a file -* The signature can be provided by the file or separately (still to discuss) -* The signature is always applied to the entire content of a file, no - mixed usage of signed and unsigned content in the same configuration source -* The implementation shall allow mixed usage of signed and unsigned content for - different configuration sources -* The signature process itself shall not be implemented by samconf, it is - planned to delegate this via an external crypto API to some sort of dedicated - external crypto component -* The concept shall be extensible to support encrypted configuration sources in future - -### basic concept - -The content of a file, the configuration source, is read and validated together -with a signature through a external signature verification process. - - -#### The signature - -For the signature the following requirements shall be met: - -* To be future-proof the signature shall contain information about the - signature mechanism to use. -* The signature shall be in a format that can be easily attached to a file - without causing problems about used characters - -To make a signature self explanatory it shall use a URI like syntax as follows: - -``` -signature_method://signature_payload -sha1://f0f8f92add392aff18dedad014732fc1dfb4427e -md5://9ce83ff3647269cf3b341824e243a25f -x509://RHVtbXkgY2VydCA6KQo= -http://external.verify.myconfig.somwhere/signature/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== -unix+tcp:///run/cryptoservice.sock/signature/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== -file:///dev/special_crypto_device/c29tZSBhcmJpdHJhcnkgc2lnbmF0dXJlIGluZm9ybWF0aW9uCg== -``` - -The signature has to be stored somewhere with a reference to the corresponding -file. The following options are considered : - -* A) append / prepend to a file -``` -signature_method://signature_payload -{ - "option": {...}, -... -} -signature_method://signature_payload -``` -* B) encode in the file name -``` -/etc/myservice.d/feature_c2hhMTovL2YwZjhmOTJhZGQzOTJhZmYxOGRlZGFkMDE0NzMyZmMxZGZiNDQyN2UK.conf -``` -* C) in a separate file -``` -/etc/myservice.d/feature.conf /etc/myservice.d/feature.sig -``` -* D) in a signature DB obtained from a file or a local service -``` -/etc/myservice.d/feature.conf -cat /etc/signature.db - /etc/myservice.d/feature.conf sha1://f0f8f92add392aff18dedad014732fc1dfb4427e - -curl http://localhost:44444/etc/myservice.d/feature.conf -200 OK -... -/etc/myservice.d/feature.conf sha1://f0f8f92add392aff18dedad014732fc1dfb4427e -``` -* E) in a extended file attribute - * two usable namespaces `trusted` and `user` - * either read and write by everyone (`user`) or only root user (`trusted`) -``` -# only by root modifyable 'trusted' namespace -sudo setfattr -n trusted.signature -v "sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" /etc/myservice.d/feature.conf -# only by root readable 'trusted' namespace -sudo getfattr -n trusted.signature /etc/myservice.d/feature.conf -# file: /etc/myservice.d/feature.conf -trusted.signature="sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" - -setfattr -n user.signature -v "sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" /etc/myservice.d/feature.conf -getfattr -n user.signature /etc/myservice.d/feature.conf -# file: /etc/myservice.d/feature.conf -user.signature="sha1://f0f8f92add392aff18dedad014732fc1dfb4427e" -``` - -| Method | pro | con | -|--------|----------------|-----| -| A | simple | can confuse tools which are not aware of this additional content, i.e. xml,json parser | -| B | simple | names will become extremely large, which is unusual or unexpected and can cause trouble | -| C | simple, signature size and format not limited | noisy in the file system; need to sync the contents of two files | -| D | central independent place, flexible and extensible, control of signature is separated | additional service API necessary, not self contained | -| E | not visible, access can be restricted to root by using 'trusted' namespace, it reads like it is made for this | filesystem must support xattr and signature size must be < 4k depending on the filesystem even smaller, needs extra caution on coping file '-a'| - -To be future prove the process of obtaining the signature string for a -configuration source shall be a implementation detail of the configuration -backend. A backend can use a common component to lookup the signature string -but is not enforced to do so. - - - -### how to protect against loading self signed or not intended signed configs? - -The config verification process must ensure that no signed configs can be -introduced which for example are copied from a different system in debug mode. - -* The signature shall somehow include or bound to the specific hardware, the - machine aka. hardware-id is a promising candidate for this -``` -signature = sign(Config + hardwareID) -``` -* The process shall ensure that options from a signed source are not - overwritten by one from an unsigned source, to prevent enabling debug mode or - similar by just adding self signed config files. To prevent this each option - shall have a flag `isSigned`, this flag will be set by the configuration - backend if the option is read from a signed and successfully verified source. - An option with a signed flag has always precedence and will overwrite any - other option. An option with a sign flag can not be overwritten. - ## Internal Representation From 3b9e6c005c5c6a2907917a31303f3bd6ba486e1c Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Thu, 25 Jul 2024 20:17:50 +0000 Subject: [PATCH 02/15] doc: Refactor docu build system and structure. --- ci/Dockerfile | 1 + ci/build_doc.sh | 79 +++++++++++++++++++------------ doc/source/conf.py => conf.py | 18 +++---- doc/source/demo.rst | 1 - doc/source/index.rst => index.rst | 14 ++++-- src/demo/index.rst | 2 +- 6 files changed, 72 insertions(+), 43 deletions(-) rename doc/source/conf.py => conf.py (79%) delete mode 100644 doc/source/demo.rst rename doc/source/index.rst => index.rst (55%) diff --git a/ci/Dockerfile b/ci/Dockerfile index 4c12a2b..518b9ee 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -78,6 +78,7 @@ RUN python -m venv /home/$USER/.venv \ && python -m pip install \ beautifulsoup4==4.12.2 \ clang==16.0.1.1 \ + myst-parser==2.0.0 \ sphinx==7.2.6 \ sphinx-c-autodoc==1.3.0 \ sphinx-copybutton==0.5.2 \ diff --git a/ci/build_doc.sh b/ci/build_doc.sh index ff80818..a3af6e8 100755 --- a/ci/build_doc.sh +++ b/ci/build_doc.sh @@ -1,14 +1,43 @@ #!/bin/bash -eu - CMD_PATH="$(realpath "$(dirname "$0")")" BASE_DIR="$(realpath "$CMD_PATH/..")" +function printHelp() { + echo "Usage: $0 [options]" + echo "Options:" + echo -e "\t -c\t\tclean output directory and generated files before building" + echo -e "\t -h\t\tprint this help and exit" +} + +PARAM="" +OPTION_CLEAN=0 +for element in $@; do + case $element in + --clean|-c) + OPTION_CLEAN=1 ;; + --help|-h) + printHelp + exit 0 ;; + -*) + echo "error: unknown option: ${element}" + printHelp + exit 1 ;; + *) PARAM="$PARAM $element" ;; + esac +done + +set -- $PARAM +BUILD_TYPE="${1:-Release}" +BUILD_DIR="$BASE_DIR/build/$BUILD_TYPE" +DIST_DIR="$BUILD_DIR/dist" + MD_DOCUMENTAION_DIR="${BASE_DIR}/documentation" SAMCONF_SOURCE_SOURCE_DIR="${BASE_DIR}/src" -SPHINX_SOURCE_DIR="${BASE_DIR}/doc/source" -SPHINX_BUILD_DIR="${BASE_DIR}/build/doc" -SPHINX_GENERATED_SOURCE_DIR="${BASE_DIR}/doc/source/generated" +SPHINX_SOURCE_DIR=${BASE_DIR} +SPHINX_BUILD_DIR=${BUILD_DIR}/doc +SPHINX_GENERATED_SOURCE_DIR=${SPHINX_BUILD_DIR}/source_generated +SPHINX_HTML_OUTPUT_DIR=${SPHINX_BUILD_DIR}/html . "${SPHINX_VENV-${BASE_DIR}/.venv/}/bin/activate" @@ -19,36 +48,14 @@ function createApiDocu() { sphinx-c-apidoc --force \ -o "${SPHINX_GENERATED_SOURCE_DIR}/api/" \ --tocfile index \ - "${SAMCONF_SOURCE_SOURCE_DIR}/samconf/public" + "${SAMCONF_SOURCE_SOURCE_DIR}/samconf/" } function createDeveloperDocu() { - cp -r "${MD_DOCUMENTAION_DIR}/images" "${SPHINX_GENERATED_SOURCE_DIR}/developer/" - pandoc --from gfm --to rst \ - -o "${SPHINX_GENERATED_SOURCE_DIR}/developer/DeveloperManual.rst" \ - "${MD_DOCUMENTAION_DIR}/developer.md" - pandoc --from gfm --to rst \ - -o "${SPHINX_GENERATED_SOURCE_DIR}/developer/documentation.rst" \ - "${MD_DOCUMENTAION_DIR}/documentation.md" - sphinx-c-apidoc --force \ -o "${SPHINX_GENERATED_SOURCE_DIR}/developer/api/" \ --tocfile index \ - "${BASE_DIR}/test/utest/utils/public" - - echo -e " -Developer documentation -========================== - -.. toctree:: - :maxdepth: 1 - :caption: Contents: - - DeveloperManual - documentation - API - -" > "${SPHINX_GENERATED_SOURCE_DIR}/developer/index.rst" + "${BASE_DIR}/test/utest/utils/" } createApiDocu @@ -56,4 +63,18 @@ createDeveloperDocu export PATH="${PATH}:${BASE_DIR}/build/Release/dist/usr/local/bin" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH-"./"}:${BASE_DIR}/build/Release/dist/usr/local/lib" -sphinx-build -b html "${SPHINX_SOURCE_DIR}" "${SPHINX_BUILD_DIR}" + +sphinx-build -b html ${SPHINX_SOURCE_DIR} ${SPHINX_HTML_OUTPUT_DIR} 2> ${SPHINX_BUILD_DIR}/html_doc_error.log +if [ $? -ne 0 ]; then + echo "Build failed, for details see ${SPHINX_BUILD_DIR}/html_doc_error.log" + exit 1 +fi + +WARNINGS=$(grep -e ": WARNING:" -e ": ERROR:" ${SPHINX_BUILD_DIR}/html_doc_error.log | wc -l) +if [ ${WARNINGS} -ne 0 ]; then + echo "" + echo "Build warnings ${WARNINGS}" + echo "" + cat ${SPHINX_BUILD_DIR}/html_doc_error.log + exit 1 +fi diff --git a/doc/source/conf.py b/conf.py similarity index 79% rename from doc/source/conf.py rename to conf.py index ee497f5..629b3c6 100644 --- a/doc/source/conf.py +++ b/conf.py @@ -14,6 +14,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ + 'myst_parser', 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinxcontrib.programoutput', @@ -29,22 +30,23 @@ 'sphinx_c_autodoc.viewcode', ] -templates_path = ['_templates'] -exclude_patterns = [] - +templates_path = ['doc/_templates'] +exclude_patterns = ['build/deps/**', 'build/*/cmake/_deps/*', 'README.md', '.venv', 'debian.native/devdoc-index.md'] +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} language = 'en' # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = 'alabaster' -html_static_path = ['_static'] +html_static_path = ['doc/source/_static'] # c-autodoc c_autodoc_roots = [ - '../../src/samconf/private', - '../../src/samconf/public', - '../../test/utest/utils/public', - '../../test/utest/utils/private', + 'src/samconf', + 'test/utest/utils', ] set_type_checking_flag = True diff --git a/doc/source/demo.rst b/doc/source/demo.rst deleted file mode 100644 index 0f5500a..0000000 --- a/doc/source/demo.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../src/demo/index.rst diff --git a/doc/source/index.rst b/index.rst similarity index 55% rename from doc/source/index.rst rename to index.rst index b1b871d..d5f355a 100644 --- a/doc/source/index.rst +++ b/index.rst @@ -11,10 +11,16 @@ Welcome to samconf's documentation! :caption: Contents: - demo - samconf API - generated/developer/index - ADRs <../../documentation/adr/index> + ci/index.rst + cmake/index.rst + .github/index.rst + src/demo/index.rst + debian.native/README.md + samconf API + developer API + documentation/developer.md + documentation/documentation.md + ADRs Indices and tables ================== diff --git a/src/demo/index.rst b/src/demo/index.rst index bf158e9..ce41ded 100644 --- a/src/demo/index.rst +++ b/src/demo/index.rst @@ -11,5 +11,5 @@ to check and query config files. To verify a config file : -.. command-output:: samprobe ../../test/smoketest/config.json +.. command-output:: samprobe /test/smoketest/config.json From db33aff6aa53d6dc44c039aed10afd03e0fe3a69 Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Thu, 25 Jul 2024 22:30:16 +0200 Subject: [PATCH 03/15] doc: Extend documentation about merging configurations. --- documentation/developer.md | 181 ++++++++++++++++++++++++++++--------- 1 file changed, 139 insertions(+), 42 deletions(-) diff --git a/documentation/developer.md b/documentation/developer.md index 18dcf9d..0a1a104 100644 --- a/documentation/developer.md +++ b/documentation/developer.md @@ -8,9 +8,7 @@ This library has the following main tasks: * Transparently verify signed configurations -## Internal Representation - -### General Structure +## General Structure The configuration is held in a tree structure. Each tree node is of type `samconfConfig_t`. A node can hold a value of a certain type defined by its type @@ -26,13 +24,7 @@ This structure allows a hierarchical ordering of configuration options. The foll Each node can be addressed by a _xpath_ like notation. The option _SyslogPath_ of the _Syslog-Scanner_ is for example ``/elos/scanner/syslog/SyslogPath``. -### Combined from different Sources - -The tree structure allows easy extension of a basic configuration or merging of an -arbitrary number of configurations. Thus a configuration tree can consist of nodes from different sources. Since -the goal of this library is the comfortable **reading** access to different configuration formats, there is no reference to the original source in a node of a tree. This also eases the merging of two trees. - -### From Configuration Source to Configuration +## From Configuration Source to Configuration The _samconf_ library shall support different types of sources for configuration options and provided a unified interface to access them. The following diagram @@ -58,7 +50,7 @@ samconfConfig_t tree. The process of loading a configuration from and building a configuration tree from an arbitrary configuration source shall be done by the ConfigurationFactory component. -#### The Configuration Factory +### The Configuration Factory The _Configuration Factory_ shall provide an interface to abstract the details of creating a `samconfConfig_t` configuration tree, therefore it shall fullfill the following requirements: @@ -102,7 +94,7 @@ typedef struct samconfConfigBackend { An implementation for a specific configuration source shall implement the above functions, which can then be used by the _Configuration Factory_ to parse a configuration. -#### Types of Configuration Sources +### Types of Configuration Sources The following sources for configuration options shall be provided: @@ -111,7 +103,7 @@ The following sources for configuration options shall be provided: * JSON file * Compiled in configuration -##### Parameter Source +#### Parameter Source A configuration option shall be passed to a program as parameter. The parsing and the format of such parameter shall be follow the format accepted by @@ -136,7 +128,7 @@ B) a set of parameter is mapped statically in the code to a full qualified name In either case the following rules shall be applied to set the different types of values: -###### Boolean +##### Boolean * if a parameter is specified the corresponding option value shall be true otherwise false * if a parameter is set explicitly to true or false the corresponding value shall be used for the corresponding option @@ -146,7 +138,7 @@ In either case the following rules shall be applied to set the different types o -/--itemB=false => root/categoryB/itemB = false ``` -###### Integer +##### Integer If a parameter provides an integer value it shall be converted to the configuration option type and used. @@ -155,7 +147,7 @@ If a parameter provides an integer value it shall be converted to the configurat -/--itemA 42 => /root/categoryA/itemA = 42 ``` -###### Real +##### Real If a parameter provides a real value it shall be converted to the configuration option type and used. @@ -164,7 +156,7 @@ If a parameter provides a real value it shall be converted to the configuration -/--itemA 42.3 => /root/categoryA/itemA = 42.3 ``` -###### String +##### String If a parameter provides a string value it shall be used. @@ -173,63 +165,98 @@ If a parameter provides a string value it shall be used. -/--subItem "the value of a configuration option" => /root/categoryA/itemA/subItem = "the value of a configuration option" ``` -##### Environment Source +#### Environment Source -To integrate environment configuration options into a `samconfConfig_t` tree, the issue to solve is where to insert the parameter into the configuration tree. There two possible solutions: +To load a configuration from an environment into a `samconfConfig_t` tree, the +Option path must be encoded in the environment variable name. Given a config +path like `/myApp/network/port` would translate to `myApp_network_port`. -A) the environment variable name must be structured like a full qualified name `--app.categoryA.itemA.subItem "the value of a configuration option"` -B) a set of parameter is mapped statically in the code to a full qualified name by the parameter loader for example. +An example environment config could then look like: ``` -$> app -p 42 --ItemB +myApp_network_port = 33333 +myApp_network_interface = "0.0.0.0" +myApp_network_enable = true ``` -this will results in two options (key value pairs): +Environment variables can have the following types: -``` -root.categoryA.itemA = 42 -root.categoryB.itemB = true -``` +##### Boolean -In either case the following rules shall be applied to set the different types of values: - -###### Boolean +If a environment parameter contains the string `true` or `false` the +corresponding value of `SAMCONF_CONFIG_VALUE_BOOLEAN` shall be used. The +strings `true` or `false` are accepted and mapped case insensitive. +Surrounding white spaces shall be stripped. -If a environment is set to true or false the corresponding value shall be used -for the corresponding option. If the value of an environment variable can not -be mapped, it shall be ignored and can optionally be reported via a log -message. The variable name shall be uppercase and the environment loader shall be case sensitive. +If the value can not be mapped, the config option shall be set to +SAMCONF_CONFIG_INVALID_TYPE and the value is undefined. ``` ITEM_B="true" => /root/categoryB/itemB = true ITEM_B="false" => /root/categoryB/itemB = false +ITEM_B="invalid value" => /root/categoryB/itemB = undefined ``` -###### Integer +##### Integer -If a parameter provides an integer value it shall be converted to the configuration option type and used. +If a parameter provides an integer value it shall be converted to the +configuration option type and used. Surrounding white spaces shall be stripped. + +If the value can not be mapped, the config option shall be set to +SAMCONF_CONFIG_INVALID_TYPE and the value is undefined. ``` ITEM_A=42 => /root/categoryA/itemA = 42 +ITEM_A="not a numer" => /root/categoryA/itemA = undefined ``` -###### Real +##### Real -If a parameter provides a real value it shall be converted to the configuration option type and used. +If a parameter provides a real value it shall be converted to the configuration +option type and used. Surrounding white spaces shall be stripped. + +If the value can not be mapped, the config option shall be set to +SAMCONF_CONFIG_INVALID_TYPE and the value is undefined. ``` ITEM_A=42.3 => /root/categoryA/itemA = 42.3 +ITEM_A="not a number" => /root/categoryA/itemA = undefined ``` -###### String +##### String -If a parameter provides a string value it shall be used. +If a parameter the value is not a string representing a boolean, integer, real +or array the value it shall be used as it is. + +If the environment variable is empty an empty string is used. + +If the value can not be mapped, the config option shall be set to +SAMCONF_CONFIG_INVALID_TYPE and the value is undefined. ``` SUBITEM="string value" => /root/categoryA/itemA/subItem = "string value" +SUBITEM= => /root/categoryA/itemA/subItem = "" +ITEM_A="value can not be mapped" => /root/categoryA/itemA = undefined ``` -##### JSON File Source +##### Array + +If a parameter provides an array it shall be converted into a configuration +node of type array and its elements added as child nodes. +Arrays are ',' separated strings and can consist of the other primitive types +boolean, integer, real or string. White spaces around the separator are +stripped. Arrays of mixed types are not supported. + +If the value can not be mapped, the config option shall be set to +SAMCONF_CONFIG_INVALID_TYPE and the value is undefined. + +``` +SUBITEM="array" => /root/categoryA/itemA/subItem = "1,2,3,4" +SUBITEM="array" => /root/categoryA/itemA/subItem = "red, green, blue" +SUBITEM="array" => /root/categoryA/itemA/subItem = "true, false, true" +``` + +#### JSON File Source The information from a JSON file is transformed in to a configuration by using the JSON object composition structure. @@ -258,7 +285,7 @@ will be transformed in: ![samconfConfig_t tree](images/config_from_json_example.png "samconfConfig_t tree") -##### Compiled in Source +#### Compiled in Source It shall be possible to integrate a compiled in configuration tree. So it is possible to provide compiled in defaults for configuration options. To be convenient a the confiuration values shall be privided in a static definable way like: @@ -275,6 +302,76 @@ struct samconfbuildInConfig { }; ``` +## Merge multiple Config-Trees + +The tree structure allows easy extension of a basic configuration or merging of an +arbitrary number of configurations. Thus a configuration tree can consist of +nodes from different sources. + +Merging of two or more configs need: + +* at least two `samconfConfig_t` trees +* a config path prefix for each source, to specify the mount point in the final + config tree +* a set of rules how to merge them + +The following example illustrates how to merge different configuration from +different sources. +``` +ConfigSource envSource = { + .location= "/proc/6542/environment", + .prefix = "/" +}; + +ConfigSource paramSource = { + .location= "/proc/6542/cmdline", + .prefix = "/" +}; + +ConfigSource configFileSource = { + .location= "/etc/myApp.json", + .prefix = "/" +}; + +aConfig = samconfLoad(configFileSource); +bConfig = samconfLoad(envSource); +cConfig = samconfLoad(paramSource); + +samconfConfig_t mergedConfig ={}; +samconfMerge(&mergedConfig,{aConfig,bConfig,cConfig}); + +samconfConfigGetBool("/myApp/isSomethingEnabled"); +... + +``` + +The merge process shall be fast as possible as usually configurations are read +during startup and the delay for preparing the config shall as minimal as +possible. + +The samconf merge algorithm is as follows: + +```c +function merge(configs, mergeRules) { + mergeRules = MergeRules + rootConfig = new Config + for config in configs { + for child in config.childNModes { + if (child is leaf ) { + optionPath = config.getPathPrefix() + child.getPath() + rootConfig.insertIf(optionPath, child, rules) + }else { + for child in child.childs + ... iterate trough the tree + } + + } + } + } +``` +*The algorithm in pseudo code* + + ## Public API ### Building a Configuration Tree From 5e48ef8879d45f038c3cbde0a70a222e7b05ec9a Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Mon, 5 Aug 2024 17:43:36 +0200 Subject: [PATCH 04/15] elos: Update to 0.58.0 --- cmake/project.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/project.cmake b/cmake/project.cmake index fe9f97c..226693f 100644 --- a/cmake/project.cmake +++ b/cmake/project.cmake @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -set(SAMCONF_VERSION 0.57.1) +set(SAMCONF_VERSION 0.58.0) # Attention: Aside from the version, as many things as possible in this file # should be put into functions, as this solves potential issues with commands From fd966321b3ec7fcc7fe4f3bfa49a05f8d29de6a2 Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Mon, 5 Aug 2024 17:01:10 +0200 Subject: [PATCH 05/15] Unit Tests : edit find_package cmocka_mock package - in utest cmake cmocka_mocks package is explicitly required --- test/utest/mocks/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendDelete/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendInit/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendNew/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriNew/CMakeLists.txt | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/utest/mocks/CMakeLists.txt b/test/utest/mocks/CMakeLists.txt index 807534f..0d871dd 100644 --- a/test/utest/mocks/CMakeLists.txt +++ b/test/utest/mocks/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT include(create_mock_lib.cmake) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) find_package(safu) create_mock_lib( diff --git a/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt index 4999f1e..4fe0c96 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt index 477e11f..a113f67 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt index c76876f..8237073 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt index dbc8f77..1f18038 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) find_package(json-c REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt index 6de34ea..034c4f1 100644 --- a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt index 7c2e6ac..32767cc 100644 --- a/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt index 187948c..29ee23e 100644 --- a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt b/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt index dd448df..e80f72b 100644 --- a/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt b/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt index 84e56ca..3140f9a 100644 --- a/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt index a7e6c6f..16124c5 100644 --- a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks) +find_package(cmocka_mocks REQUIRED) create_unit_test( NAME From 7b87a87344e78e130246fd858cccb35bffa4b56a Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Wed, 7 Aug 2024 15:02:17 +0200 Subject: [PATCH 06/15] elos: Update to 0.58.1 --- cmake/project.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/project.cmake b/cmake/project.cmake index 226693f..5271421 100644 --- a/cmake/project.cmake +++ b/cmake/project.cmake @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -set(SAMCONF_VERSION 0.58.0) +set(SAMCONF_VERSION 0.58.1) # Attention: Aside from the version, as many things as possible in this file # should be put into functions, as this solves potential issues with commands From ec187950da7a091e4abddcdbc79af4a4dc4470af Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 15:21:35 +0200 Subject: [PATCH 07/15] added latest version 0.54.2 to cmocka_mocks in utest find_package() --- test/utest/mocks/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendDelete/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendInit/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendNew/CMakeLists.txt | 2 +- .../samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt | 2 +- .../crypto_utils/samconfCryptoUtilsVerify/CMakeLists.txt | 2 +- .../samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt | 2 +- .../json_backend/samconfJsonBackendSupports/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt | 2 +- .../utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt | 2 +- .../samconfSignatureLoaderGetSignatureFor/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriInit/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriNew/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/utest/mocks/CMakeLists.txt b/test/utest/mocks/CMakeLists.txt index 0d871dd..8dffcc6 100644 --- a/test/utest/mocks/CMakeLists.txt +++ b/test/utest/mocks/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT include(create_mock_lib.cmake) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) find_package(safu) create_mock_lib( diff --git a/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt index 4fe0c96..2c8bd6e 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendDelete/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt index a113f67..f829cb5 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt index 8237073..1d708a4 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt b/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt index 18d0e03..d7a1353 100644 --- a/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt +++ b/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/crypto_utils/samconfCryptoUtilsVerify/CMakeLists.txt b/test/utest/samconf/crypto_utils/samconfCryptoUtilsVerify/CMakeLists.txt index 6d1b84a..e81ffa4 100644 --- a/test/utest/samconf/crypto_utils/samconfCryptoUtilsVerify/CMakeLists.txt +++ b/test/utest/samconf/crypto_utils/samconfCryptoUtilsVerify/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt b/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt index df41072..0dd8558 100644 --- a/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt +++ b/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt index d623fb4..0d745a9 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) find_package(json-c REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt index 443ca72..db71eec 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) find_package(cmocka_extensions REQUIRED) find_package(json-c REQUIRED) diff --git a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt index 1f18038..f33410f 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) find_package(json-c REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt index df95393..0124f67 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt index 034c4f1..e0783b1 100644 --- a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt index 32767cc..adcfea5 100644 --- a/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigGet/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt index 29ee23e..8f76e63 100644 --- a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt index 80e989c..0991aa1 100644 --- a/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt b/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt index bcdc3b0..a94635a 100644 --- a/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt +++ b/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt b/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt index e80f72b..2f9f8f7 100644 --- a/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriDelete/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt b/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt index 3140f9a..bb312b5 100644 --- a/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriDeleteMembers/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriInit/CMakeLists.txt b/test/utest/samconf/uri/samconfUriInit/CMakeLists.txt index 6984513..137255d 100644 --- a/test/utest/samconf/uri/samconfUriInit/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriInit/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt index 16124c5..0198022 100644 --- a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt b/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt index 0bfa75b..9bd8899 100644 --- a/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(safu REQUIRED) -find_package(cmocka_mocks REQUIRED) +find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( NAME From 2eac2ab55542a70f37edcf8f4619fae447379931 Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 16:23:32 +0200 Subject: [PATCH 08/15] added latest version 0.56.2 to safu in test and src find_package() --- src/samconf/CMakeLists.txt | 2 +- src/samconf/Config.cmake.in | 2 +- test/utest/mocks/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendInit/CMakeLists.txt | 2 +- .../config_backend/samconfConfigBackendNew/CMakeLists.txt | 2 +- .../samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt | 2 +- .../samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt | 2 +- .../samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt | 2 +- .../json_backend/samconfJsonBackendSupports/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt | 2 +- .../utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt | 2 +- .../samconfSignatureLoaderGetSignatureFor/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriNew/CMakeLists.txt | 2 +- test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt | 2 +- test/utest/utils/CMakeLists.txt | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/samconf/CMakeLists.txt b/src/samconf/CMakeLists.txt index cd5c959..fdcf61d 100644 --- a/src/samconf/CMakeLists.txt +++ b/src/samconf/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) add_library(samconf_interface INTERFACE) target_include_directories(samconf_interface diff --git a/src/samconf/Config.cmake.in b/src/samconf/Config.cmake.in index 2e1dc6d..3fa618c 100644 --- a/src/samconf/Config.cmake.in +++ b/src/samconf/Config.cmake.in @@ -1,3 +1,3 @@ @PACKAGE_INIT@ -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/samconfTargets.cmake") diff --git a/test/utest/mocks/CMakeLists.txt b/test/utest/mocks/CMakeLists.txt index 8dffcc6..f5ab558 100644 --- a/test/utest/mocks/CMakeLists.txt +++ b/test/utest/mocks/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT include(create_mock_lib.cmake) find_package(cmocka_mocks 0.54.2 REQUIRED) -find_package(safu) +find_package(safu 0.56.2 REQUIRED) create_mock_lib( NAME diff --git a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt index f829cb5..7362b7d 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendInit/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt index 1d708a4..d5d895d 100644 --- a/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt +++ b/test/utest/samconf/config_backend/samconfConfigBackendNew/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt b/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt index d7a1353..f5d5fa9 100644 --- a/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt +++ b/test/utest/samconf/crypto_utils/samconfBase64Decode/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt b/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt index 0dd8558..5aa6039 100644 --- a/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt +++ b/test/utest/samconf/crypto_utils/samconfLoadPublicKey/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt index 0d745a9..79a89da 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendClose/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(json-c REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) diff --git a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt index db71eec..f2886c2 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) find_package(cmocka_extensions REQUIRED) find_package(json-c REQUIRED) diff --git a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt index f33410f..a3e15ad 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendOpen/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(json-c REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) diff --git a/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt index 0124f67..9c00473 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendSupports/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt index e0783b1..8639354 100644 --- a/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigAdd/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt index 8f76e63..0d01ef6 100644 --- a/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigNew/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt b/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt index 0991aa1..ff4df05 100644 --- a/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfConfigSetString/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt b/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt index a94635a..13f8e10 100644 --- a/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt +++ b/test/utest/samconf/signature/samconfSignatureLoaderGetSignatureFor/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt index 0198022..9aed759 100644 --- a/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriNew/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt b/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt index 9bd8899..5ac433b 100644 --- a/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt +++ b/test/utest/samconf/uri/samconfUriPattern/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) create_unit_test( diff --git a/test/utest/utils/CMakeLists.txt b/test/utest/utils/CMakeLists.txt index cd13bf2..c289880 100644 --- a/test/utest/utils/CMakeLists.txt +++ b/test/utest/utils/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT find_package(json-c REQUIRED) -find_package(safu REQUIRED) +find_package(safu 0.56.2 REQUIRED) add_library( samconf_test_utils From edba31e06d7d8b27e1880214b11ab6319333fe88 Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 16:35:26 +0200 Subject: [PATCH 09/15] added latest version 0.56.3 to samconf in utest find_package() --- test/utest/mocks/samconf/Config.cmake.in | 2 +- test/utest/utils/Config.cmake.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utest/mocks/samconf/Config.cmake.in b/test/utest/mocks/samconf/Config.cmake.in index a7d6db0..f8bc462 100644 --- a/test/utest/mocks/samconf/Config.cmake.in +++ b/test/utest/mocks/samconf/Config.cmake.in @@ -1,4 +1,4 @@ @PACKAGE_INIT@ -find_package(samconf REQUIRED) +find_package(samconf 0.56.3 REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/mock_samconfTargets.cmake") diff --git a/test/utest/utils/Config.cmake.in b/test/utest/utils/Config.cmake.in index a6fe007..9821ba7 100644 --- a/test/utest/utils/Config.cmake.in +++ b/test/utest/utils/Config.cmake.in @@ -1,4 +1,4 @@ @PACKAGE_INIT@ -find_package(samconf REQUIRED) +find_package(samconf 0.56.3 REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/samconf_test_utilsTargets.cmake") From 21c01d7859ce57e1cd94eb809df0cc0072614f2d Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 16:45:26 +0200 Subject: [PATCH 10/15] added latest version 0.53.1 to cmocka_extensions in utest find_package() --- .../samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfGetBackendOps/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfLoad/CMakeLists.txt | 2 +- test/utest/samconf/samconf/samconfLookupBackend/CMakeLists.txt | 2 +- test/utest/unit_test.cmake | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt index f2886c2..86080dc 100644 --- a/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt +++ b/test/utest/samconf/json_backend/samconfJsonBackendLoad/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT find_package(safu 0.56.2 REQUIRED) find_package(cmocka_mocks 0.54.2 REQUIRED) -find_package(cmocka_extensions REQUIRED) +find_package(cmocka_extensions 0.53.1 REQUIRED) find_package(json-c REQUIRED) create_unit_test( diff --git a/test/utest/samconf/samconf/samconfGetBackendOps/CMakeLists.txt b/test/utest/samconf/samconf/samconfGetBackendOps/CMakeLists.txt index 20150bc..ba618ff 100644 --- a/test/utest/samconf/samconf/samconfGetBackendOps/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfGetBackendOps/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_extensions REQUIRED) +find_package(cmocka_extensions 0.53.1 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfLoad/CMakeLists.txt b/test/utest/samconf/samconf/samconfLoad/CMakeLists.txt index f4cd9b9..6289000 100644 --- a/test/utest/samconf/samconf/samconfLoad/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfLoad/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_extensions REQUIRED) +find_package(cmocka_extensions 0.53.1 REQUIRED) create_unit_test( NAME diff --git a/test/utest/samconf/samconf/samconfLookupBackend/CMakeLists.txt b/test/utest/samconf/samconf/samconfLookupBackend/CMakeLists.txt index ef9671c..2bddc32 100644 --- a/test/utest/samconf/samconf/samconfLookupBackend/CMakeLists.txt +++ b/test/utest/samconf/samconf/samconfLookupBackend/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -find_package(cmocka_extensions REQUIRED) +find_package(cmocka_extensions 0.53.1 REQUIRED) create_unit_test( NAME diff --git a/test/utest/unit_test.cmake b/test/utest/unit_test.cmake index 260b744..413fd50 100644 --- a/test/utest/unit_test.cmake +++ b/test/utest/unit_test.cmake @@ -10,7 +10,7 @@ if(NOT CMAKE_CROSSCOMPILING) else() find_package(cmocka 1.1.5 REQUIRED) endif() -find_package(cmocka_extensions REQUIRED) +find_package(cmocka_extensions 0.53.1 REQUIRED) function(create_unit_test) cmake_parse_arguments(PARSED_ARGS "" "NAME" "SOURCES;INCLUDES;LIBRARIES;DEFINITIONS" ${ARGN}) From f22200e9a119c8109c390f636a8129f7db4d2d85 Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 16:47:15 +0200 Subject: [PATCH 11/15] added REQUIRED to cmocka in utest find_package() --- test/utest/unit_test.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utest/unit_test.cmake b/test/utest/unit_test.cmake index 413fd50..11d5011 100644 --- a/test/utest/unit_test.cmake +++ b/test/utest/unit_test.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT if(NOT CMAKE_CROSSCOMPILING) - find_package(cmocka 1.1.5) + find_package(cmocka 1.1.5 REQUIRED) # get cmocka if(NOT cmocka_FOUND) message(STATUS "CMocka >=1.1.5 was not found, building static version") From c690008e70b2b77a3bd391f529a96e1fd1ac66a3 Mon Sep 17 00:00:00 2001 From: vjayaraman Date: Tue, 6 Aug 2024 17:17:27 +0200 Subject: [PATCH 12/15] usage of find_package added to cmake doc --- cmake/index.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/index.rst b/cmake/index.rst index 873fe04..bb25e3b 100644 --- a/cmake/index.rst +++ b/cmake/index.rst @@ -4,3 +4,15 @@ CMake options .. program-output:: cmake -LH 2>/dev/null | sed '0,/^-- Cache values$/d' :shell: + +Usage of find_package +===================== + +* Always specify a version. `find_package(dependecy X.Y.Z REQUIRED)` +* Specify the version used for development + + +* The version doesn't guarantee that in the future the build still works with this version. +* The version does not necessarily say the previous versions will not work. +* The version is just an indicator for later issue or bug tracking, to say: "It was developed with this version and it worked". +* Usually we always build against the latest available version of our dependencies, so we only can guarantee that the latest upstream version will work. From 2dd987176fc66290ddec716715b6764a646f2347 Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Thu, 8 Aug 2024 14:34:13 +0200 Subject: [PATCH 13/15] elos: Update to 0.58.2 --- cmake/project.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/project.cmake b/cmake/project.cmake index 5271421..18cefe0 100644 --- a/cmake/project.cmake +++ b/cmake/project.cmake @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -set(SAMCONF_VERSION 0.58.1) +set(SAMCONF_VERSION 0.58.2) # Attention: Aside from the version, as many things as possible in this file # should be put into functions, as this solves potential issues with commands From 6a971426874cb0ad2f279d0deda623ccb91c7a13 Mon Sep 17 00:00:00 2001 From: Vignesh Jayaraman Date: Fri, 9 Aug 2024 10:32:23 +0200 Subject: [PATCH 14/15] edit ci doc to mention add dependency installed binaries to path --- ci/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/index.rst b/ci/index.rst index 6521f12..4ba5098 100644 --- a/ci/index.rst +++ b/ci/index.rst @@ -100,6 +100,7 @@ and call `install_deps.py` like : SOURCES_URI=https://${GIT_USER_TOKEN}@github.com/Elektrobit/ These dependencies get installed into `build/deps/` and if provided with an URL the sources can be found in `build/deps/src`. +To use binaries installed from dependencies add `build/deps/bin` to the `PATH` environment variable. `ci/build.sh` ------------- From 6c13649001835fd436d910f8ac27f1d6a600849d Mon Sep 17 00:00:00 2001 From: Wolfgang Gehrhardt Date: Mon, 12 Aug 2024 16:16:56 +0200 Subject: [PATCH 15/15] elos: Update to 0.58.3 --- cmake/project.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/project.cmake b/cmake/project.cmake index 18cefe0..13b92c2 100644 --- a/cmake/project.cmake +++ b/cmake/project.cmake @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -set(SAMCONF_VERSION 0.58.2) +set(SAMCONF_VERSION 0.58.3) # Attention: Aside from the version, as many things as possible in this file # should be put into functions, as this solves potential issues with commands