diff options
author | Chuck Thier <cthier@gmail.com> | 2010-07-19 07:32:01 +0000 |
---|---|---|
committer | Tarmac <> | 2010-07-19 07:32:01 +0000 |
commit | 2ee5d7ee9c9b63ebe859ebe46fa93270cb465853 (patch) | |
tree | 21004cea8454ab0c6b634008a7a042e0eacde92a | |
parent | 1c6dc00a3fd320b111e86ac73eed0cb95b5b8242 (diff) | |
parent | 5e8bc7d8ca9448807e7b8ba221aee45c61878510 (diff) | |
download | swift-2ee5d7ee9c9b63ebe859ebe46fa93270cb465853.tar.gz |
Modified probe tests to work with setup.py develop installs
Updated SAIO instructions to note that probe tests will reset your environment
Added the swift.egg-info directory to .bzrignore
Updated setup.py to correctly ignore the test directory when installing
-rw-r--r-- | .bzrignore | 1 | ||||
-rw-r--r-- | doc/source/development_saio.rst | 6 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | test/probe/common.py | 12 | ||||
-rwxr-xr-x | test/probe/test_account_failures.py | 4 | ||||
-rwxr-xr-x | test/probe/test_container_failures.py | 8 | ||||
-rwxr-xr-x | test/probe/test_object_async_update.py | 4 | ||||
-rwxr-xr-x | test/probe/test_object_handoff.py | 20 | ||||
-rwxr-xr-x | test/probe/test_running_with_each_type_down.py | 6 |
9 files changed, 32 insertions, 31 deletions
diff --git a/.bzrignore b/.bzrignore index 57b544d23..12fc9b239 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,3 +1,4 @@ *.py[co] *.sw? doc/build/* +swift.egg-info diff --git a/doc/source/development_saio.rst b/doc/source/development_saio.rst index 015741e02..88fd423c8 100644 --- a/doc/source/development_saio.rst +++ b/doc/source/development_saio.rst @@ -443,13 +443,13 @@ good idea what to do on other environments. collate = C #. `cd ~/swift/trunk; ./.functests` - #. `cd ~/swift/trunk; ./.probetests` + #. `cd ~/swift/trunk; ./.probetests` (Note for future reference: probe tests + will reset your environment) If you plan to work on documentation (and who doesn't?!): #. `sudo apt-get install python-sphinx` - #. `cd ~/swift/doc` - #. `make html` + #. `python setup.py build_sphinx` ---------------- Debugging Issues @@ -26,7 +26,7 @@ setup( license='Apache License (2.0)', author='OpenStack, LLC.', url='https://launchpad.net/swift', - packages=find_packages(exclude=['tests','bin']), + packages=find_packages(exclude=['test','bin']), test_suite = 'nose.collector', classifiers=[ 'Development Status :: 4 - Beta', diff --git a/test/probe/common.py b/test/probe/common.py index 8465782f0..de41ae6e2 100644 --- a/test/probe/common.py +++ b/test/probe/common.py @@ -35,15 +35,15 @@ def reset_environment(): call(['resetswift']) pids = {} try: - pids['auth'] = Popen(['/usr/bin/swift-auth-server', + pids['auth'] = Popen(['swift-auth-server', '/etc/swift/auth-server.conf']).pid - pids['proxy'] = Popen(['/usr/bin/swift-proxy-server', + pids['proxy'] = Popen(['swift-proxy-server', '/etc/swift/proxy-server.conf']).pid port2server = {} for s, p in (('account', 6002), ('container', 6001), ('object', 6000)): for n in xrange(1, 5): pids['%s%d' % (s, n)] = \ - Popen(['/usr/bin/swift-%s-server' % s, + Popen(['swift-%s-server' % s, '/etc/swift/%s-server/%d.conf' % (s, n)]).pid port2server[p + (n * 10)] = '%s%d' % (s, n) account_ring = Ring('/etc/swift/account.ring.gz') @@ -69,7 +69,7 @@ def get_to_final_state(): for job in ('account-replicator', 'container-replicator', 'object-replicator'): for n in xrange(1, 5): - ps.append(Popen(['/usr/bin/swift-%s' % job, + ps.append(Popen(['swift-%s' % job, '/etc/swift/%s-server/%d.conf' % (job.split('-')[0], n), 'once'])) @@ -78,7 +78,7 @@ def get_to_final_state(): ps = [] for job in ('container-updater', 'object-updater'): for n in xrange(1, 5): - ps.append(Popen(['/usr/bin/swift-%s' % job, + ps.append(Popen(['swift-%s' % job, '/etc/swift/%s-server/%d.conf' % (job.split('-')[0], n), 'once'])) @@ -88,7 +88,7 @@ def get_to_final_state(): for job in ('account-replicator', 'container-replicator', 'object-replicator'): for n in xrange(1, 5): - ps.append(Popen(['/usr/bin/swift-%s' % job, + ps.append(Popen(['swift-%s' % job, '/etc/swift/%s-server/%d.conf' % (job.split('-')[0], n), 'once'])) diff --git a/test/probe/test_account_failures.py b/test/probe/test_account_failures.py index 2e84cc064..97397084e 100755 --- a/test/probe/test_account_failures.py +++ b/test/probe/test_account_failures.py @@ -110,7 +110,7 @@ class TestAccountFailures(unittest.TestCase): ps = [] for n in xrange(1, 5): - ps.append(Popen(['/usr/bin/swift-container-updater', + ps.append(Popen(['swift-container-updater', '/etc/swift/container-server/%d.conf' % n, 'once'])) for p in ps: @@ -130,7 +130,7 @@ class TestAccountFailures(unittest.TestCase): self.assert_(found2) self.pids[self.port2server[anodes[0]['port']]] = \ - Popen(['/usr/bin/swift-account-server', + Popen(['swift-account-server', '/etc/swift/account-server/%d.conf' % ((anodes[0]['port'] - 6002) / 10)]).pid sleep(2) diff --git a/test/probe/test_container_failures.py b/test/probe/test_container_failures.py index cc042cb1c..932f821c1 100755 --- a/test/probe/test_container_failures.py +++ b/test/probe/test_container_failures.py @@ -59,7 +59,7 @@ class TestContainerFailures(unittest.TestCase): client.get_container(self.url, self.token, container)]) self.pids[self.port2server[cnodes[0]['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnodes[0]['port'] - 6001) / 10)]).pid sleep(2) @@ -135,7 +135,7 @@ class TestContainerFailures(unittest.TestCase): client.get_container(self.url, self.token, container)]) self.pids[self.port2server[cnodes[1]['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnodes[1]['port'] - 6001) / 10)]).pid sleep(2) @@ -210,7 +210,7 @@ class TestContainerFailures(unittest.TestCase): for x in xrange(2): self.pids[self.port2server[cnodes[x]['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnodes[x]['port'] - 6001) / 10)]).pid sleep(2) @@ -288,7 +288,7 @@ class TestContainerFailures(unittest.TestCase): for x in (1, 2): self.pids[self.port2server[cnodes[x]['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnodes[x]['port'] - 6001) / 10)]).pid sleep(2) diff --git a/test/probe/test_object_async_update.py b/test/probe/test_object_async_update.py index 841a7e6e7..4b4c3a49b 100755 --- a/test/probe/test_object_async_update.py +++ b/test/probe/test_object_async_update.py @@ -47,7 +47,7 @@ class TestObjectAsyncUpdate(unittest.TestCase): obj = 'object-%s' % uuid4() client.put_object(self.url, self.token, container, obj, '') self.pids[self.port2server[cnode['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnode['port'] - 6001) / 10)]).pid sleep(2) @@ -55,7 +55,7 @@ class TestObjectAsyncUpdate(unittest.TestCase): self.account, container)) ps = [] for n in xrange(1, 5): - ps.append(Popen(['/usr/bin/swift-object-updater', + ps.append(Popen(['swift-object-updater', '/etc/swift/object-server/%d.conf' % n, 'once'])) for p in ps: p.wait() diff --git a/test/probe/test_object_handoff.py b/test/probe/test_object_handoff.py index 885a6fb19..6afec7145 100755 --- a/test/probe/test_object_handoff.py +++ b/test/probe/test_object_handoff.py @@ -61,7 +61,7 @@ class TestObjectHandoff(unittest.TestCase): 'returned: %s' % repr(odata)) for node in onodes[1:]: self.pids[self.port2server[node['port']]] = Popen([ - '/usr/bin/swift-object-server', + 'swift-object-server', '/etc/swift/object-server/%d.conf' % ((node['port'] - 6000) / 10)]).pid sleep(2) @@ -86,7 +86,7 @@ class TestObjectHandoff(unittest.TestCase): 'Container server %s:%s did not know about object' % (cnode['ip'], cnode['port'])) self.pids[self.port2server[onode['port']]] = Popen([ - '/usr/bin/swift-object-server', + 'swift-object-server', '/etc/swift/object-server/%d.conf' % ((onode['port'] - 6000) / 10)]).pid sleep(2) @@ -101,12 +101,12 @@ class TestObjectHandoff(unittest.TestCase): # Run the extra server last so it'll remove it's extra partition ps = [] for n in onodes: - ps.append(Popen(['/usr/bin/swift-object-replicator', + ps.append(Popen(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((n['port'] - 6000) / 10), 'once'])) for p in ps: p.wait() - call(['/usr/bin/swift-object-replicator', + call(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((another_onode['port'] - 6000) / 10), 'once']) odata = direct_client.direct_get_object(onode, opart, self.account, @@ -139,7 +139,7 @@ class TestObjectHandoff(unittest.TestCase): raise Exception('Handoff server claimed it had the object when ' 'it should not have it') self.pids[self.port2server[onode['port']]] = Popen([ - '/usr/bin/swift-object-server', + 'swift-object-server', '/etc/swift/object-server/%d.conf' % ((onode['port'] - 6000) / 10)]).pid sleep(2) @@ -151,12 +151,12 @@ class TestObjectHandoff(unittest.TestCase): # Run the extra server last so it'll remove it's extra partition ps = [] for n in onodes: - ps.append(Popen(['/usr/bin/swift-object-replicator', + ps.append(Popen(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((n['port'] - 6000) / 10), 'once'])) for p in ps: p.wait() - call(['/usr/bin/swift-object-replicator', + call(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((another_onode['port'] - 6000) / 10), 'once']) ometadata = direct_client.direct_get_object(onode, opart, self.account, @@ -187,7 +187,7 @@ class TestObjectHandoff(unittest.TestCase): 'Container server %s:%s still knew about object' % (cnode['ip'], cnode['port'])) self.pids[self.port2server[onode['port']]] = Popen([ - '/usr/bin/swift-object-server', + 'swift-object-server', '/etc/swift/object-server/%d.conf' % ((onode['port'] - 6000) / 10)]).pid sleep(2) @@ -196,12 +196,12 @@ class TestObjectHandoff(unittest.TestCase): # Run the extra server last so it'll remove it's extra partition ps = [] for n in onodes: - ps.append(Popen(['/usr/bin/swift-object-replicator', + ps.append(Popen(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((n['port'] - 6000) / 10), 'once'])) for p in ps: p.wait() - call(['/usr/bin/swift-object-replicator', + call(['swift-object-replicator', '/etc/swift/object-server/%d.conf' % ((another_onode['port'] - 6000) / 10), 'once']) exc = False diff --git a/test/probe/test_running_with_each_type_down.py b/test/probe/test_running_with_each_type_down.py index a5682c7e3..fada1b18a 100755 --- a/test/probe/test_running_with_each_type_down.py +++ b/test/probe/test_running_with_each_type_down.py @@ -72,15 +72,15 @@ class TestRunningWithEachTypeDown(unittest.TestCase): self.assert_(found1) self.pids[self.port2server[anodes[0]['port']]] = \ - Popen(['/usr/bin/swift-account-server', + Popen(['swift-account-server', '/etc/swift/account-server/%d.conf' % ((anodes[0]['port'] - 6002) / 10)]).pid self.pids[self.port2server[cnodes[0]['port']]] = \ - Popen(['/usr/bin/swift-container-server', + Popen(['swift-container-server', '/etc/swift/container-server/%d.conf' % ((cnodes[0]['port'] - 6001) / 10)]).pid self.pids[self.port2server[onodes[0]['port']]] = \ - Popen(['/usr/bin/swift-object-server', + Popen(['swift-object-server', '/etc/swift/object-server/%d.conf' % ((onodes[0]['port'] - 6000) / 10)]).pid sleep(2) |