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

Added NOOP system test.

Added Sequence ID initialization to current time seconds since epoch.
Used key and ACL set by kinetic-cpp-examples/set_acls for C NOOP init of Java simulator, but simulator fails to respond to NOOP request. Made NOOP system test pending for now...
parent 294fa1d0
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -57,8 +57,7 @@ bool KineticApi_ConfigureExchange(
    KineticConnection* connection,
    int64_t identity,
    uint8_t* key,
    size_t keyLength,
    int64_t connectionID)
    size_t keyLength)
{
    if (exchange == NULL)
    {
@@ -66,12 +65,6 @@ bool KineticApi_ConfigureExchange(
        return false;
    }

    if (connection == NULL)
    {
        LOG("Specified KineticConnection is NULL!");
        return false;
    }

    if (key == NULL)
    {
        LOG("Specified Kinetic Protocol key is NULL!");
@@ -84,7 +77,8 @@ bool KineticApi_ConfigureExchange(
        return false;
    }

    KineticExchange_Init(exchange, identity, key, keyLength, connectionID, connection);
    KineticExchange_Init(exchange, identity, key, keyLength, connection);
    KineticExchange_ConfigureConnectionID(exchange);

    return true;
}
+1 −2
Original line number Diff line number Diff line
@@ -40,8 +40,7 @@ bool KineticApi_ConfigureExchange(
    KineticConnection* connection,
    int64_t identity,
    uint8_t* key,
    size_t keyLength,
    int64_t connectionID);
    size_t keyLength);

KineticOperation KineticApi_CreateOperation(
    KineticExchange* exchange,
+10 −2
Original line number Diff line number Diff line
@@ -20,16 +20,24 @@

#include "kinetic_exchange.h"
#include <string.h>
#include <time.h>

void KineticExchange_Init(
    KineticExchange* const exchange,
    int64_t identity,
    uint8_t* key,
    size_t keyLength,
    int64_t connectionID,
    KineticConnection* const connection)
{
    KINETIC_EXCHANGE_INIT(exchange, identity, key, keyLength, connectionID, connection);
    KINETIC_EXCHANGE_INIT(exchange, identity, key, keyLength, connection);
}

void KineticExchange_ConfigureConnectionID(
    KineticExchange* const exchange)
{
    time_t cur_time;
    cur_time = time(NULL);
    exchange->connectionID = (int64_t)cur_time;
}

void KineticExchange_SetClusterVersion(
+4 −3
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ typedef struct _KineticExchange
    KineticConnection* connection;
} KineticExchange;

#define KINETIC_EXCHANGE_INIT(exchg, id, k, klen, conid, con) { \
#define KINETIC_EXCHANGE_INIT(exchg, id, k, klen, con) { \
    memset((exchg), 0, sizeof(KineticExchange)); \
    (exchg)->identity = id; \
    if (k != NULL && klen > 0) \
@@ -75,7 +75,6 @@ typedef struct _KineticExchange
        (exchg)->keyLength = klen; \
        (exchg)->has_key = true; \
    } \
    (exchg)->connectionID = conid; \
    (exchg)->connection = con; \
    (exchg)->sequence = -1; \
}
@@ -85,9 +84,11 @@ void KineticExchange_Init(
    int64_t identity,
    uint8_t* key,
    size_t keyLength,
    int64_t connectionID,
    KineticConnection* const connection);

void KineticExchange_ConfigureConnectionID(
    KineticExchange* const exchange);

void KineticExchange_SetClusterVersion(
    KineticExchange* const exchange,
    int64_t clusterVersion);
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#include <ifaddrs.h>
#include <openssl/sha.h>

#define KINETIC_PORT            8213
#define KINETIC_PORT            8123
#define KINETIC_HMAC_SHA1_LEN   (SHA_DIGEST_LENGTH)
#define KINETIC_HMAC_MAX_LEN    (KINETIC_HMAC_SHA1_LEN)
#define KINETIC_MAX_KEY_LEN     128
Loading