Skip to content

Instantly share code, notes, and snippets.

diff --git a/test/unit/obj/test_auditor.py b/test/unit/obj/test_auditor.py
index 99b79e2..29db0f7 100644
--- a/test/unit/obj/test_auditor.py
+++ b/test/unit/obj/test_auditor.py
@@ -244,6 +244,24 @@ class TestAuditor(unittest.TestCase):
self.assertEquals(auditor_worker.stats_buckets[10240], 0)
self.assertEquals(auditor_worker.stats_buckets['OVER'], 1)
+ def test_object_run_logging(self):
+ logger = FakeLogger()
diff --git a/test/probe/common.py b/test/probe/common.py
index 446aa25..78a4936 100644
--- a/test/probe/common.py
+++ b/test/probe/common.py
@@ -246,15 +246,10 @@ def get_to_final_state():
if __name__ == "__main__":
- for server in ('account', 'container'):
+ for server in ('account', 'container', POLICIES.default.ring_name):
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py
index 18a12d8..4d874c4 100644
--- a/test/unit/common/test_utils.py
+++ b/test/unit/common/test_utils.py
@@ -228,6 +228,29 @@ class TestTimestamp(unittest.TestCase):
)
for value in test_values:
self.assertEqual(utils.Timestamp(value).isoformat, expected)
+ expected = '1970-01-01T00:00:00.000000'
+ test_values = (
# Usual 'default domain' operations...
$ swift --os-auth-url http://u132.localdomain:5000/v3 -V 3 --os-username tester --os-tenant-name test --os-password testing post c1
$ swift --os-auth-url http://u132.localdomain:5000/v3 -V 3 --os-username tester --os-tenant-name test --os-password testing upload c1 junkfile
junkfile
$ swift --os-auth-url http://u132.localdomain:5000/v3 -V 3 --os-username tester --os-tenant-name test --os-password testing download c1 junkfile
junkfile [auth 0.195s, headers 0.235s, total 0.236s, 0.000 MB/s]
# Get a token for tester2...
diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py
index 9eeaafb..e3ce782 100644
--- a/test/unit/proxy/test_server.py
+++ b/test/unit/proxy/test_server.py
@@ -5178,17 +5178,16 @@ class TestContainerController(unittest.TestCase):
self.assert_status_map(controller.PUT,
(200, 201, 201, 201), 201,
missing_container=True)
-
self.app.max_containers_per_account = 12345
@alistairncoles
alistairncoles / Example CLI usage
Last active January 6, 2019 01:16
keystone v3 setup
EXAMPLE:
(keystone-v3-setup.sh script will perform first few steps using role 'admin')
# Create a domain named d1 (note use of --os-url and --os-token to manage keystone)
anc@u128:~$ openstack --os-url http://u132.localdomain:5000/v3 --os-identity-api-version 3 --os-token=ADMIN domain create d1
+---------+----------------------------------------------------------------------------------------+
| Field | Value |
+---------+----------------------------------------------------------------------------------------+
@alistairncoles
alistairncoles / gist:a98c0c607ff4253a4967
Last active August 29, 2015 14:04
data migration get_object() method returning a reader
diff --git a/swift/common/data_migrator_drivers.py b/swift/common/data_migrator_drivers.py
index 128d8b0..f004573 100644
--- a/swift/common/data_migrator_drivers.py
+++ b/swift/common/data_migrator_drivers.py
@@ -16,10 +16,12 @@ import os
import stat
import mimetypes
from xattr import xattr
+from swift.common.request_helpers import is_user_meta
@alistairncoles
alistairncoles / gist:4e5d3d91081d5de41ca1
Created August 8, 2014 14:20
refactor x-delete-* checks in obj controller
diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py
index a7f970a..926768e 100644
--- a/swift/proxy/controllers/obj.py
+++ b/swift/proxy/controllers/obj.py
@@ -271,12 +271,14 @@ class ObjectController(Controller):
return HTTPNotFound(request=req)
try:
- req, delete_at_container, delete_at_part, \
- delete_at_nodes = self._config_obj_expiration(req)
@alistairncoles
alistairncoles / gist:d50c8c3bf981cacbf583
Created August 13, 2014 14:52
unit tests for swift data migration
diff --git a/test/unit/common/middleware/test_data_migration.py b/test/unit/common/middleware/test_data_migration.py
index afe986e..40d3e83 100755
--- a/test/unit/common/middleware/test_data_migration.py
+++ b/test/unit/common/middleware/test_data_migration.py
@@ -14,6 +14,9 @@
# limitations under the License.
import unittest
+from swift.common.middleware.data_migration import DataMigrationError
+from swift.common.data_migrator_drivers import SwiftAccessDriver, \
@alistairncoles
alistairncoles / keystone
Created August 14, 2014 09:19
devstack/lib/keystone
# lib/keystone
# Functions to control the configuration and operation of **Keystone**
# Dependencies:
#
# - ``functions`` file
# - ``tls`` file
# - ``DEST``, ``STACK_USER``
# - ``IDENTITY_API_VERSION``
# - ``BASE_SQL_CONN``