-#!/bin/bash
+#!/usr/bin/env python
#
# Copyright (C) 2015, 2016 Red Hat <contact@redhat.com>
#
stop_daemon=lambda cluster, osd_id: True,
_remove_osd_directory_files=lambda path, cluster: True,
path_set_context=lambda path: True,
- unmount=lambda path: True,
+ unmount=lambda path, do_rm: True,
dmcrypt_unmap=lambda part_uuid: True,
):
main.main_deactivate(args)
stop_daemon=lambda cluster, osd_id: True,
_remove_osd_directory_files=lambda path, cluster: True,
path_set_context=lambda path: True,
- unmount=lambda path: True,
+ unmount=lambda path, do_rm: True,
dmcrypt_unmap=lambda part_uuid: True,
):
main.main_deactivate(args)
list_devices=list_devices_return,
get_partition_base=lambda dev_path: '/dev/sdY',
_check_osd_status=lambda cluster, osd_id: 0,
- _remove_from_crush_map=lambda cluster, osd_id: True,
- _delete_osd_auth_key=lambda cluster, osd_id: True,
- _deallocate_osd_id=lambda cluster, osd_id: True,
zap=lambda dev: True
):
main.main_destroy(args)
self.assertRaises(Exception, main.main_destroy, args)
shutil.rmtree(data)
- def test_remove_from_crush_map_fail(self):
- cluster = 'ceph'
- osd_id = '5566'
- with patch.multiple(
- main,
- command=raise_command_error
- ):
- self.assertRaises(Exception, main._remove_from_crush_map,
- cluster, osd_id)
-
- def test_delete_osd_auth_key_fail(self):
- cluster = 'ceph'
- osd_id = '5566'
- with patch.multiple(
- main,
- command=raise_command_error
- ):
- self.assertRaises(Exception, main._delete_osd_auth_key,
- cluster, osd_id)
-
- def test_deallocate_osd_id_fail(self):
- cluster = 'ceph'
- osd_id = '5566'
- with patch.multiple(
- main,
- command=raise_command_error
- ):
- self.assertRaises(Exception, main._deallocate_osd_id,
- cluster, osd_id)
-
def test_main_fix(self):
if platform.system() == "FreeBSD":
return