From c70444b4dd41960554f5f283d22e911df6447737 Mon Sep 17 00:00:00 2001 From: Marvin Sielenkemper Date: Fri, 16 Sep 2016 22:19:07 +0200 Subject: Add tests for IPv6 --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 9ab31acd..8e945a47 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,4 +121,11 @@ test: (curl -s 'http://localhost:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) (curl -s 'http://localhost:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) kill `cat $(TESTPID)` + rm -f $(TESTDB) + sqlite3 $(TESTDB) < demo/demo.sql + demo/demo.exe & echo $$! > $(TESTPID) + sleep 1 + (curl -s 'http://[::1]:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) + (curl -s 'http://[::1]:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) + kill `cat $(TESTPID)` echo Tests succeeded. -- cgit v1.2.3 From 13a90684dc583427ad1d59a10d8bb00928fb6687 Mon Sep 17 00:00:00 2001 From: Marvin Sielenkemper Date: Fri, 16 Sep 2016 22:38:08 +0200 Subject: Amend the tests to check if the new option works --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8e945a47..3eb0a377 100644 --- a/Makefile.am +++ b/Makefile.am @@ -116,14 +116,14 @@ test: bin/urweb -boot -noEmacs -dbms sqlite -db $(TESTDB) -demo /Demo demo rm -f $(TESTDB) sqlite3 $(TESTDB) < demo/demo.sql - demo/demo.exe & echo $$! > $(TESTPID) + demo/demo.exe -a 127.0.0.1 & echo $$! > $(TESTPID) sleep 1 (curl -s 'http://localhost:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) (curl -s 'http://localhost:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) kill `cat $(TESTPID)` rm -f $(TESTDB) sqlite3 $(TESTDB) < demo/demo.sql - demo/demo.exe & echo $$! > $(TESTPID) + demo/demo.exe -A ::1 & echo $$! > $(TESTPID) sleep 1 (curl -s 'http://[::1]:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) (curl -s 'http://[::1]:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) -- cgit v1.2.3 From 6bd95b0236f8142181aae369c93e00d15bb3c83f Mon Sep 17 00:00:00 2001 From: Marvin Sielenkemper Date: Sat, 17 Sep 2016 09:33:39 +0200 Subject: Check if the loopback interface has an IPv6 address and only run IPv6 test tests if this is the case --- Makefile.am | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 3eb0a377..0b9a5957 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,11 +121,17 @@ test: (curl -s 'http://localhost:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) (curl -s 'http://localhost:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) kill `cat $(TESTPID)` - rm -f $(TESTDB) - sqlite3 $(TESTDB) < demo/demo.sql - demo/demo.exe -A ::1 & echo $$! > $(TESTPID) - sleep 1 - (curl -s 'http://[::1]:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) - (curl -s 'http://[::1]:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) - kill `cat $(TESTPID)` + if (ifconfig lo | grep -q inet6); \ + then \ + echo "Running IPv6 tests."; \ + rm -f $(TESTDB); \ + sqlite3 $(TESTDB) < demo/demo.sql; \ + demo/demo.exe -A ::1 & echo $$! > $(TESTPID); \ + sleep 1; \ + (curl -s 'http://[::1]:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false); \ + (curl -s 'http://[::1]:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false); \ + kill `cat $(TESTPID)`; \ + else \ + echo "Skipped IPv6 tests."; \ + fi echo Tests succeeded. -- cgit v1.2.3