From 2351c7c7aa106d057109cb1fca638299528547fa Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Mon, 11 Jan 2016 14:04:53 -0800 Subject: [PATCH] util/dist-check: added tests for --with-stream and balancer_by_lua. --- util/dist-check | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/util/dist-check b/util/dist-check index ee2b56c..585c444 100755 --- a/util/dist-check +++ b/util/dist-check @@ -65,6 +65,45 @@ sub write_config_file ($) { write_config_file "/tmp/nginx.conf"; +warn "=== --with-stream ===\n"; +$prefix = "/usr/local/openresty-nogzip"; +sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html"; +unless ($opts{f}) { + sh "./configure $cfg_opts --with-stream --prefix=$prefix -j$jobs > /dev/null"; +} +sh "$make -j$jobs > /dev/null"; +sh "sudo $make install > /dev/null"; +sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; +sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; +sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-stream'"; +system "sudo killall nginx > /dev/null 2>&1"; +sh "sudo $prefix/nginx/sbin/nginx"; +sh "curl -si localhost/lua|grep $lua"; +sh "curl -si localhost/lua|grep $ver"; +sh "curl -si localhost/cjson|grep 'json.safe: '"; +sh qq{$prefix/bin/resty -e 'ngx.say("Hello World!")'|grep 'Hello World'}; +sh "sudo $prefix/nginx/sbin/nginx -sstop"; + +warn "=== --with-stream + dtrace static probes ===\n"; +$prefix = "/usr/local/openresty-nogzip"; +sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html"; +unless ($opts{f}) { + sh "./configure $cfg_opts --with-dtrace-probes --with-stream --prefix=$prefix -j$jobs > /dev/null"; +} +sh "$make -j$jobs > /dev/null"; +sh "sudo $make install > /dev/null"; +sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; +sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; +sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-stream'"; +sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-dtrace-probes'"; +system "sudo killall nginx > /dev/null 2>&1"; +sh "sudo $prefix/nginx/sbin/nginx"; +sh "curl -si localhost/lua|grep $lua"; +sh "curl -si localhost/lua|grep $ver"; +sh "curl -si localhost/cjson|grep 'json.safe: '"; +sh qq{$prefix/bin/resty -e 'ngx.say("Hello World!")'|grep 'Hello World'}; +sh "sudo $prefix/nginx/sbin/nginx -sstop"; + warn "=== Without Gzip/SSL/PCRE ===\n"; $prefix = "/usr/local/openresty-nogzip"; sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html"; @@ -221,6 +260,13 @@ http { end '; + upstream backend { + server 0.0.0.1; + balancer_by_lua_block { + print("balancer!") + } + } + server { listen *:80; server_name localhost;