Index: /trunk/Nebulous/nebclient/tests/Makefile.am
===================================================================
--- /trunk/Nebulous/nebclient/tests/Makefile.am	(revision 4614)
+++ /trunk/Nebulous/nebclient/tests/Makefile.am	(revision 4614)
@@ -0,0 +1,6 @@
+TESTS = tests
+
+check_PROGRAMS = tests
+tests_SOURCES = tests.c
+tests_CPPFLAGS = -I$(top_srcdir)/src$
+tests_LDADD = $(top_srcdir)/src/libnebclient.la
Index: /trunk/Nebulous/nebclient/tests/tests.c
===================================================================
--- /trunk/Nebulous/nebclient/tests/tests.c	(revision 4614)
+++ /trunk/Nebulous/nebclient/tests/tests.c	(revision 4614)
@@ -0,0 +1,80 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdbool.h>
+#include "nebclient.h"
+
+#define TESTS(num_tests) \
+    int test_num = 0; \
+    printf("1..%d\n", num_tests);
+
+#define OK(test, name) \
+    test_num++; \
+    if (test) { \
+        printf("ok %d - %s\n", test_num, name); \
+    } else { \
+        printf("not ok %d - %s\n", test_num, name); \
+    }
+
+int main (int argc, char **argv) {
+    nebServer       *server = NULL;
+    char            *http_port;
+    char            *key = "foobar";
+
+    if (!(http_port = getenv("NEBULOUS_SERVER"))) {
+        http_port = "localhost:80";
+    }
+
+    TESTS(11);
+
+    server = nebServerAlloc();
+    server->endpoint = http_port;
+
+    OK(server, "server not NULL");
+
+    {
+        char        *URI = NULL;
+        int         fh;
+       
+        fh = nebCreate(server, key, 0, NULL, NULL, &URI);
+
+        OK(fh > -1, "create object");
+        OK(URI, "URI not NULL");
+    }
+
+    OK(nebReplicate(server, key, NULL, NULL), "replicate object");
+
+    OK(nebCull(server, key), "cull object");
+
+    {
+        char        **locations = NULL;
+        int         n;
+
+        n = nebFindInstances(server, key, NULL, &locations);
+
+        OK(n == 1, "find instances");
+        OK(locations, "locations not NULL");
+    }
+
+    {
+        char        *filename = NULL;
+       
+       filename = nebFind(server, key);
+
+       OK(filename, "find file name");
+    }
+
+
+    OK(nebCopy(server, key, "copyiedfile"), "copy object");
+
+    OK(nebDelete(server, key), "delete object");
+
+    OK(nebMove(server, "copyiedfile", "movedfile"), "move object");
+
+    if (!nebDelete(server, "movedfile")) {
+        printf( "cleanup failed %s\n", nebErr(server));
+    }
+
+    nebServerCleanup(server);
+
+    exit(EXIT_SUCCESS);
+}
