diff options
| author | Joseph Henry <[email protected]> | 2017-06-05 17:10:24 -0700 |
|---|---|---|
| committer | Joseph Henry <[email protected]> | 2017-06-05 17:10:24 -0700 |
| commit | a94979ecd0f6b8afc1781622d630d4859dc5267e (patch) | |
| tree | ea25731b87e40514a8cad2e3416e2a99ae1c7af7 | |
| parent | 19839eeac904b2e668d392594111fcef401bcde2 (diff) | |
moved old tests to attic, updated selftest and host config files
| -rw-r--r-- | TESTING.md | 6 | ||||
| -rw-r--r-- | attic/old_tests/tcpclient4.cpp (renamed from test/tcpclient4.cpp) | 0 | ||||
| -rw-r--r-- | attic/old_tests/tcpclient6.cpp (renamed from test/tcpclient6.cpp) | 0 | ||||
| -rw-r--r-- | attic/old_tests/tcpserver4.cpp (renamed from test/tcpserver4.cpp) | 0 | ||||
| -rw-r--r-- | attic/old_tests/tcpserver6.cpp (renamed from test/tcpserver6.cpp) | 0 | ||||
| -rwxr-xr-x | attic/old_tests/udpclient4.cpp (renamed from test/udpclient4.cpp) | 0 | ||||
| -rwxr-xr-x | attic/old_tests/udpclient6.cpp (renamed from test/udpclient6.cpp) | 0 | ||||
| -rwxr-xr-x | attic/old_tests/udpserver4.cpp (renamed from test/udpserver4.cpp) | 0 | ||||
| -rwxr-xr-x | attic/old_tests/udpserver6.cpp (renamed from test/udpserver6.cpp) | 0 | ||||
| -rw-r--r-- | test/alice.conf | 14 | ||||
| -rw-r--r-- | test/bob.conf | 14 | ||||
| -rw-r--r-- | test/selftest.cpp | 40 | ||||
| -rw-r--r-- | test/testhost1.conf | 12 | ||||
| -rw-r--r-- | test/testhost2.conf | 12 |
14 files changed, 56 insertions, 42 deletions
@@ -30,6 +30,12 @@ Slam tests will test the library's ability to handle many repeated API calls or A comprehensive test will test each aspect of the library one time. +On `host-1`, run: + - `./build/test/linux/selftest test/bob.conf` + +On `host-2`, run: + - `./build/test/linux/selftest test/alice.conf` + ### Random Tests Makes random API calls with random (or plausible arguments/data) to test for proper error handling diff --git a/test/tcpclient4.cpp b/attic/old_tests/tcpclient4.cpp index 0d2e731..0d2e731 100644 --- a/test/tcpclient4.cpp +++ b/attic/old_tests/tcpclient4.cpp diff --git a/test/tcpclient6.cpp b/attic/old_tests/tcpclient6.cpp index 00d2324..00d2324 100644 --- a/test/tcpclient6.cpp +++ b/attic/old_tests/tcpclient6.cpp diff --git a/test/tcpserver4.cpp b/attic/old_tests/tcpserver4.cpp index b3d929a..b3d929a 100644 --- a/test/tcpserver4.cpp +++ b/attic/old_tests/tcpserver4.cpp diff --git a/test/tcpserver6.cpp b/attic/old_tests/tcpserver6.cpp index 5eea293..5eea293 100644 --- a/test/tcpserver6.cpp +++ b/attic/old_tests/tcpserver6.cpp diff --git a/test/udpclient4.cpp b/attic/old_tests/udpclient4.cpp index 8200fdf..8200fdf 100755 --- a/test/udpclient4.cpp +++ b/attic/old_tests/udpclient4.cpp diff --git a/test/udpclient6.cpp b/attic/old_tests/udpclient6.cpp index 36607fa..36607fa 100755 --- a/test/udpclient6.cpp +++ b/attic/old_tests/udpclient6.cpp diff --git a/test/udpserver4.cpp b/attic/old_tests/udpserver4.cpp index 2280435..2280435 100755 --- a/test/udpserver4.cpp +++ b/attic/old_tests/udpserver4.cpp diff --git a/test/udpserver6.cpp b/attic/old_tests/udpserver6.cpp index 4ed977b..4ed977b 100755 --- a/test/udpserver6.cpp +++ b/attic/old_tests/udpserver6.cpp diff --git a/test/alice.conf b/test/alice.conf new file mode 100644 index 0000000..9d04aad --- /dev/null +++ b/test/alice.conf @@ -0,0 +1,14 @@ +nwid c7cd7c9e1b0f52a2 +mode client + +local_path zt1 +local_port 4545 +local_port6 4646 +local_ipv4 10.9.9.50 +local_ipv6 fde5:cd7a:9edc:0f12:7399:98b2:5722:9143 + +remote_path zt2 +remote_port 4545 +remote_port6 4646 +remote_ipv4 10.9.9.51 +remote_ipv6 fde5:cd72:9e17:0fdb:7e99:1369:4d5b:fe3f
\ No newline at end of file diff --git a/test/bob.conf b/test/bob.conf new file mode 100644 index 0000000..1c0bc73 --- /dev/null +++ b/test/bob.conf @@ -0,0 +1,14 @@ +nwid c7cd7c9e1b0f52a2 +mode server + +local_path zt2 +local_port 4545 +local_port6 4646 +local_ipv4 10.9.9.51 +local_ipv6 fde5:cd72:9e17:0fdb:7e99:1369:4d5b:fe3f + +remote_path zt1 +remote_port 4545 +remote_port6 4646 +remote_ipv4 10.9.9.50 +remote_ipv6 fde5:cd7a:9edc:0f12:7399:98b2:5722:9143
\ No newline at end of file diff --git a/test/selftest.cpp b/test/selftest.cpp index ee802e6..215f439 100644 --- a/test/selftest.cpp +++ b/test/selftest.cpp @@ -883,16 +883,18 @@ int main(int argc , char *argv[]) return 1; } - int err = 0; - int type = 0; - int protocol = 0; - int mode = 0; - int port = 0; - int local_port = 0; - int remote_port = 0; - int operation = 0; - int n_count = 0; - int delay = 0; + int err = 0; + int type = 0; + int protocol = 0; + int mode = 0; + int port = 0; + int local_port = 0; + int remote_port = 0; + int local_port6 = 0; + int remote_port6 = 0; + int operation = 0; + int n_count = 0; + int delay = 0; std::string nwid, stype, path = argv[1]; std::string ipstr, ipstr6, local_ipstr, local_ipstr6, remote_ipstr, remote_ipstr6; @@ -921,13 +923,18 @@ int main(int argc , char *argv[]) local_port = atoi(testConf["local_port"].c_str()); remote_port = atoi(testConf["remote_port"].c_str()); + local_port6 = atoi(testConf["local_port6"].c_str()); + remote_port6 = atoi(testConf["remote_port6"].c_str()); + fprintf(stderr, "local_ipstr = %s\n", local_ipstr.c_str()); fprintf(stderr, "local_ipstr6 = %s\n", local_ipstr6.c_str()); fprintf(stderr, "remote_ipstr = %s\n", remote_ipstr.c_str()); fprintf(stderr, "remote_ipstr6 = %s\n", remote_ipstr6.c_str()); fprintf(stderr, "remote_port = %d\n", remote_port); + fprintf(stderr, "remote_port6 = %d\n", remote_port6); fprintf(stderr, "local_port = %d\n", local_port); + fprintf(stderr, "local_port6 = %d\n", local_port6); } else { @@ -1077,16 +1084,14 @@ int main(int argc , char *argv[]) do_test(path, nwid, type, protocol, mode, ipstr, port, operation, n_count, delay); sleep(3); - // IPV6 - printf("performing COMPREHENSIVE ipv6 test\n"); /* Each host must operate as the counterpart to the other, thus, each mode * will call the same test helper functions in different orders * Additionally, the test will use the preset paremeters below for the test: */ -/* + delay = 0; n_count = 10; type = TEST_TYPE_SIMPLE; @@ -1095,13 +1100,13 @@ int main(int argc , char *argv[]) if(mode == TEST_MODE_SERVER) { printf("starting comprehensive test as SERVER\n"); - port = local_port; + port = local_port6; ipstr6 = local_ipstr6; } else if(mode == TEST_MODE_CLIENT) { printf("starting comprehensive test as CLIENT (waiting, giving server time to start)\n"); sleep(10); // give the server some time to come online before beginning test - port = remote_port; + port = remote_port6; ipstr6 = remote_ipstr6; } @@ -1112,13 +1117,13 @@ int main(int argc , char *argv[]) // swtich modes (client/server) if(mode == TEST_MODE_SERVER) { printf("\nswitching from SERVER to CLIENT mode\n"); - port = remote_port; + port = remote_port6; ipstr6 = remote_ipstr6; mode = TEST_MODE_CLIENT; } else if(mode == TEST_MODE_CLIENT) { printf("switching from CLIENT to SERVER mode\n"); - port = local_port; + port = local_port6; ipstr6 = local_ipstr6; mode = TEST_MODE_SERVER; } @@ -1126,7 +1131,6 @@ int main(int argc , char *argv[]) // IPV4 (second test) do_test(path, nwid, type, protocol, mode, ipstr6, port, operation, n_count, delay); sleep(3); - */ } diff --git a/test/testhost1.conf b/test/testhost1.conf deleted file mode 100644 index 41eb0f8..0000000 --- a/test/testhost1.conf +++ /dev/null @@ -1,12 +0,0 @@ -nwid c7cd7c9e1b0f52a2 -mode client - -local_path zt1 -local_port 4545 -local_ipv4 10.9.9.40 -local_ipv6 fde5:cd72:9e17:0fdb:7e99:1369:4d5b:fe3f - -remote_path zt2 -remote_port 4545 -remote_ipv4 10.9.9.41 -remote_ipv6 fde5:cd7a:9edc:0f12:7399:98b2:5722:9143
\ No newline at end of file diff --git a/test/testhost2.conf b/test/testhost2.conf deleted file mode 100644 index ce3443e..0000000 --- a/test/testhost2.conf +++ /dev/null @@ -1,12 +0,0 @@ -nwid c7cd7c9e1b0f52a2 -mode server - -local_path zt2 -local_port 4545 -local_ipv4 10.9.9.41 -local_ipv6 fde5:cd7a:9edc:0f12:7399:98b2:5722:9143 - -remote_path zt1 -remote_port 4545 -remote_ipv4 10.9.9.40 -remote_ipv6 fde5:cd72:9e17:0fdb:7e99:1369:4d5b:fe3f
\ No newline at end of file |
