From 21b158cc48157ceab09fe601e140be0757eea193 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Mon, 7 Dec 2015 06:21:40 -0800 Subject: [PATCH] Added unit test info to README.md --- netcon/Intercept.c | 2 +- netcon/README.md | 31 +++++++++++++++++++ .../monitor_dockerfile | 0 .../monitor_entrypoint.sh | 0 .../netcon_dockerfile | 0 .../netcon_entrypoint.sh | 0 .../nginx.conf_ | 0 7 files changed, 32 insertions(+), 1 deletion(-) rename netcon/docker-test/nginx/{nginx-1.8.0-ub14.x86_64 => nginx-1.4.6-1.ub14.x86_64}/monitor_dockerfile (100%) rename netcon/docker-test/nginx/{nginx-1.8.0-ub14.x86_64 => nginx-1.4.6-1.ub14.x86_64}/monitor_entrypoint.sh (100%) rename netcon/docker-test/nginx/{nginx-1.8.0-ub14.x86_64 => nginx-1.4.6-1.ub14.x86_64}/netcon_dockerfile (100%) rename netcon/docker-test/nginx/{nginx-1.8.0-ub14.x86_64 => nginx-1.4.6-1.ub14.x86_64}/netcon_entrypoint.sh (100%) rename netcon/docker-test/nginx/{nginx-1.8.0-ub14.x86_64 => nginx-1.4.6-1.ub14.x86_64}/nginx.conf_ (100%) diff --git a/netcon/Intercept.c b/netcon/Intercept.c index 7f5f4d6e4..5d0a5d78b 100644 --- a/netcon/Intercept.c +++ b/netcon/Intercept.c @@ -980,7 +980,7 @@ int poll(POLL_SIG) /* int fd */ int close(CLOSE_SIG) { - checkpid(); // Required for httpd-2.4.17-3.x86_64 -- After clone, some symbols aren't initialized yet */ + //checkpid(); // Required for httpd-2.4.17-3.x86_64 -- After clone, some symbols aren't initialized yet */ if(realclose == NULL){ dwr(MSG_ERROR, "close(): SYMBOL NOT FOUND.\n"); return -1; diff --git a/netcon/README.md b/netcon/README.md index b6bff6676..1e8e60ede 100644 --- a/netcon/README.md +++ b/netcon/README.md @@ -106,3 +106,34 @@ Going to port 8080 on your machine won't work. Darkhttpd is listening, but only curl http://NETCON.INSTANCE.IP:8080/README.md Replace *NETCON.INSTANCE.IP* with the IP address that *zerotier-netcon-service* was assigned on the virtual network. (This is the same IP you pinged in your first test.) If everything works, you should get back a copy of ZeroTier One's main README.md file. + +# Unit Tests + +To run unit tests: + +1) Set up your own network, use its network id as follows: + +2) Place a blank network config file in the *netcon/docker-test* directory (e.g. "e5cd7a9e1c5311ab.conf") + - This will be used to inform test-specific scripts what network to use for testing + +After you've created your network and placed its blank config file in *netcon/docker-test* run the following to perform unit tests for httpd: + + ./build.sh httpd + ./test.sh httpd + +It's useful to note that the keyword *httpd* in this example is merely a substring for a test name, this means that if we replaced it with *x86_64* or *fc23*, it would run all unit tests for *x86_64* systems or *Fedora 23* respectively. + +# Anatomy of a unit test + +A) Each unit test's will: + - temporarily copy all ZeroTier binaries files into local directory + - build test container + - build monitor container + - remove temporary files + - run each container and perform test and monitoring specified in *netcon_entrypoint.sh* and *monitor_entrypoint.sh* + +B) Results will be written to the *netcon/docker-test/_results/* directory + - Results will be a combination of raw and formatted dumps to files whose names reflect the test performed + - In the event of failure, *FAIL.* will be appended to the result file's name + - (e.g. FAIL.my_application_1.0.2.x86_64) + - In the event of success, *OK.* will be appended diff --git a/netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/monitor_dockerfile b/netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/monitor_dockerfile similarity index 100% rename from netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/monitor_dockerfile rename to netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/monitor_dockerfile diff --git a/netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/monitor_entrypoint.sh b/netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/monitor_entrypoint.sh similarity index 100% rename from netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/monitor_entrypoint.sh rename to netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/monitor_entrypoint.sh diff --git a/netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_dockerfile b/netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/netcon_dockerfile similarity index 100% rename from netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_dockerfile rename to netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/netcon_dockerfile diff --git a/netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_entrypoint.sh b/netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/netcon_entrypoint.sh similarity index 100% rename from netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_entrypoint.sh rename to netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/netcon_entrypoint.sh diff --git a/netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/nginx.conf_ b/netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/nginx.conf_ similarity index 100% rename from netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/nginx.conf_ rename to netcon/docker-test/nginx/nginx-1.4.6-1.ub14.x86_64/nginx.conf_