Mercurial > hg > nginx-tests
comparison access_log.t @ 1191:a9187b424a94
Tests: restored access mode in open_log_file_cache test earlier.
If something went wrong, that wouldn't leave directory in a bad state.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 16 Jun 2017 09:33:36 +0300 |
parents | 1c703303feee |
children | 7df2265e61be |
comparison
equal
deleted
inserted
replaced
1190:fcd65708672d | 1191:a9187b424a94 |
---|---|
156 http_get('/cache?logname=lru'); | 156 http_get('/cache?logname=lru'); |
157 http_get('/cache?logname=once'); | 157 http_get('/cache?logname=once'); |
158 http_get('/cache?logname=first'); | 158 http_get('/cache?logname=first'); |
159 http_get('/cache?logname=second'); | 159 http_get('/cache?logname=second'); |
160 | 160 |
161 chmod 0755, $t->testdir() . '/dir'; | |
162 | |
161 # wait for file to appear with nonzero size thanks to the flush parameter | 163 # wait for file to appear with nonzero size thanks to the flush parameter |
162 | 164 |
163 for (1 .. 10) { | 165 for (1 .. 10) { |
164 last if -s $t->testdir() . '/compressed.log'; | 166 last if -s $t->testdir() . '/compressed.log'; |
165 select undef, undef, undef, 0.1; | 167 select undef, undef, undef, 0.1; |
236 | 238 |
237 my $expected = join '', map { sprintf "\\x%02X", $_ } split /\./, $addr; | 239 my $expected = join '', map { sprintf "\\x%02X", $_ } split /\./, $addr; |
238 | 240 |
239 is($t->read_file('binary.log'), "$expected\n", 'binary'); | 241 is($t->read_file('binary.log'), "$expected\n", 'binary'); |
240 | 242 |
241 chmod 0755, $t->testdir() . '/dir'; | |
242 | |
243 SKIP: { | 243 SKIP: { |
244 skip 'win32', 4 if $^O eq 'MSWin32'; | 244 skip 'win32', 4 if $^O eq 'MSWin32'; |
245 | 245 |
246 is(@{[$t->read_file('/dir/cache_lru') =~ /\//g]}, 2, 'cache - closed lru'); | 246 is(@{[$t->read_file('/dir/cache_lru') =~ /\//g]}, 2, 'cache - closed lru'); |
247 is(@{[$t->read_file('/dir/cache_once') =~ /\//g]}, 1, 'cache - min_uses'); | 247 is(@{[$t->read_file('/dir/cache_once') =~ /\//g]}, 1, 'cache - min_uses'); |