Skip to content

Commit

Permalink
tests: fix destroy usage
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens committed Dec 5, 2024
1 parent cb0a847 commit 7505282
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Vagrant.configure("2") do |config|
# Main build
apt-get install --yes build-essential cmake dh-make git make openssl pkg-config tar
# Dependencies
apt-get install --yes libssl3 libssl-dev libsasl2-dev pkg-config libsystemd-dev zlib1g-dev libpq-dev postgresql-server-dev-all flex bison libyaml-dev libpq5
apt-get install --yes libssl3 libssl-dev libsasl2-dev pkg-config libsystemd-dev zlib1g-dev libpq-dev postgresql-server-dev-all flex bison libyaml-dev libpq5 libbpf-dev
# Debug
apt-get install --yes gdb valgrind
Expand Down
10 changes: 4 additions & 6 deletions tests/runtime/custom_calyptia_input_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ static void test_calyptia_machine_id_generation() {
TEST_CHECK(new_machine_id != NULL);
TEST_MSG("machine_id changed, expected=%s got=%s", machine_id, new_machine_id);
TEST_CHECK(value && strcmp(new_machine_id, machine_id) == 0);
flb_free(new_machine_id);
new_machine_id = NULL;
flb_sds_destroy(new_machine_id);

/* repeat with new config directory */
t_ctx = update_config_dir(t_ctx, "/tmp/config/fleet");
Expand All @@ -263,18 +262,17 @@ static void test_calyptia_machine_id_generation() {
TEST_MSG("machine_id did not change, expected!=%s got=%s", machine_id, new_machine_id);
TEST_CHECK(new_machine_id && strcmp(new_machine_id, machine_id) != 0);

flb_free(machine_id);
flb_sds_destroy(machine_id);
machine_id = new_machine_id;
new_machine_id = NULL;

/* repeat to confirm existing UUID is maintained */
new_machine_id = get_machine_id(t_ctx->ctx);
TEST_CHECK(new_machine_id != NULL);
TEST_MSG("machine_id changed, expected=%s got=%s", machine_id, new_machine_id);
TEST_CHECK(new_machine_id && strcmp(new_machine_id, machine_id) == 0);

flb_free(new_machine_id);
flb_free(machine_id);
flb_sds_destroy(new_machine_id);
flb_sds_destroy(machine_id);
cleanup_test_context(t_ctx);
}

Expand Down

0 comments on commit 7505282

Please sign in to comment.