3 void test_u32(
struct aura_node *n)
7 ret =
aura_call(n,
"echo32", &retbuf, 0xbeefc0de);
9 BUG(n,
"Call failed!");
12 if (v != 0xbeefc0de) {
13 slog(0, SLOG_ERROR,
"U32 test NOT ok: %llx vs %llx", v, 0xbeefc0de);
16 slog(0, SLOG_INFO,
"U32 echo test passed");
19 void test_bin(
struct aura_node *n)
23 FILE *fd = fopen(
"/dev/urandom",
"r+");
24 fread(buf, 64, 1, fd);
28 ret =
aura_call(n,
"echobin", &retbuf, buf);
30 BUG(n,
"Call failed!");
32 if (0 != memcmp(buf, retbuf->
data, 64))
33 slog(0, SLOG_ERROR,
"BIN test NOT ok");
34 aura_hexdump(
"Out buffer", buf, 64);
35 aura_hexdump(
"In buffer", retbuf->
data, 64);
36 slog(0, SLOG_INFO,
"BIN test passed");
39 void test_u64(
struct aura_node *n)
43 ret =
aura_call(n,
"echo64", &retbuf, 0xbeefc0deb00bc0de);
45 BUG(n,
"Call failed!");
48 if (v != 0xbeefc0deb00bc0de)
49 slog(0, SLOG_ERROR,
"U64 test NOT ok: %llx vs %llx", v, 0xbeefc0deb00bc0de);
51 slog(0, SLOG_INFO,
"U64 echo test passed");
54 void test_buf(
struct aura_node *n)
59 uint32_t test = 0xdeadf00d;
60 memcpy(iobuf->
data, &test,
sizeof(test));
62 ret =
aura_call(n,
"echo_buf", &retbuf, iobuf);
63 slog(0, SLOG_DEBUG,
"call ret %d", ret);
65 BUG(n,
"call failed");
69 BUG(n,
"test not ok");
73 slog(0, SLOG_INFO,
"BUF test passed");
76 void test_u32u32(
struct aura_node *n)
80 ret =
aura_call(n,
"echou32u32", &retbuf, 0xbeefc0de, 0xdeadc0de);
82 BUG(n,
"Call failed!");
87 if ((v1 != 0xbeefc0de) && (v2 != 0xdeadc0de)) {
88 slog(0, SLOG_ERROR,
"U32 test NOT ok: %llx,%llx vs %llx,%llx",
89 v1, v2, 0xbeefc0de, 0xdeadc0de);
93 slog(0, SLOG_INFO,
"U32U32 echo test passed");
101 struct aura_node *n =
aura_open(
"nmc",
"./aura-test.abs");
103 slog (0, SLOG_ERROR,
"Failed to open node");
struct aura_buffer * aura_buffer_request(struct aura_node *nd, int size)
void aura_wait_status(struct aura_node *node, int status)
uint32_t aura_buffer_get_u32(struct aura_buffer *buf)
Get an unsigned 32 bit integer from aura buffer.
int aura_call(struct aura_node *node, const char *name, struct aura_buffer **retbuf,...)
struct aura_node * aura_open(const char *name, const char *opts)
uint64_t aura_buffer_get_u64(struct aura_buffer *buf)
Get an unsigned 64 bit integer from aura buffer.
void aura_buffer_release(struct aura_buffer *buf)
void aura_close(struct aura_node *node)
struct aura_buffer * aura_buffer_get_buf(struct aura_buffer *buf)
Retrieve aura_buffer pointer from within the buffer and advance internal pointer by it's size...