@@ -58,7 +58,7 @@ def test_logs_requests(self, emit):
58
58
"""
59
59
60
60
emit .return_value = True
61
- conf = self .useFixture (fixtures .ConfFixture ()). conf
61
+ self .useFixture (fixtures .ConfFixture ())
62
62
self .useFixture (fixtures .RPCFixture ('nova.test' ))
63
63
api = self .useFixture (fixtures .OSAPIFixture ()).api
64
64
@@ -73,25 +73,6 @@ def test_logs_requests(self, emit):
73
73
'"GET /" status: 200 len: %s' % content_length )
74
74
self .assertIn (log1 , self .stdlog .logger .output )
75
75
76
- # Verify handling of X-Forwarded-For header, example: load balancer.
77
- # First, try without setting CONF.api.use_forwarded_for, it should not
78
- # use the header value.
79
- headers = {'X-Forwarded-For' : '1.2.3.4' }
80
- resp = api .api_request ('/' , strip_version = True , headers = headers )
81
- content_length = resp .headers ['content-length' ]
82
- log2 = ('INFO [nova.api.openstack.requestlog] 127.0.0.1 '
83
- '"GET /" status: 200 len: %s' % content_length )
84
- self .assertIn (log2 , self .stdlog .logger .output )
85
-
86
- # Now set CONF.api.use_forwarded_for, it should use the header value.
87
- conf .set_override ('use_forwarded_for' , True , 'api' )
88
- headers = {'X-Forwarded-For' : '1.2.3.4' }
89
- resp = api .api_request ('/' , strip_version = True , headers = headers )
90
- content_length = resp .headers ['content-length' ]
91
- log3 = ('INFO [nova.api.openstack.requestlog] 1.2.3.4 '
92
- '"GET /" status: 200 len: %s' % content_length )
93
- self .assertIn (log3 , self .stdlog .logger .output )
94
-
95
76
@mock .patch ('nova.api.openstack.requestlog.RequestLog._should_emit' )
96
77
def test_logs_mv (self , emit ):
97
78
"""Ensure logs register microversion if passed.
0 commit comments