diff --git a/src/ulib/notifier.cpp b/src/ulib/notifier.cpp
index e16728f0..9981f409 100644
--- a/src/ulib/notifier.cpp
+++ b/src/ulib/notifier.cpp
@@ -279,7 +279,7 @@ next:
if (U_SYSCALL(kevent, "%d,%p,%d,%p,%d,%p", kq, kqevents, 1, kqrevents, max_connection, 0) != 1 ||
kqrevents[0].ident != -1 ||
- (kqrevents[0].flags & EV_ERROR) != 0)
+ (kqrevents[0].flags & EV_ERROR) == 0)
{
U_ERROR("Detected broken kevent()...");
}
diff --git a/tests/examples/wi-auth/bin/check_for_assertion.sh b/tests/examples/wi-auth/bin/check_for_assertion.sh
index 9329058e..f25450ac 100755
--- a/tests/examples/wi-auth/bin/check_for_assertion.sh
+++ b/tests/examples/wi-auth/bin/check_for_assertion.sh
@@ -2,15 +2,20 @@
# check_for_assertion.sh
-sync
echo -----------------------------------------------------------------------------------------------------------------------------------
-grep --colour -i -E -e 'assert|OVERLAP|SIGSEGV|allocate' /tmp/userver-*.err
-echo -----------------------------------------------------------------------------------------------------------------------------------
-grep --colour -i -E -e 'ERROR|ABORT|ASSERT' /var/log/userver-*.log /var/log/uclient-*.log | grep -v 'SSL EOF observed that violates the protocol'
-echo -----------------------------------------------------------------------------------------------------------------------------------
-grep --colour -i -E -e 'Bad Req| diff|detected|File cached' /var/log/userver-*.log
-echo -----------------------------------------------------------------------------------------------------------------------------------
-#zcat /var/log/userver-*.gz | grep --colour -i -E -e 'ERROR|ABORT|ASSERT' | grep -v 'SSL EOF observed that violates the protocol'
-echo -----------------------------------------------------------------------------------------------------------------------------------
-zcat /var/log/wi-auth-logs-archives/*.gz | grep --colour -i -E -e 'ERROR|ABORT|ASSERT|SIGSEGV| diff|detected'
+grep --colour -i -E -e 'assert|OVERLAP|SIGSEGV|allocate|ERROR|generic|handler|poll|simultaneous' /tmp/userver*.err
echo -----------------------------------------------------------------------------------------------------------------------------------
+#grep --colour -i -E -e 'ERROR|ABORT|ASSERT' /var/log/userver-*.log /var/log/uclient-*.log | grep -v 'SSL EOF observed that violates the protocol'
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#grep --colour -i -E -e 'Bad Req| diff|detected|File cached' /var/log/userver-*.log | grep -v 'Detected strange initial WiFi'
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#zcat /var/log/userver-*.gz | grep --colour -i -E -e 'ERROR|ABORT|ASSERT|failed' | grep -v 'SSL EOF observed that violates the protocol'
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#zcat /var/log/wi-auth-logs-archives/*.gz | grep --colour -i -E -e 'ERROR|ABORT|ASSERT|SIGSEGV| diff|detected' | grep -v 'Detected strange initial WiFi'
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#echo '(gz) completed:' `zcat /var/log/userver-*.gz 2>/dev/null | grep ' completed' | wc -l` failed: `zcat /var/log/userver-*.gz 2>/dev/null | grep ' failed' | wc -l`
+#echo ' completed:' ` cat /var/log/userver-*.log 2>/dev/null | grep ' completed' | wc -l` failed: ` cat /var/log/userver-*.log 2>/dev/null | grep ' failed' | wc -l`
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#for i in userver-firenze_*log.*.gz; do zcat $i | grep --colour -E -e ' failed| completed|partial response'; done 2>/dev/null
+#echo -----------------------------------------------------------------------------------------------------------------------------------
+#tail -f httpd/access_log | cgrep -e ^88.149.190.155
diff --git a/tests/examples/wi-auth/bin/check_for_ora_legale.sh b/tests/examples/wi-auth/bin/check_for_ora_legale.sh
index 387ca207..a58f51d8 100755
--- a/tests/examples/wi-auth/bin/check_for_ora_legale.sh
+++ b/tests/examples/wi-auth/bin/check_for_ora_legale.sh
@@ -4,3 +4,4 @@ TCP_PID=`cat /var/run/userver_tcp.pid`
SSL_PID=`cat /var/run/userver_ssl.pid`
kill -WINCH $TCP_PID $SSL_PID
+
diff --git a/tests/examples/wi-auth/bin/clean_sessions_ldap.sh b/tests/examples/wi-auth/bin/clean_sessions_ldap.sh
index 0c7c74cf..e4bf58db 100755
--- a/tests/examples/wi-auth/bin/clean_sessions_ldap.sh
+++ b/tests/examples/wi-auth/bin/clean_sessions_ldap.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-SERVER="ldap://10.30.1.131"
+SERVER="ldap://localhost"
ROOTDN="cn=admin,o=sessions"
ROOTPW="programmer"
BASEDN="o=sessions"
diff --git a/tests/examples/wi-auth/bin/get_ap_uptime_for_unifi_and_cascine.sh b/tests/examples/wi-auth/bin/get_ap_uptime_for_unifi_and_cascine.sh
new file mode 100755
index 00000000..18eef089
--- /dev/null
+++ b/tests/examples/wi-auth/bin/get_ap_uptime_for_unifi_and_cascine.sh
@@ -0,0 +1,7 @@
+#/bin/bash
+
+PROGRAM=`basename $0 .sh`
+
+#/home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "get_ap_uptime?ap=01@unifi-r29587_x86\&public=151.11.47.5"
+/home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "get_ap_uptime?ap=01@unifi-r29587_x86\&public=159.213.248.230"
+/home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "get_ap_uptime?ap=01@cascineConc-r29587_x86\&public=159.213.248.232"
diff --git a/tests/examples/wi-auth/bin/reset_policy.sh b/tests/examples/wi-auth/bin/reset_policy.sh
index edb38868..e46cf06b 100755
--- a/tests/examples/wi-auth/bin/reset_policy.sh
+++ b/tests/examples/wi-auth/bin/reset_policy.sh
@@ -4,6 +4,13 @@
# echo '00 00 * * * /home/unirel/userver/bin/reset_policy.sh' | crontab
+# wget supports only Basic auth as the only auth type over HTTP proxy
+ wget -q --no-check-certificate --user=admin --password=nessun4 https://10.30.1.111/admin_login_nodog -O /var/log/wi-auth-status-access/`date -u -d "now" +"%Y%m%d%H%M%SZ"`.html
+#curl -s -k --digest -u admin:nessun4 https://10.30.1.111/admin_login_nodog -o /var/log/wi-auth-status-access/`date -u -d "now" +"%Y%m%d%H%M%SZ"`.html
+
PROGRAM=`basename $0 .sh`
-exec /home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "reset_policy"
+/home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "reset_policy"
+
+#sleep 1
+#wget -q --no-check-certificate --user=admin --password=nessun4 https://10.30.1.111/admin_login_nodog -O /var/log/wi-auth-status-access/`date -u -d "now" +"%Y%m%d%H%M%SZ"`.html
diff --git a/tests/examples/wi-auth/bin/resync.sh b/tests/examples/wi-auth/bin/resync.sh
new file mode 100755
index 00000000..c7a2f638
--- /dev/null
+++ b/tests/examples/wi-auth/bin/resync.sh
@@ -0,0 +1,9 @@
+#/bin/bash
+
+# resync.sh
+
+# echo '00 04 * * * /home/unirel/userver/bin/reset_policy.sh' | crontab
+
+PROGRAM=`basename $0 .sh`
+
+exec /home/unirel/userver/bin/send_req_to_portal.sh $PROGRAM "resync"
diff --git a/tests/examples/wi-auth/bin/send_req_to_portal.sh b/tests/examples/wi-auth/bin/send_req_to_portal.sh
index be59ce83..5239c4c7 100755
--- a/tests/examples/wi-auth/bin/send_req_to_portal.sh
+++ b/tests/examples/wi-auth/bin/send_req_to_portal.sh
@@ -32,7 +32,7 @@ do_cmd() {
# eval $CLIENT_HTTP "http://auth.t-unwired.com/$2" >$TMPFILE 2>/dev/null
# if [ $? -eq 0 ]; then
- rm -f $TMPFILE
+# rm -f $TMPFILE
# fi
logger -p $LOCAL_SYSLOG_SELECTOR "$PORTAL_NAME: $1 END"
diff --git a/tests/examples/wi-auth/bin/tail.sh b/tests/examples/wi-auth/bin/tail.sh
new file mode 100755
index 00000000..2725c4bc
--- /dev/null
+++ b/tests/examples/wi-auth/bin/tail.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd /var/log; tail -f LOG-firenze wifi-warning /tmp/userver*.err
+
diff --git a/tests/examples/wi-auth/bin/test.sh b/tests/examples/wi-auth/bin/test.sh
new file mode 100755
index 00000000..6247c871
--- /dev/null
+++ b/tests/examples/wi-auth/bin/test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+ curl -v 'http://wifi-aaa.comune.fi.it/status_ap?ap=ap@lab5-r29587_rs&public=10.10.100.115:5280'
+#curl -v 'http://wifi-aaa.comune.fi.it/status_ap?ap=03@unifi-r29587_x86&public=159.213.248.230:5280'
diff --git a/tests/examples/wi-auth/etc/firenze_ssl.cfg b/tests/examples/wi-auth/etc/firenze_ssl.cfg
index 850f3390..98d43ca0 100644
--- a/tests/examples/wi-auth/etc/firenze_ssl.cfg
+++ b/tests/examples/wi-auth/etc/firenze_ssl.cfg
@@ -4,41 +4,44 @@ userver {
DOCUMENT_ROOT ~/wi-auth/www
PID_FILE /var/run/userver_ssl.pid
- LOG_FILE_SZ 1M
+## LOG_FILE_SZ 1M
LOG_MSG_SIZE -1
-# LOG_FILE /var/log/userver-firenze_ssl.log
+ LOG_FILE /var/log/userver-firenze_ssl.log
PLUGIN "fcgi ssi http"
REQ_TIMEOUT 30
TCP_KEEP_ALIVE yes
- PREFORK_CHILD 5
+ PREFORK_CHILD 3
- CA_PATH /home/unirel/userver/etc/CApath
-# DH_FILE /home/unirel/userver/etc/certificates/dhparam.pem
- KEY_FILE /home/unirel/userver/etc/certificates/comune.fi.it.key
- CERT_FILE /home/unirel/userver/etc/certificates/comune.fi.it.cer
+ CA_PATH /srv/userver/etc/CApath
+# DH_FILE /srv/userver/etc/certificates/dhparam.pem
+ KEY_FILE /srv/userver/etc/certificates/wifi-aaa.comune.fi.it.key
+ CERT_FILE /srv/userver/etc/certificates/wifi-aaa.comune.fi.it.cer
}
http {
-##MAINTENANCE_MODE /ErrorDocument/down.html
+## MAINTENANCE_MODE /ErrorDocument/down.html
ALIAS @FILE:../alias.txt
APACHE_LIKE_LOG /var/log/httpd/access_log
- URI_PROTECTED_MASK /admin*
+ URI_PROTECTED_MASK /admin*|/tavarnelle*
CACHE_AVOID_MASK ap|phpldapadmin|login_request|banner
+ NOCACHE_FILE_MASK layoutv1.css
+
CGI_TIMEOUT 60
VIRTUAL_HOST yes
LIMIT_REQUEST_BODY 100K
REQUEST_READ_TIMEOUT 30
MOUNT_POINT /phpldapadmin/htdocs
+ LOG_FILE_SZ 1M
}
ssi {
@@ -56,5 +59,5 @@ fcgi {
RES_TIMEOUT 20
FCGI_KEEP_CONN yes
-## LOG_FILE /var/log/userver-firenze_ssl.log
+ LOG_FILE /var/log/userver-firenze_ssl.log
}
diff --git a/tests/examples/wi-auth/etc/firenze_tcp.cfg b/tests/examples/wi-auth/etc/firenze_tcp.cfg
index f3c62262..a65606ab 100644
--- a/tests/examples/wi-auth/etc/firenze_tcp.cfg
+++ b/tests/examples/wi-auth/etc/firenze_tcp.cfg
@@ -4,16 +4,15 @@ userver {
DOCUMENT_ROOT ~/wi-auth/www
PID_FILE /var/run/userver_tcp.pid
- LOG_FILE_SZ 1M
+## LOG_FILE_SZ 1M
LOG_MSG_SIZE -1
-## LOG_FILE /var/log/userver-firenze_tcp.log
+ LOG_FILE /var/log/userver-firenze_tcp.log
PLUGIN "proxy ssi http"
REQ_TIMEOUT 30
- TCP_KEEP_ALIVE yes
- PREFORK_CHILD 15
+ PREFORK_CHILD 8
}
http {
@@ -26,7 +25,8 @@ http {
URI_REQUEST_STRICT_TRANSPORT_SECURITY_MASK /admin*
- CACHE_AVOID_MASK ap|phpldapadmin|login_request|159.213.248.42|immagini
+ CACHE_AVOID_MASK ap|phpldapadmin|login_request|10.30.1.111|immagini
+ NOCACHE_FILE_MASK banner.html|*.css|*.js|*.html
CGI_TIMEOUT 60
VIRTUAL_HOST yes
@@ -34,8 +34,10 @@ http {
REQUEST_READ_TIMEOUT 30
TELNET_ENABLE yes
- ENABLE_INOTIFY yes
+ ENABLE_INOTIFY no
CACHE_FILE_STORE ../webifv.gz
+
+ LOG_FILE_SZ 1M
}
ssi {
@@ -54,6 +56,6 @@ proxy {
URI ^/cgi-bin/webif/.*?.sh$
SERVER ~/wi-auth/client
USER root
- PASSWORD c0mune
+ PASSWORD root
}
}
diff --git a/tests/examples/wi-auth/policy/DAILY b/tests/examples/wi-auth/policy/DAILY
index 64e32d65..03b89751 100644
--- a/tests/examples/wi-auth/policy/DAILY
+++ b/tests/examples/wi-auth/policy/DAILY
@@ -1,3 +1,3 @@
-MAX_TIME=7200
-MAX_TRAFFIC=314572800
+MAX_TIME=86400
+MAX_TRAFFIC=524288000
MAX_TIME_NO_TRAFFIC=10
diff --git a/tests/examples/wi-auth/template/10.30.1.111/admin_edit_ap.tmpl b/tests/examples/wi-auth/template/10.30.1.111/admin_edit_ap.tmpl
index 1818c286..4512ce5b 100644
--- a/tests/examples/wi-auth/template/10.30.1.111/admin_edit_ap.tmpl
+++ b/tests/examples/wi-auth/template/10.30.1.111/admin_edit_ap.tmpl
@@ -24,42 +24,35 @@
-