Permalink
Browse files

added a test file to exercise the bug that the memcached storage comm…

…ands hang in the eval block of the ngx_eval module.
  • Loading branch information...
1 parent 6c35d98 commit c55c56725bcef0c9e0772cbc460c9320f8a85e1e @agentzh agentzh committed Apr 5, 2010
Showing with 46 additions and 1 deletion.
  1. +45 −0 test/t/eval.t
  2. +1 −1 util/build.sh
View
45 test/t/eval.t
@@ -0,0 +1,45 @@
+# vi:filetype=perl
+
+use lib 'lib';
+use Test::Nginx::Socket skip_all => 'ngx_memc storage commands do not work with the ngx_eval module';
+
+plan tests => repeat_each() * 2 * blocks();
+
+#no_diff;
+
+run_tests();
+
+__DATA__
+
+=== TEST 1: set only
+--- http_config
+ upstream mc {
+ server localhost:11984;
+ }
+
+--- config
+ location = /main {
+ echo_location /eval;
+ echo_location /eval;
+ }
+ location = /eval {
+ #eval_subrequest_in_memory off;
+ eval_override_content_type text/plain;
+ eval $res {
+ default_type 'text/plain';
+ set $memc_cmd 'set';
+ set $memc_key 'jalla';
+ set $memc_value 'myvalue';
+ set $memc_exptime 24;
+ memc_pass mc;
+ }
+ echo [$res];
+ }
+
+--- request
+ GET /eval
+--- response_body eval
+"STORED\r\n"
+--- timeout: 10
+--- error_code: 200
+
View
2 util/build.sh
@@ -21,7 +21,7 @@ if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$
./configure --prefix=/opt/nginx \
--add-module=$root/../echo-nginx-module \
--add-module=$root $opts \
- --add-module=/home/agentz/work/nginx_eval_module-1.0.1 \
+ --add-module=$root/../eval-nginx-module \
--add-module=$home/work/nginx/ngx_http_upstream_keepalive-2ce9d8a1ca93 \
--with-debug
#--add-module=$home/work/nginx/nginx_upstream_hash-0.3 \

0 comments on commit c55c567

Please sign in to comment.