Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More ADM objects and fixing exec test fixture #94

Open
wants to merge 19 commits into
base: apl-fy24
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
596bf7e
Adding implementation of more Agent ADM objects and fixing parameter …
BrianSipos Dec 17, 2024
514fe40
Implementing more base agent objects
BrianSipos Dec 18, 2024
8cfd3c7
Fix formatting
BrianSipos Dec 18, 2024
ca959b4
More ADM objects via CAMP and fixing test_exec logic
BrianSipos Dec 23, 2024
5ad2170
Merge remote-tracking branch 'origin/apl-fy24' into 76-base-adm-objects
BrianSipos Dec 23, 2024
b0a2f32
Properly handle expected expand failure in test fixture
BrianSipos Dec 23, 2024
6897392
Merge remote-tracking branch 'origin/apl-fy24' into 76-base-adm-objects
BrianSipos Dec 23, 2024
2133577
Implemented the wait_util CTRL and refactored base ARI between lit/re…
BrianSipos Dec 23, 2024
d74b82f
Adding user API
BrianSipos Dec 23, 2024
7efd74b
Adding debug-friendly names for AMM types. Checking CTRL result type …
BrianSipos Dec 27, 2024
e08a444
Fixing unit test fixture
BrianSipos Dec 27, 2024
91e12c9
Adding check-type-at-set-result for EDD production similar to CTRL re…
BrianSipos Dec 27, 2024
c915fc4
Refactored AMM type matching output to be more expressive
BrianSipos Dec 31, 2024
348d685
Fixed memory leak when using bad ari_tree logic
BrianSipos Dec 31, 2024
b7413e2
Implementing more Agent ADM controls
BrianSipos Jan 2, 2025
ca4dea7
fix format
BrianSipos Jan 2, 2025
be3f611
Merge remote-tracking branch 'origin/apl-fy24' into 76-base-adm-objects
BrianSipos Jan 2, 2025
5924446
Fixing ARI container handling
BrianSipos Jan 3, 2025
0b1eb5d
Merge branch 'apl-fy24' into 76-base-adm-objects
BrianSipos Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ set(HFILES
"${CMAKE_CURRENT_SOURCE_DIR}/util/daemon_run.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/type.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/lit.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/ref.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/base.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/algo.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ari/containers.h"
Expand Down Expand Up @@ -56,6 +58,8 @@ set(CFILES
"util/threadset.c"
"util/daemon_run.c"
"ari/type.c"
"ari/lit.c"
"ari/ref.c"
"ari/base.c"
"ari/algo.c"
"ari/containers.c"
Expand Down Expand Up @@ -119,6 +123,7 @@ target_include_directories(
target_link_libraries(cace PUBLIC ${FLEX_LIBRARIES})
target_link_libraries(cace PUBLIC MLIB::mlib)
target_link_libraries(cace PUBLIC qcbor)
target_link_libraries(cace PUBLIC timespec::timespec)
target_link_libraries(cace PUBLIC m)
if(PCRE_FOUND)
target_link_libraries(cace PUBLIC PkgConfig::PCRE)
Expand Down
33 changes: 32 additions & 1 deletion src/cace/amm/parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/
#include "parameters.h"
#include "cace/ari/text.h"
#include "cace/util/defs.h"
#include "cace/util/logging.h"

Expand Down Expand Up @@ -114,23 +115,53 @@ int cace_amm_actual_param_set_populate(cace_ari_itemized_t *obj, const cace_amm_
cace_amm_formal_param_list_next(fit), ++pix)
{
const cace_amm_formal_param_t *fparam = cace_amm_formal_param_list_cref(fit);
CACE_LOG_DEBUG("converting formal parameter #%d \"%s\"", fparam->index, string_get_cstr(fparam->name));
if (cace_log_is_enabled_for(LOG_DEBUG))
{
ari_t ariname = ARI_INIT_UNDEFINED;
amm_type_get_name(&(fparam->typeobj), &ariname);

string_t buf;
string_init(buf);
ari_text_encode(buf, &ariname, ARI_TEXT_ENC_OPTS_DEFAULT);
CACE_LOG_DEBUG(" type %s", string_get_cstr(buf));
string_clear(buf);
ari_deinit(&ariname);
}

ari_t *aparam = ari_array_get(obj->ordered, pix);
named_ari_ptr_dict_set_at(obj->named, string_get_cstr(fparam->name), aparam);

if (ari_list_end_p(gparam_it))
{
// no given parameter
CACE_LOG_DEBUG("no given parameter");
ari_set_copy(aparam, &(fparam->defval));
}
else
{
const ari_t *gparam = ari_list_cref(gparam_it);
if (cace_log_is_enabled_for(LOG_DEBUG))
{
string_t buf;
string_init(buf);
ari_text_encode(buf, gparam, ARI_TEXT_ENC_OPTS_DEFAULT);
CACE_LOG_DEBUG(" given parameter %s", string_get_cstr(buf));
string_clear(buf);
}
if (amm_type_convert(&(fparam->typeobj), aparam, gparam))
{
CACE_LOG_WARNING(" given parameter failed to convert");
retval = 2;
break;
}
if (cace_log_is_enabled_for(LOG_DEBUG))
{
string_t buf;
string_init(buf);
ari_text_encode(buf, aparam, ARI_TEXT_ENC_OPTS_DEFAULT);
CACE_LOG_DEBUG(" actual parameter %s", string_get_cstr(buf));
string_clear(buf);
}

ari_list_next(gparam_it);
}
Expand Down
Loading
Loading