changeset 1262:b35037b3a9d0

Tests: added "proxy_bind transparent" test with Linux capabilities.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 19 Dec 2017 19:51:19 +0300
parents 5da72eaa893f
children ea3c7659b6c1
files proxy_bind_transparent_capability.t
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
copy from proxy_bind_transparent.t
copy to proxy_bind_transparent_capability.t
--- a/proxy_bind_transparent.t
+++ b/proxy_bind_transparent_capability.t
@@ -3,7 +3,8 @@
 # (C) Sergey Kandaurov
 # (C) Nginx, Inc.
 
-# Tests for http proxy_bind transparent.
+# Tests for http proxy_bind transparent with Linux CAP_NET_RAW capability.
+# Ensure that such configuration isn't broken under a non-priveleged user.
 
 ###############################################################################
 
@@ -22,7 +23,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-plan(skip_all => 'win32') if $^O eq 'MSWin32';
+plan(skip_all => 'no linux capability') if $^O ne 'linux';
 plan(skip_all => 'must be root') if $> != 0;
 plan(skip_all => '127.0.0.2 local address required')
 	unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.2' );
@@ -33,7 +34,6 @@ my $t = Test::Nginx->new()->has(qw/http 
 %%TEST_GLOBALS%%
 
 daemon off;
-user root wheel;
 
 events {
 }
@@ -63,6 +63,8 @@ http {
 
 EOF
 
+plan(skip_all => 'no capability support yet') unless $t->has_version('1.13.8');
+
 $t->run()->plan(1);
 
 ###############################################################################