Pass memcache_servers as array

the python-memcached module expects memcache_servers to be an
array of strings or an array of tuples. Since we don't care about
server weighting, we can use an array of tuples for the unit test.

Fixes bug 1172723

Change-Id: Iafba2bda545ea334d5aba7135e153d8589612ba4
This commit is contained in:
Dirk Mueller
2013-04-25 16:11:19 +02:00
committed by Dolph Mathews
parent 3f40509751
commit 40db3fb6ad

View File

@@ -1061,7 +1061,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'cache': 'swift.cache', 'cache': 'swift.cache',
'memcache_servers': 'localhost:11211' 'memcache_servers': ['localhost:11211']
} }
self.set_middleware(conf=conf) self.set_middleware(conf=conf)
self.middleware._init_cache(env) self.middleware._init_cache(env)
@@ -1080,7 +1080,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'encrypt', 'memcache_security_strategy': 'encrypt',
'memcache_secret_key': 'mysecret' 'memcache_secret_key': 'mysecret'
} }
@@ -1103,7 +1103,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'mac', 'memcache_security_strategy': 'mac',
'memcache_secret_key': 'mysecret' 'memcache_secret_key': 'mysecret'
} }
@@ -1127,7 +1127,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_secret_key': 'mysecret' 'memcache_secret_key': 'mysecret'
} }
self.set_middleware(conf=conf) self.set_middleware(conf=conf)
@@ -1143,7 +1143,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_secret_key': 'mysecret' 'memcache_secret_key': 'mysecret'
} }
self.set_middleware(conf=conf) self.set_middleware(conf=conf)
@@ -1154,7 +1154,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'mac', 'memcache_security_strategy': 'mac',
'memcache_secret_key': 'mysecret' 'memcache_secret_key': 'mysecret'
} }
@@ -1165,7 +1165,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'Encrypt', 'memcache_security_strategy': 'Encrypt',
'memcache_secret_key': 'abc!' 'memcache_secret_key': 'abc!'
} }
@@ -1179,7 +1179,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'Encrypt' 'memcache_security_strategy': 'Encrypt'
} }
self.assertRaises(Exception, self.set_middleware, conf) self.assertRaises(Exception, self.set_middleware, conf)
@@ -1188,7 +1188,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'whatever' 'memcache_security_strategy': 'whatever'
} }
self.assertRaises(Exception, self.set_middleware, conf) self.assertRaises(Exception, self.set_middleware, conf)
@@ -1197,7 +1197,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'mac' 'memcache_security_strategy': 'mac'
} }
self.assertRaises(Exception, self.set_middleware, conf) self.assertRaises(Exception, self.set_middleware, conf)
@@ -1205,7 +1205,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'Encrypt', 'memcache_security_strategy': 'Encrypt',
'memcache_secret_key': '' 'memcache_secret_key': ''
} }
@@ -1214,7 +1214,7 @@ class AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
'auth_host': 'keystone.example.com', 'auth_host': 'keystone.example.com',
'auth_port': 1234, 'auth_port': 1234,
'auth_admin_prefix': '/testadmin', 'auth_admin_prefix': '/testadmin',
'memcache_servers': 'localhost:11211', 'memcache_servers': ['localhost:11211'],
'memcache_security_strategy': 'mAc', 'memcache_security_strategy': 'mAc',
'memcache_secret_key': '' 'memcache_secret_key': ''
} }