Skip to content

Commit

Permalink
ctdb-tests: Add marshalling tests for new control
Browse files Browse the repository at this point in the history
Signed-off-by: Amitay Isaacs <[email protected]>
Reviewed-by: Martin Schwenke <[email protected]>
  • Loading branch information
amitay authored and Amitay Isaacs committed Oct 24, 2019
1 parent b71d8cd commit 36f9b49
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ctdb/tests/UNIT/cunit/protocol_test_101.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

. "${TEST_SCRIPTS_DIR}/unit.sh"

last_control=153
last_control=154

generate_control_output ()
{
Expand Down
15 changes: 15 additions & 0 deletions ctdb/tests/src/protocol_common_ctdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,12 @@ void fill_ctdb_req_control_data(TALLOC_CTX *mem_ctx,

case CTDB_CONTROL_TUNNEL_DEREGISTER:
break;

case CTDB_CONTROL_VACUUM_FETCH:
cd->data.recbuf = talloc(mem_ctx, struct ctdb_rec_buffer);
assert(cd->data.recbuf != NULL);
fill_ctdb_rec_buffer(mem_ctx, cd->data.recbuf);
break;
}
}

Expand Down Expand Up @@ -974,6 +980,10 @@ void verify_ctdb_req_control_data(struct ctdb_req_control_data *cd,

case CTDB_CONTROL_TUNNEL_DEREGISTER:
break;

case CTDB_CONTROL_VACUUM_FETCH:
verify_ctdb_rec_buffer(cd->data.recbuf, cd2->data.recbuf);
break;
}
}

Expand Down Expand Up @@ -1368,6 +1378,9 @@ void fill_ctdb_reply_control_data(TALLOC_CTX *mem_ctx,
case CTDB_CONTROL_TUNNEL_DEREGISTER:
break;

case CTDB_CONTROL_VACUUM_FETCH:
break;

}
}

Expand Down Expand Up @@ -1703,6 +1716,8 @@ void verify_ctdb_reply_control_data(struct ctdb_reply_control_data *cd,
case CTDB_CONTROL_TUNNEL_DEREGISTER:
break;

case CTDB_CONTROL_VACUUM_FETCH:
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion ctdb/tests/src/protocol_ctdb_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ PROTOCOL_CTDB4_TEST(struct ctdb_req_dmaster, ctdb_req_dmaster,
PROTOCOL_CTDB4_TEST(struct ctdb_reply_dmaster, ctdb_reply_dmaster,
CTDB_REPLY_DMASTER);

#define NUM_CONTROLS 154
#define NUM_CONTROLS 155

PROTOCOL_CTDB2_TEST(struct ctdb_req_control_data, ctdb_req_control_data);
PROTOCOL_CTDB2_TEST(struct ctdb_reply_control_data, ctdb_reply_control_data);
Expand Down

0 comments on commit 36f9b49

Please sign in to comment.