Commit b64926d2 authored by Greg Williams's avatar Greg Williams
Browse files

Fixed some warnings and syntax errors in DELETE system test

parent 0f29c046
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ run: ${UTIL_EXEC}
	${UTIL_EXEC} put
	${UTIL_EXEC} get
	${UTIL_EXEC} delete
	exec pkill -f 'java.*kinetic-simulator'

all: clean test default install run

+56 −56
Original line number Diff line number Diff line
@@ -53,47 +53,47 @@
// // } ProtobufCAllocator;


// #define KINETIC_CONNECTION_INIT(_con, _id, _key) { \
//     (*_con) = (KineticConnection) { \
//         .socketDescriptor = -1, \
//         .connectionID = time(NULL), \
//         .identity = (_id), \
//         .sequence = 0, \
//     }; \
//     (*_con).key = (ByteArray){.data = (*_con).keyData, .len = (_key).len}; \
//     if ((_key).data != NULL && (_key).len > 0) { \
//         memcpy((_con)->keyData, (_key).data, (_key).len); } \
// #define KINETIC_CONNECTION_INIT(_con, _id, _key) {
//     (*_con) = (KineticConnection) {
//         .socketDescriptor = -1,
//         .connectionID = time(NULL),
//         .identity = (_id),
//         .sequence = 0,
//     };
//     (*_con).key = (ByteArray){.data = (*_con).keyData, .len = (_key).len};
//     if ((_key).data != NULL && (_key).len > 0) {
//         memcpy((_con)->keyData, (_key).data, (_key).len); }
// }


// #define KINETIC_MESSAGE_HEADER_INIT(_hdr, _con) { \
//     assert((void *)(_hdr) != NULL); \
//     assert((void *)(_con) != NULL); \
//     *(_hdr) = (KineticProto_Header) { \
//         .base = PROTOBUF_C_MESSAGE_INIT(&KineticProto_header__descriptor), \
//         .has_clusterVersion = true, \
//         .clusterVersion = (_con)->clusterVersion, \
//         .has_identity = true, \
//         .identity = (_con)->identity, \
//         .has_connectionID = true, \
//         .connectionID = (_con)->connectionID, \
//         .has_sequence = true, \
//         .sequence = (_con)->sequence, \
//     }; \
// #define KINETIC_MESSAGE_HEADER_INIT(_hdr, _con) {
//     assert((void *)(_hdr) != NULL);
//     assert((void *)(_con) != NULL);
//     *(_hdr) = (KineticProto_Header) {
//         .base = PROTOBUF_C_MESSAGE_INIT(&KineticProto_header__descriptor),
//         .has_clusterVersion = true,
//         .clusterVersion = (_con)->clusterVersion,
//         .has_identity = true,
//         .identity = (_con)->identity,
//         .has_connectionID = true,
//         .connectionID = (_con)->connectionID,
//         .has_sequence = true,
//         .sequence = (_con)->sequence,
//     };
// }
// #define KINETIC_MESSAGE_INIT(msg) { \
//     KineticProto__init(&(msg)->proto); \
//     KineticProto_command__init(&(msg)->command); \
//     KineticProto_header__init(&(msg)->header); \
//     KineticProto_status__init(&(msg)->status); \
//     KineticProto_body__init(&(msg)->body); \
//     KineticProto_key_value__init(&(msg)->keyValue); \
//     memset((msg)->hmacData, 0, SHA_DIGEST_LENGTH); \
//     (msg)->proto.hmac.data = (msg)->hmacData; \
//     (msg)->proto.hmac.len = KINETIC_HMAC_MAX_LEN; \
//     (msg)->proto.has_hmac = true; \
//     (msg)->command.header = &(msg)->header; \
//     (msg)->proto.command = &(msg)->command; \
// #define KINETIC_MESSAGE_INIT(msg) { 
//     KineticProto__init(&(msg)->proto); 
//     KineticProto_command__init(&(msg)->command); 
//     KineticProto_header__init(&(msg)->header); 
//     KineticProto_status__init(&(msg)->status); 
//     KineticProto_body__init(&(msg)->body); 
//     KineticProto_key_value__init(&(msg)->keyValue); 
//     memset((msg)->hmacData, 0, SHA_DIGEST_LENGTH); 
//     (msg)->proto.hmac.data = (msg)->hmacData; 
//     (msg)->proto.hmac.len = KINETIC_HMAC_MAX_LEN; 
//     (msg)->proto.has_hmac = true; 
//     (msg)->command.header = &(msg)->header; 
//     (msg)->proto.command = &(msg)->command; 
// }


@@ -101,29 +101,29 @@
//     (KineticPDUHeader) {.versionPrefix = 'F'}


