Changeset 1044:1fe8d33f75ad in nginx-tests


Ignore:
Timestamp:
09/30/16 17:31:09 (4 years ago)
Author:
Sergey Kandaurov <pluknet@…>
Branch:
default
Phase:
public
Message:

Tests: split out geo tests with binary base and skip by default.

These tests require configuration with a large number of geo entries,
which may cause long configuration parsing and enrage waitforfile().

Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • geo.t

    r1016 r1044  
    158158        127.0.0.1-127.0.0.255  loopback;
    159159     }
    160 
    161     geo $geo_base_create {
    162         ranges;
    163         include  base.conf;
    164     }
    165 
    166     geo $geo_base_include {
    167         ranges;
    168         include  base.conf;
    169     }
    170160
    171161    server {
     
    185175            add_header X-IBe  $geo_insert_before;
    186176            add_header X-IAf  $geo_insert_after;
    187             add_header X-GBc  $geo_base_create;
    188             add_header X-GBi  $geo_base_include;
    189177            add_header X-Arg  $geo_from_arg;
    190178            add_header X-ARa  $geo_arg_ranges;
     
    206194$t->write_file('geo.conf', '127.0.0.0/8  loopback;');
    207195$t->write_file('geo-ranges.conf', '127.0.0.0-127.255.255.255  loopback;');
    208 $t->write_file('base.conf', join('', map {
    209         "127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." . $_ % 256 .
    210         "-127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." .$_ % 256 . " " .
    211         ($_ == 1 ? "loopback" : "range$_") . ";" } (0 .. 100000)));
    212196
    213197$t->run();
     
    216200        if http_get('/1') !~ /X-IP: 127.0.0.1/m;
    217201
    218 $t->plan(24);
     202$t->plan(22);
    219203
    220204###############################################################################
     
    241225like($r, qr/^X-IBe: loopback/m, 'geo ranges insert before');
    242226like($r, qr/^X-IAf: loopback/m, 'geo ranges insert after');
    243 like($r, qr/^X-GBc: loopback/m, 'geo binary base create');
    244 like($r, qr/^X-GBi: loopback/m, 'geo binary base include');
    245227
    246228like(http_get('/1?ip=192.0.2.1'), qr/^X-Arg: test/m, 'geo from variable');
  • stream_geo.t

    r1016 r1044  
    162162        127.0.0.1-127.0.0.255  loopback;
    163163     }
    164 
    165     geo $geo_base_create {
    166         ranges;
    167         include  base.conf;
    168     }
    169 
    170     geo $geo_base_include {
    171         ranges;
    172         include  base.conf;
    173     }
    174164
    175165    server {
     
    185175                 geo_insert_before:$geo_insert_before
    186176                 geo_insert_after:$geo_insert_after
    187                  geo_base_create:$geo_base_create
    188                  geo_base_include:$geo_base_include
    189177                 geo_from_addr:$geo_from_addr
    190178                 geo_from_var:$geo_from_var";
     
    231219$t->write_file('geo.conf', '127.0.0.0/8  loopback;');
    232220$t->write_file('geo-ranges.conf', '127.0.0.0-127.255.255.255  loopback;');
    233 $t->write_file('base.conf', join('', map {
    234         "127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." . $_ % 256 .
    235         "-127." . $_/256/256 % 256 . "." . $_/256 % 256 . "." .$_ % 256 . " " .
    236         ($_ == 1 ? "loopback" : "range$_") . ";" } (0 .. 100000)));
    237 
    238 $t->try_run('no stream geo')->plan(21);
     221
     222$t->try_run('no stream geo')->plan(19);
    239223
    240224###############################################################################
     
    261245is($data{geo_insert_before}, 'loopback', 'geo ranges insert before');
    262246is($data{geo_insert_after}, 'loopback', 'geo ranges insert after');
    263 is($data{geo_base_create}, 'loopback', 'geo binary base create');
    264 is($data{geo_base_include}, 'loopback', 'geo binary base include');
    265247
    266248is($data{geo_from_addr}, 'loopback', 'geo from addr');
Note: See TracChangeset for help on using the changeset viewer.