|
84 | 84 | 'name': 'Edge case - near limit', |
85 | 85 | 'description': 'Tests behavior near the rate limit threshold', |
86 | 86 | 'requests': [ |
87 | | - {'url': f'{API_BASE}/cc-index', 'params': {'url': DOMAINS[i], 'output': 'json', 'limit': DEFAULT_LIMIT}} |
| 87 | + { |
| 88 | + 'url': f'{API_BASE}/cc-index', |
| 89 | + 'params': { |
| 90 | + 'url': f'{DOMAINS[i]}/*', |
| 91 | + 'output': 'json', |
| 92 | + 'limit': DEFAULT_LIMIT |
| 93 | + } |
| 94 | + } |
88 | 95 | for i in range(9) |
89 | 96 | ], |
90 | 97 | 'delay_between': 7.0, # 9 requests in ~63 seconds (just under 10/60s limit) |
@@ -143,7 +150,7 @@ def make_request(url: str, params: Dict, request_num: int) -> Dict: |
143 | 150 | except requests.exceptions.Timeout: |
144 | 151 | result['error'] = 'Request timeout' |
145 | 152 | result['response_time'] = time.time() - start_time |
146 | | - # Timeout could indicate blocking, but not conclusive |
| 153 | + result['blocked'] = True |
147 | 154 | except requests.exceptions.ConnectionError as e: |
148 | 155 | result['response_time'] = time.time() - start_time |
149 | 156 | error_str = str(e) |
@@ -280,15 +287,15 @@ def print_summary(all_summaries: List[Dict]): |
280 | 287 | print(f' Completed {scenario["completed_requests"]}/{scenario["total_requests"]} without ban') |
281 | 288 | print() |
282 | 289 |
|
283 | | - print('📋 Recommendations:') |
284 | | - if too_strict: |
285 | | - print(' - Increase maxretry values') |
286 | | - print(' - Increase findtime windows') |
287 | | - print(' - Review filter patterns for false positives') |
288 | | - if too_lenient: |
289 | | - print(' - Decrease maxretry values') |
290 | | - print(' - Decrease findtime windows') |
291 | | - print(' - Verify fail2ban is running and filters are active') |
| 290 | + # print('📋 Recommendations:') |
| 291 | + # if too_strict: |
| 292 | + # print(' - Increase maxretry values') |
| 293 | + # print(' - Increase findtime windows') |
| 294 | + # print(' - Review filter patterns for false positives') |
| 295 | + # if too_lenient: |
| 296 | + # print(' - Decrease maxretry values') |
| 297 | + # print(' - Decrease findtime windows') |
| 298 | + # print(' - Verify fail2ban is running and filters are active') |
292 | 299 | return False |
293 | 300 | else: |
294 | 301 | print('✅ All test scenarios behaved as expected') |
|
0 commit comments