// #define KINETIC_PDU_INIT(_pdu, _con) { \
//     assert((void *)(_pdu) != NULL); \
//     assert((void *)(_con) != NULL); \
//     (_pdu)->connection = (_con); \
//     (_pdu)->header = KINETIC_PDU_HEADER_INIT; \
//     (_pdu)->headerNBO = KINETIC_PDU_HEADER_INIT; \
//     (_pdu)->value = BYTE_ARRAY_NONE; \
//     (_pdu)->proto = &(_pdu)->protoData.message.proto; \
//     KINETIC_MESSAGE_HEADER_INIT(&((_pdu)->protoData.message.header), (_con)); \
// #define KINETIC_PDU_INIT(_pdu, _con) {
//     assert((void *)(_pdu) != NULL);
//     assert((void *)(_con) != NULL);
//     (_pdu)->connection = (_con);
//     (_pdu)->header = KINETIC_PDU_HEADER_INIT;
//     (_pdu)->headerNBO = KINETIC_PDU_HEADER_INIT;
//     (_pdu)->value = BYTE_ARRAY_NONE;
//     (_pdu)->proto = &(_pdu)->protoData.message.proto;
//     KINETIC_MESSAGE_HEADER_INIT(&((_pdu)->protoData.message.header), (_con));
// }
// #define KINETIC_PDU_INIT_WITH_MESSAGE(_pdu, _con) { \
//     KINETIC_PDU_INIT((_pdu), (_con)) \
//     KINETIC_MESSAGE_INIT(&((_pdu)->protoData.message)); \
//     (_pdu)->proto->command->header = &(_pdu)->protoData.message.header; \
//     KINETIC_MESSAGE_HEADER_INIT(&(_pdu)->protoData.message.header, (_con)); \
// #define KINETIC_PDU_INIT_WITH_MESSAGE(_pdu, _con) {
//     KINETIC_PDU_INIT((_pdu), (_con))
//     KINETIC_MESSAGE_INIT(&((_pdu)->protoData.message));
//     (_pdu)->proto->command->header = &(_pdu)->protoData.message.header;
//     KINETIC_MESSAGE_HEADER_INIT(&(_pdu)->protoData.message.header, (_con));
// }


// #define KINETIC_OPERATION_INIT(_op, _con, _req, _resp) \
// *(_op) = (KineticOperation) { \
//     .connection = (_con), \
//     .request = (_req), \
//     .response = (_resp), \
// #define KINETIC_OPERATION_INIT(_op, _con, _req, _resp)
// *(_op) = (KineticOperation) {
//     .connection = (_con),
//     .request = (_req),
//     .response = (_resp),
// }


+9 −7
Original line number Diff line number Diff line
@@ -44,18 +44,20 @@ static SystemTestFixture Fixture = {
    .clusterVersion = 0,
    .identity =  1,
};
static const ByteArray Version = BYTE_ARRAY_INIT_FROM_CSTRING("v1.0");
static const ByteArray ValueKey = BYTE_ARRAY_INIT_FROM_CSTRING("DELETE system test blob");
static const ByteArray Tag = BYTE_ARRAY_INIT_FROM_CSTRING("SomeOTagValue");
static const ByteArray TestValue = BYTE_ARRAY_INIT_FROM_CSTRING("lorem ipsum... blah blah blah... etc.");
static const KineticProto_Algorithm Algorithm = KINETIC_PROTO_ALGORITHM_SHA1;
static ByteArray Version;
static ByteArray ValueKey;
static ByteArray Tag;
static ByteArray TestValue;
static KineticProto_Algorithm Algorithm = KINETIC_PROTO_ALGORITHM_SHA1;

void setUp(void)
{
    SystemTestSetup(&Fixture);

    // Setup to write some test data
    // Fixture.request.value = TestValue;
    Version = BYTE_ARRAY_INIT_FROM_CSTRING("v1.0");
    ValueKey = BYTE_ARRAY_INIT_FROM_CSTRING("DELETE system test blob");
    Tag = BYTE_ARRAY_INIT_FROM_CSTRING("SomeOTagValue");
    TestValue = BYTE_ARRAY_INIT_FROM_CSTRING("lorem ipsum... blah blah blah... etc.");

    KineticKeyValue metadata = {
        .key = ValueKey,
+8 −2
Original line number Diff line number Diff line
@@ -8,7 +8,12 @@ SIM_ADMIN=com.seagate.kinetic.admin.cli.KineticAdminCLI
BASE_DIR=`dirname "$0"`/../..
BASE_DIR=`cd "$BASE_DIR"; pwd`

echo BASE ${BASE_DIR}
echo STARTSTART

# kill any stale simulators
pkill -f 'java.*kinetic-simulator'
# allow for cleanup
sleep 1

#Set the classpath
if [ "$CLASSPATH" != "" ]; then
@@ -32,4 +37,5 @@ ${UTIL} noop
${UTIL} put
${UTIL} get

cat pid.log | xargs kill $1
# kill the simulator we started
pkill -f 'java.*kinetic-simulator'