}
+function TEST_crush_rename_bucket() {
+ local dir=$1
+
+ ./ceph osd crush add-bucket host1 host
+ ! ./ceph osd tree | grep host2 || return 1
+ ./ceph osd crush rename-bucket host1 host2 || return 1
+ ./ceph osd tree | grep host2 || return 1
+ ./ceph osd crush rename-bucket host1 host2 || return 1 # idempotency
+ ./ceph osd crush rename-bucket nonexistent something 2>&1 | grep "Error ENOENT" || return 1
+}
+
main osd-crush
# Local Variables:
# Ceph - scalable distributed file system
#
# Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
'add-bucket', '^^^',
'type']))
+ def test_crush_rename_bucket(self):
+ self.assert_valid_command(['osd', 'crush', 'rename-bucket',
+ 'srcname', 'dstname'])
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush']))
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush',
+ 'rename-bucket']))
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush',
+ 'rename-bucket',
+ 'srcname']))
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush',
+ 'rename-bucket', 'srcname',
+ 'dstname',
+ 'toomany']))
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush',
+ 'rename-bucket', '^^^',
+ 'dstname']))
+ assert_equal({}, validate_command(sigdict, ['osd', 'crush',
+ 'rename-bucket', 'srcname',
+ '^^^^']))
+
def check_crush_setter(self, setter):
self.assert_valid_command(['osd', 'crush', setter,
'*', '2.3', 'AZaz09-_.='])